Forum

Thread tagged as: Question, Shop

Searching for products with variants

I have Shop installed on my site and currently implementing the Perch search function (to search for products).

Say I have a product with three variants, the product detail page being 'product.php?item={productslug}. When I search for this product, I get 4 results:

The first search result is correct at 'product.php?item={productslug}'. Results 2-4 go to the product page and have the correct result_title but don't include the slug in the URL: 'product.php?item='.

I'm assuming this is because of the variants, since there's three. Is this a bug or can I fix/hide those blank results?

Diagnostics:

Perch: 3.0.11, PHP: 5.6.30, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: WINNT, cgi-fcgi
Installed apps: content (3.0.11), assets (3.0.11), categories (3.0.11), perch_kraken (1.1), perch_shop_orders (1.2.5), perch_shop_products (1.2.5), perch_shop (1.2.5), perch_members (1.6.2)
App runtimes: <?php $apps_list = [ 'perch_members', 'perch_shop' ];
PERCH_LOGINPATH: /perch
PERCH_PATH: ...\KuttingEdge-dev\perch
PERCH_CORE: ...\KuttingEdge-dev\perch\core
PERCH_RESFILEPATH: ...\KuttingEdge-dev\perch\resources
Image manipulation: GD
PHP limits: Max upload 100M, Max POST 100M, Memory: 1024M, Total max file upload: 100M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: ...\KuttingEdge-dev
HTTP_HOST: kuttingedge.sungraphicsmedia.com

Thanks,

Jared Dutra

Jared Dutra 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can probably hide them by testing for productslug in the template. I'll have to look to see if there's a way we can prevent them being returned.