Loaded Commerce Community

Banner


Board index » Loaded Commerce Support » Feedback

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Advanced Search Vaule problem
PostPosted: Wed Jun 27, 2007 2:49 pm 
Offline
CRE Newbie
User avatar

Joined: Tue May 01, 2007 12:00 am
Posts: 17
Hi eveybody: :oops:

When I go to "Advanced Search" function, then I input some amount of nubmer in the "Price From:" and "Price To:" . example: "Price From: 198 and Price To: 416", it suppose to find the price rank between 198 and 416, but I got error message as following:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') >= 198) and (if(s.status and s.specials_new_products_price, p.products_price) ' at line 6

select count(distinct p.products_id) as total from (((products p left join products_groups pg on p.products_id = pg.products_id and pg.customers_group_id like '%g%') left join specials s on p.products_id = s.products_id ) left join manufacturers m on p.manufacturers_id = m.manufacturers_id ) , products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and (if(s.status and s.specials_new_products_price, p.products_price) >= 198) and (if(s.status and s.specials_new_products_price, p.products_price) <= 416) and p.products_group_access like '%g%'

[TEP STOP]

I am using " CRE loaded 6.2 Pro B2B

Could you teach me how to fix it?

Thanks a lot for your big help!

Please help me to fix this problem as soon as possible.

Best Regards
Prince Chan


Top
 Profile  
 
 Post subject: Re: Advanced Search Vaule problem
PostPosted: Fri Aug 24, 2007 4:21 am 
Offline
CRE Freak
User avatar

Joined: Mon Jun 04, 2007 12:00 am
Posts: 40
Location: Da Lat - Lam Dong - VIETNAM
in catalog/template/content/advanced_search_result.tpl.php
replace
Code:
if (DISPLAY_PRICE_WITH_TAX == 'true') {
      if ($pfrom > 0) $where_str .= " and (IF(s.status AND s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double)$pfrom . ")";
      if ($pto > 0) $where_str .= " and (IF(s.status AND s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double)$pto . ")";
    } else {
      if ($pfrom > 0) $where_str .= " and (IF(s.status AND s.specials_new_products_price, p.products_price) >= " . (double)$pfrom . ")";

by this
Code:
if (DISPLAY_PRICE_WITH_TAX == 'true') {
      if ($pfrom > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double)$pfrom . ")";
      if ($pto > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double)$pto . ")";
    } else {
      if ($pfrom > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) >= " . (double)$pfrom . ")";
      if ($pto > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) <= " . (double)$pto . ")";
    }

It works for me :-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

Board index » Loaded Commerce Support » Feedback

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Wed May 23, 2012 9:08 pm
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Forums Latest Activity

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy