We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum


Thread tagged as: Question, Shop

Adding template to perch_shop_order


I'm trying to add 'template' => 'my-template.html’ to;

<?php perch_shop_order(perch_get('orderID')); ?>

Looking at the docs, I thought;

<?php perch_shop_order($order_id, [
    'template' => 'orders/items.html'
]); ?>

would work, but in debug it doesn't show that the template is either being used or missing? Is it down to the way I'm getting the ID (orderID v $order_id)?

Wayne Hooper

Wayne Hooper 6 points

  • 2 years ago

Hi Wayne

This should work. Is there no path at all shown in your debug? This function defaults to the template at /shop/orders/order.html.

If you're taking the order ID from the URL then

<?php perch_shop_order(perch_get('orderID')); ?>

Does the same as

<?php perch_shop_order(perch_get('orderID'), [
'template' => 'shop/orders/order.html']
); ?>


Thanks Jon

Your example made me realise I was missing shop/ from my path to the template.

Regards Wayne

You're welcome!