Jump to content

Add to Wishlist button not working in product page


Recommended Posts

Hi Guyzz....

 

So this is my problem...i installed the wishlist module..

 

The module is working perfectly...i am able to add new wishlists and edit and all....

 

But when i click on the Add to Wishlist button in the product page there is no response whatsoever...except that a # is appended to the url...

 

I tried all the methods but still no luck....

 

Pls help me guyzz...

Link to comment
Share on other sites

Hi,

 

please look into your console log, i think you have some js-errors. Also check do you have onClick action on that link ( ex. WishlistCart('wishlist_block_list', 'add', '2', $('#idCombination').val(), document.getElementById('quantity_wanted').value); return false;)

 

Regards

 

Hi,

 

Yes the onclick action is there...but still it is not working...

Link to comment
Share on other sites

Hi again,

 

i looked into the console as you said and found that this is the error...

 

TypeError: document.getElementById("quantity_wanted") is null

 

So i think its because the quantity parameter is null that its not working...so how do i change this..

 

pls help..

Link to comment
Share on other sites

  • 1 year later...
  • 6 months later...

In catalog mode (PS 1.6.0.9) - removing these two lines in product.tpl (around line 316) did it for me:

{if !$PS_CATALOG_MODE} <====(delete this line)
<p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
<label>{l s='Quantity'}</label>
<input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" />
<a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down">
<span><i class="icon-minus"></i></span>
</a>
<a href="#" data-field-qty="qty" class="btn btn-default button-plus product_quantity_up">
<span><i class="icon-plus"></i></span>
</a>
<span class="clearfix"></span>
</p>
{/if} <====(delete this line)

Now the error is gone and add to wishlist from product page (and product quickview) works as expected.

(I am using a copy of the default-bootstrap theme) 

Edited by me-and-prestashop (see edit history)
Link to comment
Share on other sites

Thank you very much. I will try it out.

If you are NOT running PS in catalog_mode, I am not sure my solution above will help you. When add to wishlist from product page is working, I can see the comments "quantity wanted" and "minimal quantity wanted" in frontend. Some of these elements are there but hidden in catalog_mode. I should also mention that I am using a copy of the default-bootstrap theme. I've only edited some of the template files to make the prices reappear in catalog_mode. Things might look a little different in another theme with cart enabled etc...

Edited by me-and-prestashop (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...