Forum

Thread tagged as: Question, Addons, Shop

Get product slug for Perch Shop

Hi I'm trying to get the product slug from the URL to output products in the new Perch shop but cannot get it working.

In my list template I have the following:

<a href="/shop/products/index.php?product=<perch:shop id="slug" type="slug" />/">

and then to add this slug into the perch_shop_product function on my product page:

perch_shop_product(perch_get('product'));

...but it doesn't work - can you tell me where I've gone wrong?

Thanks! Alex

Alex Bennett

Alex Bennett 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Which part isn't working? The first place to look would be at that trailing slash you're adding to the slug.

Doh! Thanks Drew - I missed that. Works fine now...