Forum
Perch Shop - Product detail page
I'm having a bit of trouble trying to get a product to show (after clicking on it from the product list page), please help! The steps I've take so far are:
- I've downloaded the shop files from GitHub and played around with the demo site.
- Set up a /shop page (that has the
<?php perch_shop_products() ?>
function to get the list of all the products. - Set up the basket and checkout pages (these work fine).
The issue I'm having is that when I click on the products from the list page I'm unsure how to use the <?php perch_shop_product() ?>
function to go through to a page that only has that specific product that I've clicked on. It's probably the most simple question but any help would be great, thank you.
I'm not using Runway too, just Perch 3.
You need to pass the product “slug” to the perch_shop_product() function to get the details for a specific product. Best to hard code the slug of an item first to make sure the function is working in your setup.
Please make sure to post your template with any additional question
:)
Thanks for your quick reply Robert :)
Here's my very simplistic templates, as I've tried hard coding a product into the
perch_shop_product()
.Shop Page
product detail page (product.php)
So on the shop page I've got anchor tags around the products (which is coming from the the list.html file). However After putting in a hard coded slug to the 'test-product-02' it injects that string into the url as ( /shop/?product=test-product-02 ) however the other products are still apparent along with this one. It's as if I'm missing a step to only show the product I've clicked on rather than the rest of the products as well.
Can you post your diagnostic report please?
Kieran,
Your form has no
So by default (get) will add all the fields to the url as a query string which is the behavior you describe. This is fine and working, I am just explaining why it adds to url.
Thank you, I'll change the method to post when I'm back at my computer.
Here's my diagnostic report...