Thread tagged as: Question, Addons, Shop

Perch shop product detail page

Hi, Please could someone show me an example of the code on their detailed product page. I am using the standard templates for now and a few products just to get a working model. Using the list.html template with

<? perch_shop_products(); ?>

inside. All my products are displayed in my demo shop page and If I hover over a product I can see the link is right and when clicked it opens a page with the correct link e.g. https://localhost/shop/products/nice-card-001/ but no product is displayed.

I have created a basic product.php page using the product.html template to display a single product but am unsure what else I need to add to

<? perch_shop_product(); ?>

Have tried variations of

<? perch_shop_product([slug]); ?>

I know this is probably simple but I just can't find the right info.


William Chicken

William Chicken 1 points

  • 5 years ago

Ok, I now seem to have a working model. Could someone confirm all of this is right.

In my dash board settings i have /shop/products/{slug} set as my product URL.

In routes my pattern is shop/products/[slug:product]

On my list page the default

<a href="/shop/products/<perch:shop id="slug" type="slug" />/">

and on my product page e.g.. where I want it to dynamically grab the end of the URL and display my product

 <?php perch_shop_product(perch_get('product'));?>

This seems to be right but if anyone can identify any potential pit falls please let me know.


Hi William,

That is the same as what I have, so looks good to me! Had a shop running live for a while now with it and no issues.

Brilliant! I knew it would be simple.

Thanks Mike )