Jump to content

Add to Cart


Recommended Posts

Hi guys, to see if anyone can help me ...

In a single page of a product, defaults can be chosen
amount to add to the basket, but on the main page (index.php) no,
only see a button "Add to Cart"
Is there any way that also in the index, each have its product displayed
box to enter a number of products to add to the basket? (this
without clicking on the product and go to the product page and then put
amount)

Thanks in advance!
A greeting


sorry for my english, im from spain!

Link to comment
Share on other sites

my homefeatured.tpl

    {if $allow_buy_when_out_of_stock OR ($product.quantity AND $product.quantity > 0) OR $product.allow_oosp}
{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}

.


my ajax-cart.js

            var idProduct =  $(this).attr('rel').replace('ajax_id_product_', '');
           ajaxCart.add(idProduct, null, false, this, $(’#quantity_wanted_’+idProduct).val());
           return false;




but no rulz :S
can you help me?

Thanks!

Link to comment
Share on other sites

In the following code :

$(’#quantity_wanted_’+idProduct).val()



you should use character ' (quote) instead of ` (backquote)
Maybe this is the forum which as replaced them.

With this modification, it works fine for me
Don't forget to reload the index page to force the javascript to be reloaded

Link to comment
Share on other sites

In the following code :
$(’#quantity_wanted_’+idProduct).val()



you should use character ' (quote) instead of ` (backquote)
Maybe this is the forum which as replaced them.

With this modification, it works fine for me
Don't forget to reload the index page to force the javascript to be reloaded




Thanks you very much!!
You are god! ;)
Link to comment
Share on other sites

×
×
  • Create New...