| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Exclude Products from Products Map | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Exclude Products from Products Map
I have a series of products that I want to be available for sale in a hidden category, but I don't want them to show up in the Products Map.
In this file: modules/Products_Map/func.php at line 153 in the function pmap_get_products($symb), I made this change: $query = " AND $sql_tbl[products].product REGEXP '^[{$symb}]' AND INSTR($sql_tbl[products].productcode,'clearance') = 0"; In the product code / SKU field for each product that I want to hide, I put the word clearance. You could use another series of letters or numbers. This code-- AND INSTR($sql_tbl[products].productcode,'clearance') = 0 -- checks to see if the string clearance shows up in the productcode field of each product. If it does, that product is excluded from the list. |
|||||||
#2
|
|||||||
|
|||||||
Re: Exclude Products from Products Map
The code in modules/Products_Map/func.php changed in v4.6. I changed this code in the pmap_get_products($symb) function:
if ($symb == '0-9') { $query['query'] = " AND $sql_tbl[products_lng_current].product REGEXP '^[{$symb}]' AND INSTR($sql_tbl[products_lng_current].product,'Clearance') = 0"; } else { $query['query'] = " AND $sql_tbl[products_lng_current].product LIKE '" . addslashes($symb) . "%' AND INSTR($sql_tbl[products_lng_current].product,'Clearance') = 0"; } It wasn't working to check the product code, so I checked the product title for the word "Clearance" to exclude those products from the Products Map. |
|||||||
|
|||
X-Cart forums © 2001-2020
|