Jump to content

How to add "add to my wishlist" button to product list page?


Recommended Posts

  • 1 year later...

Hi there!

 

Yes, an entire year later some noob has to come give a solution to your wishlist question. I know you have moved on by now but This is for every developer out there frustrated by prestashop support:

 

add this to your product listing page:

<a onclick="WishlistCart('wishlist_block_list', 'add', '{$product.id_product|intval}', $('#idCombination').val(), 1); return false;" class="button" id="wishlist_button" href="#">Add to my wishlist</a>

 

Viola.. you done..

 

This will add a single wishlist item..

 

if you want to get all fancy you can intergrate the quantity input by following this tutorial:

 

http://www.diginmoti...s-listing.html#

 

Check the comments.. I added it there!

 

Please mark this as solved.

Edited by fhufkie (see edit history)
  • Like 3
Link to comment
Share on other sites

  • 6 months later...

Been many months later... Very helpful.

 

But, I was wondering: when I add the code to the product's Short Description block, it works perfectly. But, when I add to the Product's Long Description, the button loses its color so with white text doesn't work (more correctly cannot be seen).

 

Any idea why it works in one not the other? Any code I can add to the button that will override the button's color, size, or text font/color?

 

Hi there!

 

Yes, an entire year later some noob has to come give a solution to your wishlist question. I know you have moved on by now but This is for every developer out there frustrated by prestashop support:

 

add this to your product listing page:

<a onclick="WishlistCart('wishlist_block_list', 'add', '{$product.id_product|intval}', $('#idCombination').val(), 1); return false;" class="button" id="wishlist_button" href="#">Add to my wishlist</a>

 

Viola.. you done..

 

This will add a single wishlist item..

 

if you want to get all fancy you can intergrate the quantity input by following this tutorial:

 

http://www.diginmoti...s-listing.html#

 

Check the comments.. I added it there!

 

Please mark this as solved.

Edited by drdelurk (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 month later...

My apologies. I didn't noticed you responded.

 

If you go to this product page: http://www.vinotrope.com/en/syrahshiraz/9-2007-tallulah-syrah.html

 

You will see on the Product Overview tab what I am trying to say. Thanks!

 

 

Hi drdelurk,

 

Off the bat it seems like it can be a CSS issue.

 

If you send me a link I can give you some more information on this.

Link to comment
Share on other sites

Hi drdelurk.

 

This is definitely a css issue.. check attachment

 

I firebugged your page and found that the background image is either referenced wrong or does not exist at all. My first step would be to check the location you referencing to see if it actually exist.

 

Also take note that image referencing can also be casesensitive.

 

let me know if you come right.

post-385585-0-89115100-1373614502_thumb.jpg

Link to comment
Share on other sites

Thanks for your help. This is officially above my pay grade and abilities! ;o(

I am just going to delete the button - give it another go later.

 

Thank again!

 

 

Hi drdelurk. This is definitely a css issue.. check attachment I firebugged your page and found that the background image is either referenced wrong or does not exist at all. My first step would be to check the location you referencing to see if it actually exist. Also take note that image referencing can also be casesensitive. let me know if you come right.
Link to comment
Share on other sites

  • 5 months later...

Thank you for your post.

 

I only want to be able to add to the wishlist if the product is available online.

 

I have included the code in product_list and it works when I check if available online. But when I put the check in the blockwishlist-extra.tpl as below it doesn't check and if I put the code in the product.tpl it checks for been available onle but does not add to the wishlist?

{if $product->online_only}{else}
<a onclick="WishlistCart('wishlist_block_list', 'add', '{$id_product|intval}', $('#idCombination').val(), 1); return false;" class="button" id="wishlist_button" href="#">Rent</a><br><br>
{/if}

 

Can you help?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...