View Single Post
  #4  
Old 04-11-2008, 03:43 AM
 
mattia mattia is offline
 

Member
  
Join Date: May 2004
Location: rome, italy
Posts: 24
 

Default Re: drop down quantities with wholesale prices

thanks gaussboy, works nicely, although I have 2 problems:

1) In product detail page the product only has 2 wholesale prices defined (qty= 2 and qty=3+). The drop down only shows the items as they should for qty=1, 2 and 3, but not for the remaining (4, 5, etc).

2) I'd like to add the same facility to the catalog pages (skin1/customer/main/products.tpl). I located the same hunk, replaced with yours but it doesn't work. Any ideas why?

Here's what I have:

----------------------------

{assign var="start_quantity" value=$product.min_amount}
{/if}
<option value="0">0</option>

{* Original quantity drop down START

{section name=quantity loop=$mq start=$start_quantity}
<OPTION value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</OPTION>
{/section}

Original quantity drop down END *}

{* MODIFIED quantity drop down START *}

{if $product_wholesale ne ""}
{section name=wholesale loop=$product_wholesale}
{if $smarty.section.wholesale.first}
<OPTION value="{$product.min_amount}">{$product.min_amount }x{include file="currency.tpl" value=$product.taxed_price}{$lng.lbl_each}</OPTION>
{/if}
<OPTION value="{$product_wholesale[wholesale].quantity}">{$product_wholesale[wholesale].quantity}x{include file="currency.tpl" value=$product_wholesale[wholesale].taxed_price}{$lng.lbl_each}</OPTION>
{/section}
{/if}
{if $product_wholesale eq ""}
{section name=quantity loop=$mq start=$start_quantity}
<OPTION value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</OPTION>
{/section}
{/if}

{* MODIFIED quantity drop down END *}

</SELECT>
{/if}
</TD>

----------------------------

Thanks, nice hack!
__________________
------------------------
X-Cart: 4.0.15 Gold
Apache 2.0.52 / PHP 4.4.6 / MySQL Server: 4.1.22-standard-log, client: 5.0.27
Reply With Quote