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

Display Lowest Wholesale Price on Search Results Pages v4.1.x

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 03-11-2008, 01:27 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Display Lowest Wholesale Prices on Search Results Pages v4.x

Quite a few people have asked for this, so here we go...

eg.
As low as ё199 each!

1) In products.php AND include/search.php

Before...
Code:
$smarty->assign("products",$products);
Insert...
Code:
########################################## # Display Lowest Wholesale Prices Start if (!empty($products) && !empty($active_modules["Wholesale_Trading"])) foreach($products as $i=>$p) { $productid=$p["productid"]; include $xcart_dir."/modules/Wholesale_Trading/product.php"; if ($wresult) $products[$i]["wholesale"] = $wresult; } $smarty->assign("product_wholesale", ""); $smarty->assign("products_wholesale", $products_wholesale); # Display Lowest Wholesale Prices End ##########################################
2) In featured_products.php

Before...
Code:
$smarty->assign("f_products",$products);
Insert...
Code:
########################################## # Display Lowest Wholesale Prices Start if (!empty($featured_products) && !empty($active_modules["Wholesale_Trading"])) foreach($featured_products as $i=>$p) { $productid=$p["productid"]; include $xcart_dir."/modules/Wholesale_Trading/product.php"; if ($wresult) $products[$i]["wholesale"] = $wresult; } $smarty->assign("product_wholesale", ""); $smarty->assign("products_wholesale", $products_wholesale); # Display Lowest Wholesale Prices End ##########################################
3) Create a new file...

skin1/customer/main/products_prices.tpl
Code:
{* Display Lowest Wholesale Prices Start *} {if $product_wholesale ne ""} {section name=wi loop=$product_wholesale} {if $smarty.section.wi.last}{$lng.lbl_as_low_as} {include file="currency.tpl" value=$product_wholesale[wi].taxed_price} {$lng.lbl_each}!{/if} {/section} {/if} {* Display Lowest Wholesale Prices End *}
4) If displaying products in columns...

In skin1/customer/main/products_t.tpl

Insert...
Code:
{* Display Lowest Wholesale Prices Start *} {include file="customer/main/products_prices.tpl" product_wholesale=$products[product].wholesale} {* Display Lowest Wholesale Prices End *}
Otherwise add the above code to skin1/customer/main/products.tpl

5) Add two new language labels with this SQL patch...
Code:
INSERT INTO xcart_languages SET code='US', name='lbl_as_low_as', value='As low as', topic='Labels'; INSERT INTO xcart_languages SET code='US', name='lbl_each', value='each', topic='Labels';
6) Run cleanup.php

Made for v4.1.x but should work in v4.0.x also.

__________________
xcartmods.co.uk
Reply With Quote
  #2  
Old 03-12-2008, 06:00 AM
 
Nadeem Nadeem is offline
 

Advanced Member
  
Join Date: Sep 2006
Posts: 56
 

Default Re: Display Lowest Wholesale Price on Search Results Pages v4.1.x

good work m thanks for sharing
__________________
X-Cart 4.4.5 | Linux/Apache | PHP 5.2.17 | MySQL 5.0.77 | FireFox
Reply With Quote
  #3  
Old 03-29-2010, 08:29 PM
 
drudden drudden is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 66
 

Default Re: Display Lowest Wholesale Price on Search Results Pages v4.1.x

I tried this on 4.3, but I can't get it to work. It looks like products.php has been modified since 4.1.

Did anyone have luck with this on 4.3?
__________________
Thanks,

Dan

X-Cart Version 4.3.1
Reply With Quote
  #4  
Old 07-22-2010, 05:00 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Display Lowest Wholesale Price on Search Results Pages v4.1.x

v4.3.x users...

1) Skip the step where it says add code to products.php

2) In step 4 above use this code instead...

Code:
{* Display Lowest Wholesale Prices Start *} {include file="customer/main/products_prices.tpl" product_wholesale=$product.wholesale} {* Display Lowest Wholesale Prices End *}

3) Use this SQL patch instead...

Code:
REPLACE INTO xcart_languages SET code='en', name='lbl_as_low_as', value='As low as', topic='Labels'; REPLACE INTO xcart_languages SET code='en', name='lbl_each', value='each', topic='Labels';
__________________
xcartmods.co.uk
Reply With Quote
  #5  
Old 08-27-2010, 11:14 AM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Re: Display Lowest Wholesale Price on Search Results Pages v4.1.x

Quote:
Originally Posted by PhilJ
v4.3.x users...

1) Skip the step where it says add code to products.php


Do you mean skip all of part one Phil:
1) In products.php AND include/search.php

or to just do it for include/search.php, but skip it for products.php?
__________________
X-Cart Gold Version 4.3.2
Reply With Quote
  #6  
Old 08-27-2010, 11:22 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Display Lowest Wholesale Price on Search Results Pages v4.1.x

skip the part for products.php
I just updated the language patch too for v4.3.x
__________________
xcartmods.co.uk
Reply With Quote
  #7  
Old 11-17-2010, 09:54 AM
 
chapel chapel is offline
 

Advanced Member
  
Join Date: Oct 2005
Posts: 51
 

Default Re: Display Lowest Wholesale Price on Search Results Pages v4.1.x

Can this be done on 4.4.1 ?
__________________
x-cart 4.4.3
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 09:09 AM.

   

 
X-Cart forums © 2001-2020