Jump to content

price and qty is not displayed after quick search?


Recommended Posts

I have used custom code for displayed quantity and price option for product listing pages.

 So i have used following custom code in productlist.tpl.

 

<div class="right_block">
                <label>{l s='Select Quantity:'}</label>
                <select name="qty" id="quantity_wanted_{$product.id_product}" class="text" onchange="setQuantityList({$product.price},{$product.id_product},this)">
                            <!--
                            <option selected="selected">
                            {if isset($quantityBackup)}
                                {$quantityBackup|intval}
                            {else}
                                {if $product->minimal_quantity != 0 }
                                    {$product->minimal_quantity}
                                {else}
                                    1
                                {/if}
                            {/if}
                        </option>
                    -->

                                         
                    {foreach from=$quantity[$product.id_product]|@array_reverse item='quantity_discount' name='quantity_discounts'}
                    {if ($minimal_quantity == $quantity_discount.from_quantity)}

                        {else}
                        <option>{$quantity_discount.from_quantity|intval}</option>
                        {/if}
                    {/foreach}
                                    
                </select>

                <div>

                <!--<input id="price_show_{$product.id_product}" value="{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc * $minimal_quantity }{/if}" readonly>-->

                <input type="text" id='price_show_{$product.id_product}' value="">
                <script>
                    var minQty   = $('#quantity_wanted_{$product.id_product}').val();
                    var finalPrice = minQty*'{$product.price_tax_exc}';    
                    //alert(finalPrice);
                    //alert('price_show_'+'{$product.id_product}');
                    $('#price_show_'+'{$product.id_product}').val('$'+finalPrice.toFixed(2));

                </script>

Its working good for product category page. Please see attached. But when i have used search box for searching some more products here after i made some product search qty and price option is automatically going to 0. So here above script for the qty and price option is not working in search result products. So please any one help me would be better.

post-618037-0-47001000-1398077809_thumb.png

post-618037-0-47291700-1398077817_thumb.png

Link to comment
Share on other sites

×
×
  • Create New...