Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Exclude Products from Products Map

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 02-20-2012, 05:33 PM
 
notgrass notgrass is offline
 

Advanced Member
  
Join Date: Dec 2011
Location: Tennessee
Posts: 33
 

Default 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.
__________________
X-Cart v4.6.5
www.notgrass.com/notgrass/
Reply With Quote
  #2  
Old 10-25-2014, 10:01 AM
 
notgrass notgrass is offline
 

Advanced Member
  
Join Date: Dec 2011
Location: Tennessee
Posts: 33
 

Default 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 v4.6.5
www.notgrass.com/notgrass/
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:34 AM.

   

 
X-Cart forums © 2001-2020