[Skip to main content](#vessel-content)

#   Wishlist not adding products

##

- **[karendunne](/forum/user/51903-karendunne "View karendunne's Profile")**
- [![karendunne's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/51903-karendunne "View karendunne's Profile") Topic Author
- [ Offline](/forum/user/51903-karendunne)

Less More

- Posts: 112
- Thank you received: 7
-
-

8 years 11 months ago [\#282508](#282508) by [karendunne](/forum/user/51903-karendunne "View karendunne's Profile")  *[Wishlist not adding products](/forum/41-wishlist/892766-wishlist-not-adding-products#282508 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.1 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Any  I'm workin in catalog mode for a site and the wishlist does not seem to work as expected.  As a logged in user, when I try to add a product to the wishlist it says that product is not available.  I have customized a bit the add to wishlist button to use this code in product view:  Which looks ok to me as far as I can see in your Demo.  I have checked that the products have stock and even setting stock to &quot;Unlimited&quot;, they cannot be added.  Can you please let me know where I should look next? I cannot find why the products are not being added to the wishlist.  Thanks!!  Carlos")* was created by *[karendunne](/forum/user/51903-karendunne "View karendunne's Profile")*

-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.8.1
-- PHP version -- : 7.0.25
-- Browser(s) name and version -- : Any

I'm workin in catalog mode for a site and the wishlist does not seem to work as expected.

As a logged in user, when I try to add a product to the wishlist it says that product is not available.

I have customized a bit the add to wishlist button to use this code in product view:
Code:

&lt;a class="swan-heart-icon" href="&lt;?php echo hikashop_completeLink($classical_url); ?&gt;" rel="nofollow" onclick="if(window.hikashop.addToWishlist) { return window.hikashop.addToWishlist(this); }" data-addToWishlist="&lt;?php echo $this-&gt;element-&gt;product_id ?&gt;" data-addTo-div="hikashop_product_form" data-addTo-class="add_in_progress"&gt;

Which looks ok to me as far as I can see in your Demo.

I have checked that the products have stock and even setting stock to "Unlimited", they cannot be added.

Can you please let me know where I should look next? I cannot find why the products are not being added to the wishlist.

Thanks!!

Carlos

- [ ![Capturadepantalla2017-11-15alas13.12.44.png](/forum/attachment/41352) ](/forum/attachment/41352 "...as13.12.44.png") [ ](/forum/attachment/41352?download=1 "...as13.12.44.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3dpc2hsaXN0Lzg5Mjc2Ni13aXNobGlzdC1ub3QtYWRkaW5nLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

8 years 11 months ago [\#282516](#282516) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Wishlist not adding products](/forum/41-wishlist/892766-wishlist-not-adding-products#282516 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.1 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Any  I'm workin in catalog mode for a site and the wishlist does not seem to work as expected.  As a logged in user, when I try to add a product to the wishlist it says that product is not available.  I have customized a bit the add to wishlist button to use this code in product view:  Which looks ok to me as far as I can see in your Demo.  I have checked that the products have stock and even setting stock to &quot;Unlimited&quot;, they cannot be added.  Can you please let me know where I should look next? I cannot find why the products are not being added to the wishlist.  Thanks!!  Carlos")*

Hi,

It would be great if you could provide a test user account in such cases so that we can directly analyze the situation.

Right now, I can only provide some vague guidance. If you activate the display of the add to wishlist button (so that HikaShop displays its own button) do you see the button and does it work ?

Also, you're using the variable $this-&gt;element, but on a products listing, the data of the product is available in $this-&gt;row and not $this-&gt;element. Maybe that would explain why you get that error as the id you give is not the correct one ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3dpc2hsaXN0Lzg5Mjc2Ni13aXNobGlzdC1ub3QtYWRkaW5nLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[karendunne](/forum/user/51903-karendunne "View karendunne's Profile")**
- [![karendunne's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/51903-karendunne "View karendunne's Profile") Topic Author
- [ Offline](/forum/user/51903-karendunne)

Less More

- Posts: 112
- Thank you received: 7
-
-

8 years 11 months ago -  8 years 11 months ago [\#282938](#282938) by [karendunne](/forum/user/51903-karendunne "View karendunne's Profile")  Replied by *[karendunne](/forum/user/51903-karendunne "View karendunne's Profile")* on topic *[Wishlist not adding products](/forum/41-wishlist/892766-wishlist-not-adding-products#282938 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.1 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Any  I'm workin in catalog mode for a site and the wishlist does not seem to work as expected.  As a logged in user, when I try to add a product to the wishlist it says that product is not available.  I have customized a bit the add to wishlist button to use this code in product view:  Which looks ok to me as far as I can see in your Demo.  I have checked that the products have stock and even setting stock to &quot;Unlimited&quot;, they cannot be added.  Can you please let me know where I should look next? I cannot find why the products are not being added to the wishlist.  Thanks!!  Carlos")*

Hi Nicolas,
thank you very much for your reply!

I'm afraid it didn't help that much:

> Right now, I can only provide some vague guidance. If you activate the display of the add to wishlist button (so that HikaShop displays its own button) do you see the button and does it work ?

No, it has exactly the same behaviour.

> Also, you're using the variable $this-&gt;element, but on a products listing,

No, I'm using the code shown for Product View, for Product DETAIL view ![;)](/media/kunena/emoticons/24.png ";)")

This message contains confidential information

Last edit: 8 years 11 months ago by [karendunne](/forum/user/51903-karendunne "View karendunne's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3dpc2hsaXN0Lzg5Mjc2Ni13aXNobGlzdC1ub3QtYWRkaW5nLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

8 years 11 months ago [\#282978](#282978) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Wishlist not adding products](/forum/41-wishlist/892766-wishlist-not-adding-products#282978 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.1 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Any  I'm workin in catalog mode for a site and the wishlist does not seem to work as expected.  As a logged in user, when I try to add a product to the wishlist it says that product is not available.  I have customized a bit the add to wishlist button to use this code in product view:  Which looks ok to me as far as I can see in your Demo.  I have checked that the products have stock and even setting stock to &quot;Unlimited&quot;, they cannot be added.  Can you please let me know where I should look next? I cannot find why the products are not being added to the wishlist.  Thanks!!  Carlos")*

Hi,

From hat I can see, the issue is that you've deactivated the "Display 'add to cart' button for free products" setting in the HikaShop configuration, and that you didn't configure any price in the prices listing of the product (which you've actually removed from the product edition screen).
If I turn on that option, then it works fine.

The following user(s) said Thank You: [karendunne](/forum/user/51903-karendunne "View karendunne's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3dpc2hsaXN0Lzg5Mjc2Ni13aXNobGlzdC1ub3QtYWRkaW5nLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[karendunne](/forum/user/51903-karendunne "View karendunne's Profile")**
- [![karendunne's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/51903-karendunne "View karendunne's Profile") Topic Author
- [ Offline](/forum/user/51903-karendunne)

Less More

- Posts: 112
- Thank you received: 7
-
-

8 years 11 months ago [\#283015](#283015) by [karendunne](/forum/user/51903-karendunne "View karendunne's Profile")  Replied by *[karendunne](/forum/user/51903-karendunne "View karendunne's Profile")* on topic *[Wishlist not adding products](/forum/41-wishlist/892766-wishlist-not-adding-products#283015 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.1 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Any  I'm workin in catalog mode for a site and the wishlist does not seem to work as expected.  As a logged in user, when I try to add a product to the wishlist it says that product is not available.  I have customized a bit the add to wishlist button to use this code in product view:  Which looks ok to me as far as I can see in your Demo.  I have checked that the products have stock and even setting stock to &quot;Unlimited&quot;, they cannot be added.  Can you please let me know where I should look next? I cannot find why the products are not being added to the wishlist.  Thanks!!  Carlos")*

Thank you very much!!

And just in case you can provide a quick answer. Do you estore in the item object any information to show that the product is already in a wishlist? I want to change the button accordingly ![;)](/media/kunena/emoticons/24.png ";)")

Thanks!!

Carlos Cámara

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3dpc2hsaXN0Lzg5Mjc2Ni13aXNobGlzdC1ub3QtYWRkaW5nLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

8 years 11 months ago [\#283016](#283016) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Wishlist not adding products](/forum/41-wishlist/892766-wishlist-not-adding-products#283016 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.1 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Any  I'm workin in catalog mode for a site and the wishlist does not seem to work as expected.  As a logged in user, when I try to add a product to the wishlist it says that product is not available.  I have customized a bit the add to wishlist button to use this code in product view:  Which looks ok to me as far as I can see in your Demo.  I have checked that the products have stock and even setting stock to &quot;Unlimited&quot;, they cannot be added.  Can you please let me know where I should look next? I cannot find why the products are not being added to the wishlist.  Thanks!!  Carlos")*

Hi,

No, there is no such data in the product object that you have access to in the views. You would have to load the wishlist, go through the products in it and see if one is a match with some custom coding.
It's only a few lines of code so it's not that hard.
Something like that: Code:

$cartClass = hikashop_get('class.cart'); $wishlist = $cartClass-&gt;getFullCart($cartClass-&gt;getCurrentCartId('wishlist')); foreach($wishlist-&gt;products as $product){ if($product-&gt;product_id == $this-&gt;row-&gt;product_id){ // my process } }

The following user(s) said Thank You: [karendunne](/forum/user/51903-karendunne "View karendunne's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3dpc2hsaXN0Lzg5Mjc2Ni13aXNobGlzdC1ub3QtYWRkaW5nLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[karendunne](/forum/user/51903-karendunne "View karendunne's Profile")**
- [![karendunne's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/51903-karendunne "View karendunne's Profile") Topic Author
- [ Offline](/forum/user/51903-karendunne)

Less More

- Posts: 112
- Thank you received: 7
-
-

8 years 11 months ago [\#283218](#283218) by [karendunne](/forum/user/51903-karendunne "View karendunne's Profile")  Replied by *[karendunne](/forum/user/51903-karendunne "View karendunne's Profile")* on topic *[Wishlist not adding products](/forum/41-wishlist/892766-wishlist-not-adding-products#283218 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.8.1 -- PHP version -- : 7.0.25 -- Browser(s) name and version -- : Any  I'm workin in catalog mode for a site and the wishlist does not seem to work as expected.  As a logged in user, when I try to add a product to the wishlist it says that product is not available.  I have customized a bit the add to wishlist button to use this code in product view:  Which looks ok to me as far as I can see in your Demo.  I have checked that the products have stock and even setting stock to &quot;Unlimited&quot;, they cannot be added.  Can you please let me know where I should look next? I cannot find why the products are not being added to the wishlist.  Thanks!!  Carlos")*

Thank you very much!! It's an easy solution indeed ![;)](/media/kunena/emoticons/24.png ";)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3dpc2hsaXN0Lzg5Mjc2Ni13aXNobGlzdC1ub3QtYWRkaW5nLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.115 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
