Skip to content

Commit

Permalink
Updated readme and removed Collections data attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
SaFrMo committed Jun 28, 2017
1 parent 7fa2926 commit f0748ab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ It consists of two parts:
In the Installation step, you synced your product data to your Shopify store. Now you'll define how to display that data on your Wordpress site.

1. Your Shopify products are a custom post type called `wps-product`. This gives you full access to Wordpress's built-in post type functionality - see [this page](https://codex.wordpress.org/Post_Types#Custom_Post_Type_Templates) for more details.
1.
1. **Wrap your product in an element with `data-product-id` set correctly.** For example, when in the Loop:

<div class="product-wrapper" data-product-id="<?php the_product_id(); ?>">
Expand Down Expand Up @@ -116,11 +115,13 @@ Custom Underscore cart templates are set up in the same way as custom product te

The plugin imports Shopify Collections as a custom taxonomy called `wps_collection`.

Each Collection in Shopify becomes a term in the `wps_collection` taxonomy.
Each Collection in Shopify becomes a term in the `wps_collection` taxonomy.

TODO: Document `_wps_collection_image` metadata
Each term has a custom piece of metadata called `_wps_collection_image` that contains the URL to the image associated with a Collection. You can set this image on Shopify, then show the image on your site like this:

To set up custom collection templates, create `taxonomy-wps_collection.php` in your theme (see the [Template Hierarchy](https://developer.wordpress.org/files/2014/10/template-hierarchy.png)).
`<image src="<?php echo $your_term->_wps_collection_image; ?>">`

All functions having to do with `wps_collection` terms fall under standard Wordpress methods for dealing with custom taxonomies and terms - for example, to set up custom collection templates, create `taxonomy-wps_collection.php` in your theme (see the [Template Hierarchy](https://developer.wordpress.org/files/2014/10/template-hierarchy.png)).

## Advanced
### Updating Products
Expand Down
14 changes: 0 additions & 14 deletions js/wshop.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var wshop = {
wshop.initShopify();
wshop.initCart();
wshop.initProducts();
wshop.initCollectionLists();

},

Expand Down Expand Up @@ -92,19 +91,6 @@ var wshop = {

},

initCollectionLists: function(){

// render any category lists
wshop.shopClient.fetchAllCollections().then(function(collections){

jQuery('*[data-collection-list]').each(function(){
wshop.renderTemplate.bind(this)('collection-list', collections);
});

});

},

initProducts: function(){

// find any products on the page
Expand Down
Binary file removed shopify/wp-shopify-theme.zip
Binary file not shown.

0 comments on commit f0748ab

Please sign in to comment.