olivyte Posted February 27, 2011 Share Posted February 27, 2011 Hello,I need to add quantity box on home featured page. Could someone help me Please Link to comment Share on other sites More sharing options...
olivyte Posted February 28, 2011 Author Share Posted February 28, 2011 Already working Found topic here how-to-add-quantity-to-your-home-featured-module, but for version 1.3.6 FIRST STEP doesn't work.I made these changes:1. In “homefeatured.tpl” under “/modules/homefeatured/” (line 19-24) {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2} {l s='Add to cart' mod='homefeatured'} {else} {l s='Add to cart' mod='homefeatured'} {/if} 2. Changed with below code: {if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2} {l s='Quantity :'} <input type="text" name="ajax_qty_to_add_to_cart[{$product.id_product|intval}]"id="quantity_wanted_{$product.id_product|intval}" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" /> {l s='Add to cart'} {else} {l s='Quantity :'} <input type="text" name="ajax_qty_to_add_to_cart[{$product.id_product|intval}]" id="quantity_wanted_{$product.id_product|intval}" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" /> {l s='Add to cart' mod='homefeatured'} {l s='Out of Stock' mod='homefeatured'} {/if} {l s='View' mod='homefeatured'} NEXT STEPS WERE GOOD from the previous link.3. After that save file and close. Then edit “ajax-cart.js” under “/modules/blockcart/” and go to line 10, find code: ajaxCart.add(idProduct, null, false, this); Change it with ajaxCart.add(idProduct, null, false, this, $('#quantity_wanted_'+idProduct).val()); Good luck Link to comment Share on other sites More sharing options...
pakitus Posted March 10, 2011 Share Posted March 10, 2011 Did it work for you??I'm trying your code in the 1.3.7 version, and doesn't work.Regards, Link to comment Share on other sites More sharing options...
olivyte Posted March 10, 2011 Author Share Posted March 10, 2011 For me, version 1.3.6, it works perfect.I'm not a programmer, just a ordinary user, so can't help you with modifications, if they are needed Link to comment Share on other sites More sharing options...
pakitus Posted March 10, 2011 Share Posted March 10, 2011 Don't worry...i will try with 1.3.6 version.Thanks, Link to comment Share on other sites More sharing options...
pakitus Posted March 10, 2011 Share Posted March 10, 2011 I've tried with the 1.3.6 version...and it isn't running for me.Did you do any other thing more??Thanks, Link to comment Share on other sites More sharing options...
olivyte Posted March 10, 2011 Author Share Posted March 10, 2011 I made these steps exactly as written. Link to comment Share on other sites More sharing options...
olivyte Posted March 10, 2011 Author Share Posted March 10, 2011 Found similar link http://www.prestashop.com/forums/viewthread/28136/P0/general_discussion/solved_add_quantity_box_to_product_listing Link to comment Share on other sites More sharing options...
pakitus Posted March 11, 2011 Share Posted March 11, 2011 I also tried their solution, but always happens the same. When i write the quantity and push the Add to cart button, the aplication brings me to a page where sais: There is 1 error : 01. product not foundDid it happen any time to you when you were developing your code??I almost understand your code, but i don't know what doing this:&token;={$static_token}I suppose it's the essence of the code, because it is the result of pushing the Add to cart button.Any comment will be welcome.Thanks, Link to comment Share on other sites More sharing options...
olivyte Posted March 11, 2011 Author Share Posted March 11, 2011 Hi Sorry, but I do not understand codes With the original homefeatured.tpl, products were showed like in firs picture.The original hemefeatured.tpl was: <!-- MODULE Home Featured Products --> {l s='Featured products!' mod='homefeatured'} {if isset($products) AND $products} {assign var='liHeight' value=242} {assign var='nbItemsPerLine' value=4} {assign var='nbLi' value=$products|@count} {assign var='nbLines' value=$nbLi/$nbItemsPerLine|ceil} {assign var='ulHeight' value=$nbLines*$liHeight} {foreach from=$products item=product name=homeFeaturedProducts} {$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'} getImageLink($product.link_rewrite, $product.id_image, 'home')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" /> {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} {l s='View' mod='homefeatured'} {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2} {l s='Add to cart' mod='homefeatured'} {else} {l s='Add to cart' mod='homefeatured'} {/if} {/foreach} {else} {l s='No featured products' mod='homefeatured'} {/if} <!-- /MODULE Home Featured Products --> Link to comment Share on other sites More sharing options...
olivyte Posted March 11, 2011 Author Share Posted March 11, 2011 It was different from the other, described in other posts. My new homefeatured.tpl is: <!-- MODULE Home Featured Products --> {l s='Featured products!' mod='homefeatured'} {if isset($products) AND $products} {assign var='liHeight' value=242} {assign var='nbItemsPerLine' value=4} {assign var='nbLi' value=$products|@count} {assign var='nbLines' value=$nbLi/$nbItemsPerLine|ceil} {assign var='ulHeight' value=$nbLines*$liHeight} {foreach from=$products item=product name=homeFeaturedProducts} {$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'} getImageLink($product.link_rewrite, $product.id_image, 'home')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" /> {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} {if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2} {l s='Quantity :'} <input type="text" name="ajax_qty_to_add_to_cart[{$product.id_product|intval}]" id="quantity_wanted_{$product.id_product|intval}" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" /> {l s='Add to cart'} {else} {l s='Quantity :'} <input type="text" name="ajax_qty_to_add_to_cart[{$product.id_product|intval}]" id="quantity_wanted_{$product.id_product|intval}" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" /> {l s='Add to cart' mod='homefeatured'} {l s='Out of Stock' mod='homefeatured'} {/if} {l s='View' mod='homefeatured'} {/foreach} {else} {l s='No featured products' mod='homefeatured'} {/if} <!-- /MODULE Home Featured Products --> And now products are like in attached picture.Maybe you understand more than me and will find what you need to change Link to comment Share on other sites More sharing options...
olivyte Posted March 11, 2011 Author Share Posted March 11, 2011 Do not forget to make changes in ajax-cart.js.It is written in firs post Good luck Hope this helps Link to comment Share on other sites More sharing options...
pakitus Posted March 11, 2011 Share Posted March 11, 2011 Everything is done as you sais and the problem is still remaining.I'm sorry you can't explain me the code.Many thanks anyway, i will go on trying.Thanks, Link to comment Share on other sites More sharing options...
olivyte Posted March 11, 2011 Author Share Posted March 11, 2011 I'm going out for a few days, but you could send me your homefeatured.tpl and I could try it on my site Link to comment Share on other sites More sharing options...
pakitus Posted March 11, 2011 Share Posted March 11, 2011 I'm using yours. Link to comment Share on other sites More sharing options...
evilmc Posted May 25, 2011 Share Posted May 25, 2011 I did as written and will not work, if anyone can help me? I use PS 1,3,6 and theme ''rumahbatik'' and this is my homefeatured.tpl <!-- MODULE Home Featured Products --> {if isset($products) AND $products} {assign var='liHeight' value=470} {assign var='nbItemsPerLine' value=4} {assign var='nbLi' value=$products|@count} {assign var='nbLines' value=$nbLi/$nbItemsPerLine|ceil} {assign var='ulHeight' value=$nbLines*$liHeight} {foreach from=$products item=product name=homeFeaturedProducts} {$product.name|truncate:20:'...'|escape:'htmlall':'UTF-8'} getImageLink($product.link_rewrite, $product.id_image, 'home')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" /> {$product.description_short|strip_tags|truncate:130:'...'} {l s='View' mod='homefeatured'} {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2} {l s='Add to cart' mod='homefeatured'} {else} {l s='Add to cart' mod='homefeatured'} {/if} {/foreach} {else} {l s='No featured products' mod='homefeatured'} {/if} <!-- /MODULE Home Featured Products --> Link to comment Share on other sites More sharing options...
Recommended Posts