Forum

Thread tagged as: Shop

perch_shop_cart variables

Hi,

In the Prech shop app I see how I can use the cart variables in HTML pages using their ID's. Example:

<perch:if id="product_count" match="gt" value="0">

Is it possible to use these on a php page?

I tried something like this but no luck

<?php 
perch_shop_cart();
if ($product_count > 0) {
Do something
} ?>
Shawn North

Shawn North 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I think you can use skip-template with perch_shop_cart()

$cart = perch_shop_cart(['skip-template'=>true]);

Perfect. Thanks!