Product Display Templates

Product Display Templates are used to display products when a variable such as {{ shop.products }} or {{ order.items }}. These templates by setting the template parameter when using a variable. You can override the default template and create your own custom templates.


Override an existing template

The following templates are included by default but using template overrides:

  • Product Grid – 2 Column (product-grid-2-col.php)
  • Product Grid – 3 Column (product-grid-3-col.php)
  • Product Rows (product-rows.php)
  • Cart Table (cart-table.php)

In same way you can override a WooCommerce template file you can copy an AutomateWoo template file into a directory in your theme named /automatewoo/, keeping the same file path but removing the /templates/ subdirectory.

Create a custom template

Creating a custom product template is similar process but instead of overriding a file you are creating a new template. New templates should be added to the /automatewoo/email/ directory in your theme. You also need register your custom template and give it a name by using the automatewoo/variables/product_templates filter. See the example code below which can be added to the functions.php file in your theme.

		add_filter( 'automatewoo/variables/product_templates', 'my_automatewoo_product_templates' );

function my_automatewoo_product_templates( $templates )
	$templates['custom-product-template-1.php'] = 'Custom Product Template #1';
	return $templates;