Forum

Thread tagged as: Problem, Shop

Products not being returned by Perch Shop query

I've got a site using Perch Shop that works locally but isn't once I've put it live. The issue is with products not being displayed. I've (manually) mirrored the set up of the shop in each environment, and I'm comparing local to live debug messages in an attempt to resolve this.

SELECT DISTINCT idx.itemID FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' AND ((idx.indexKey='_category' AND idx.indexValue LIKE 'products/events%' OR idx.indexKey='_category' AND idx.indexValue='products/events'))

… returns 5 locally but 0 on live (where there's only a single product thus far), which means that the subsequent query contains

… AND idx.itemID IN (NULL) …

whereas the working local version reads as

… AND idx.itemID IN ('3', '5', '6', '4', '2') …

and so returns nil rows.

There's a slight difference in PHP/MySQL. Could that affect this?

Local:

Perch: 2.8.34, PHP: 5.6.27, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id$, with PDO
Server OS: Darwin, apache2handler

Live:

Perch: 2.8.34, PHP: 5.4.25, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO
Server OS: Linux, cgi-fcgi

Full debug messages here:

Ta.

Pete Aylward

Pete Aylward 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Which page function are you using?

Gah! Sorry Drew, I'm being a muppet: I'd not used plurals for my category names yet was querying on event_s_ rather than event.