Skip to content

Instantly share code, notes, and snippets.

@Dayjo
Last active December 27, 2015 18:59
Show Gist options
  • Save Dayjo/7373524 to your computer and use it in GitHub Desktop.
Save Dayjo/7373524 to your computer and use it in GitHub Desktop.
WDK Shop Documentation

WDK Shop Templates

WDKing Shop Templates is really no more difficult than WDKing a template.

The Shop WDK currently consists of three different templates;

  • Category
  • Category Product
  • Product

Category

The category template is responsible for displaying a category. This usually consists of the following list of elements;

  • Breadcrumb
  • Login / register links
  • Category introduction
  • List of sub-categories
  • List of products in the current category
  • Product pagination
  • Back to top link
  • Category footer

Category Product

The category product template is for each individual product displayed in a category page This usually consists of the following list of elements;

  • Thumbnail image
  • Product Title
  • Price ( or sale price )
  • Banner (sold out, or sale)
  • Seperate link to the product

Product

The product template is for each individual product's page This usually consists of the following list of elements;

  • View basket / checkout links
  • Full Featured Image
  • Thumbnails of other images Coming Soon
  • Title
  • Description
  • Options and add to basket button
  • Price ( or sale price )

Tags

As the shop WDK templates are plugins to the normal WDK, the tags all begin with <!--WDK:plugin:

Category Information

Category Introduction / Header

Tag: <!--WDK:plugin:shopcategory:property:content_intro-->

Description: Outputs the content from the Category Introduction.

Usage:

<div class="category">
  <!--WDK:plugin:shopcategory:property:content_intro-->
  
  ...
  
  <!--WDK:plugin:shopcategory:property:content_footer-->
</div>

Category Listing Heading

Tag: <!--WDK:plugin:shopcategory:property:category_listing_heading-->

Description: Outputs the Category Listing Heading _e.g. "Categories:"

Usage:

<div class="category">
	<!--WDK:plugin:shopcategory:property:category_listing_heading-->
	 
	<!-- INSERT SUB CATEGORY CODE HERE -->

	...

Category Footer

Tag: <!--WDK:plugin:shopcategory:property:content_footer-->

Description: Outputs the content from the Category Footer

Usage:

<div class="category">
  <!--WDK:plugin:shopcategory:property:content_intro-->
  
  ...
  
  <!--WDK:plugin:shopcategory:property:content_footer-->
</div>

Sub Categories

Start the Sub Category Loop

Tag: <!--WDK:plugin:shopcategory:subcategory:start-->

Description: Starts the loop of the sub categories of this category.

Usage:

	<div class="sub-category-list">
	<!--WDK:plugin:shopcategory:subcategory:start-->
		<div class="sub-category">
		...
		</div>
	<!--WDK:plugin:shopcategory:subcategory:end-->
	</div>

End the Sub Category Loop

Tag: <!--WDK:plugin:shopcategory:subcategory:end-->

Description: If using the subcategory:start tag, you must also include the end tag.

Usage:

	<div class="sub-category-list">
	<!--WDK:plugin:shopcategory:subcategory:start-->
		<div class="sub-category">
		...
		</div>
	<!--WDK:plugin:shopcategory:subcategory:end-->
	</div>

Sub Category Image URL

Tag: <!--WDK:plugin:shopcategory:subcategory:item:image-->

Description: Outputs the source of the sub category image.

Usage:

	<div class="sub-category">
		<img src="<!--WDK:plugin:shopcategory:subcategory:item:image-->" />
	</div>

Sub Category Title

Tag: <!--WDK:plugin:shopcategory:subcategory:item:title-->

Description: Outputs the title of the sub category.

Usage:

	<div class="sub-category">
		<strong><!--WDK:plugin:shopcategory:subcategory:item:title--></strong>
	</div>

Sub Category URL

Tag: <!--WDK:plugin:shopcategory:subcategory:item:url-->

Description: Outputs the url to link to the sub category.

Usage:

	<div class="sub-category">
		<a href="<!--WDK:plugin:shopcategory:subcategory:item:url-->"><!--WDK:plugin:shopcategory:subcategory:item:title--></a>
	</div>

Products

Tag Output
<!--WDK:plugin:shopcategory:pagination--> Product List pagination for the category
<!--WDK:plugin:shop:property:product_listing_heading--> Product Listing Headering e.g. "Products:"

Extra Tags

Output Tag
Breadcrumb <!--WDK:plugin:shopcategory:breadcrumb-->
Image Effects JS <!--WDK:plugin:shopcategory:imageeffectplugin-->

Logic

Expression Tag
If the current category has a parent category <!--WDK:if:plugin:shopcategory:property:parent-->
If the Use Basket shop config settings set <!--WDK:ifnot:plugin:shop:property:use_basket-->
If the Shop Search shop config setting set <!--WDK:if:plugin:shop:property:shop_search-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment