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

Buy more Pay Less feature

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-10-2006, 05:38 AM
 
Lee Lee is offline
 

Advanced Member
  
Join Date: Dec 2002
Posts: 95
 

Default Buy more Pay Less feature

Afternoon all,

We have a 5plus price feature on our site, which currently only displays on the actual product detail page. As we are expanding our 5plus price to cover all our products I want to display this feature on the products.tpl listing.

Currently on product.tpl I have
{if $variants eq ''}
{include file="customer/main/product_prices.tpl"}
{/if}

This file contains the following loop within a {if $product_wholesale ne ""}

Pay only <FONT CLASS="buymore">{section name=wi loop=$product_wholesale}{include file="currency.tpl" value=$product_wholesale[wi].price}{/section}</FONT> each when you buy <FONT CLASS="buymore">{section name=wi loop=$product_wholesale}{$product_wholesale[wi].quantity}{if $smarty.section.wi.last}{else}-{$product_wholesale[wi].next_quantity}{/if}{/section}</FONT> or more!

Within the products tpl page I have a call to a duplicated version of product_prices.tpl (with a _des in the title). I cannot get this to display unless I remove the if statement, and then when it does display I get no prices. What should I be looking to change, either the initial if statement or the Pay only loop above??

Thanks in advance!
__________________
Lee

X-Cart 4.0.14 - heavily modified! (Linux)
www.lasertechgroup.com/uk
Reply With Quote
  #2  
Old 08-10-2006, 02:18 PM
 
jdiehl jdiehl is offline
 

eXpert
  
Join Date: Dec 2003
Location: Kansas City, MO
Posts: 270
 

Default

You are calling templates that deal with 1 product on a page that deals with several products. That isn't going to work without more mods. Ideally you should edit the php file to pull that data so that you can just display it any time you want without have to call additional template files.

Additional template files are handy if you only do something once and awhile and you don't want to clutter your code. But if you are doing it every time just pull the variables and display them
__________________
Jason Diehl

Finding Cures for Your Online Headaches: http://www.internetmedicineman.com/
Reply With Quote
  #3  
Old 08-10-2006, 11:31 PM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default

Here's the coding I use ... Its a modified version of what I found on these forums about 6 months ago.

It works in v4.1.x but should work in v4.0.x as well.

Insert this where you want the text to appear.

Code:
{* get wholesale wholesale pricing data for product *} {php} $prodid=$this->_tpl_vars['pid']; $results = func_query("SELECT min(price) as price, max(quantity) as quantity FROM xcart_pricing WHERE productid='$prodid' AND quantity > 1 ORDER BY quantity"); $this->assign("sv_val",$results); $wsprice=$this->_tpl_vars['sv_val'][0]['price'] ; $wsqty=$this->_tpl_vars['sv_val'][0]['quantity'] ; if ($wsqty > 1) { echo " <font style='color: #ff9900; font-size: 7pt; font-style: italic'>"; echo "... as low as бё" . $wsprice . " when purchasing more than " . $wsqty . " items."; echo "</font>"; } {/php}
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 07:14 AM.

   

 
X-Cart forums © 2001-2020