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

#   Wishlist Not Clearing When items moved to cart

##

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

Less More

- Posts: 38
- Thank you received: 2
-
-

10 years 7 months ago [\#235056](#235056) by [donaldmoore](/forum/user/3308-donaldmoore "View donaldmoore's Profile")  *[Wishlist Not Clearing When items moved to cart](/forum/41-wishlist/883534-wishlist-not-clearing-when-items-moved-to-cart#235056 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.45  I am not sure if this is standard behavior of not. When a user add items to his Wishlist then places a check next to each item and clicks &quot;Add To Cart&quot;, the items do not clear out from his wishlist. They do transfer over to the cart but a copy of them remains in the wishlist. Is this standard? If so, can anything be changed to remove the items once added to the cart?")* was created by *[donaldmoore](/forum/user/3308-donaldmoore "View donaldmoore's Profile")*

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.4.45

I am not sure if this is standard behavior of not. When a user add items to his Wishlist then places a check next to each item and clicks "Add To Cart", the items do not clear out from his wishlist. They do transfer over to the cart but a copy of them remains in the wishlist. Is this standard? If so, can anything be changed to remove the items once added to the cart?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQxLXdpc2hsaXN0Lzg4MzUzNC13aXNobGlzdC1ub3QtY2xlYXJpbmctd2hlbi1pdGVtcy1tb3ZlZC10by1jYXJ0P3RtcGw9bWFya2Rvd24=) 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: 86587
- Thank you received: 14325
-
-

10 years 7 months ago [\#235117](#235117) 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 Clearing When items moved to cart](/forum/41-wishlist/883534-wishlist-not-clearing-when-items-moved-to-cart#235117 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.45  I am not sure if this is standard behavior of not. When a user add items to his Wishlist then places a check next to each item and clicks &quot;Add To Cart&quot;, the items do not clear out from his wishlist. They do transfer over to the cart but a copy of them remains in the wishlist. Is this standard? If so, can anything be changed to remove the items once added to the cart?")*

Hi,

Yes, that's the normal behavior. There is no option to change that.
But it's always possible to modify the code to do what you want if you're a developer.
You would have to edit the function addtocart of the file components/com_hikashop/controllers/cart.php
The code would have to set/reset the cart_type and cart_id in both the session and the request and call the update function from the class.cart with a quantity of 0 on the product_id in order to do that.

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

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

Less More

- Posts: 38
- Thank you received: 2
-
-

10 years 7 months ago [\#235118](#235118) by [donaldmoore](/forum/user/3308-donaldmoore "View donaldmoore's Profile")  Replied by *[donaldmoore](/forum/user/3308-donaldmoore "View donaldmoore's Profile")* on topic *[Wishlist Not Clearing When items moved to cart](/forum/41-wishlist/883534-wishlist-not-clearing-when-items-moved-to-cart#235118 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.45  I am not sure if this is standard behavior of not. When a user add items to his Wishlist then places a check next to each item and clicks &quot;Add To Cart&quot;, the items do not clear out from his wishlist. They do transfer over to the cart but a copy of them remains in the wishlist. Is this standard? If so, can anything be changed to remove the items once added to the cart?")*

Thank you so much for that detailed help, I can't begin to thank you enough for that. I will look into the modification, I actually peered around it a bit after asking the question to see what was possible. In the long run, however, I think since the modification would be to a controller I will leave it in its normal state to preserve it ability to receive regular updates. We will probably just add a text string at the top of the page to alert the user of the expected behavior.
Have a nice day!

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

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

Less More

- Posts: 2
- Thank you received: 1
-
-

7 years 4 months ago [\#308430](#308430) by [kurchania](/forum/user/55842-kurchania "View kurchania's Profile")  Replied by *[kurchania](/forum/user/55842-kurchania "View kurchania's Profile")* on topic *[Wishlist Not Clearing When items moved to cart](/forum/41-wishlist/883534-wishlist-not-clearing-when-items-moved-to-cart#308430 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.45  I am not sure if this is standard behavior of not. When a user add items to his Wishlist then places a check next to each item and clicks &quot;Add To Cart&quot;, the items do not clear out from his wishlist. They do transfer over to the cart but a copy of them remains in the wishlist. Is this standard? If so, can anything be changed to remove the items once added to the cart?")*

Hi Nicolas,
If we add custom field in product then cart is not clearing.i have added following On line 420 in
/components/com_hikashop/controllers/cart.php
$cartClass-&gt;update($product_in_cart-&gt;cart_product_id, 0,0,'item',true,false,$cart_id);
then cart is cleared in wishlist .

The following user(s) said Thank You: [mSnus](/forum/user/58186-msnus "View mSnus's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQxLXdpc2hsaXN0Lzg4MzUzNC13aXNobGlzdC1ub3QtY2xlYXJpbmctd2hlbi1pdGVtcy1tb3ZlZC10by1jYXJ0P3RtcGw9bWFya2Rvd24=) 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: 86587
- Thank you received: 14325
-
-

7 years 4 months ago [\#308434](#308434) 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 Clearing When items moved to cart](/forum/41-wishlist/883534-wishlist-not-clearing-when-items-moved-to-cart#308434 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.45  I am not sure if this is standard behavior of not. When a user add items to his Wishlist then places a check next to each item and clicks &quot;Add To Cart&quot;, the items do not clear out from his wishlist. They do transfer over to the cart but a copy of them remains in the wishlist. Is this standard? If so, can anything be changed to remove the items once added to the cart?")*

Hi,

Thank you for your feedback. However, I'm not able to reproduce your problem.
On a cart/wishlist, depending on the situation, you'll get two buttons: "add to" and "move to". The "add to" will copy the product to the target cart/wishlist while the "move to" will do the copy AND remove the product from where you had it.
The piece of code you're pointing out is in the if($add) which means that it's done when the "add to" button is used, not the "move to".
So it's normal that in that case the original is not removed.
Now you might have an issue if you're using the "move to" button and it's doing an "add to". In that case, it's probably a view override issue.
Anyways, to be able to better understand the situation, it would help if you could provide a link to the page with instructions to reproduce so that we can look into it. And check what problem you really have in order to properly fix it, if there is a problem.
We unfortunately can't accept your patch unless we properly understand the situation.

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

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

Less More

- Posts: 2
- Thank you received: 1
-
-

7 years 4 months ago [\#308453](#308453) by [kurchania](/forum/user/55842-kurchania "View kurchania's Profile")  Replied by *[kurchania](/forum/user/55842-kurchania "View kurchania's Profile")* on topic *[Wishlist Not Clearing When items moved to cart](/forum/41-wishlist/883534-wishlist-not-clearing-when-items-moved-to-cart#308453 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.45  I am not sure if this is standard behavior of not. When a user add items to his Wishlist then places a check next to each item and clicks &quot;Add To Cart&quot;, the items do not clear out from his wishlist. They do transfer over to the cart but a copy of them remains in the wishlist. Is this standard? If so, can anything be changed to remove the items once added to the cart?")*

Hi Nicholas,
Thank you for revert back to me.Let me try to explain .when i create custom field for item the original product is is not created and it will treat product as new product id.
if i created item with name orderid and pass it to through the system this new product id is saved in cart_product and later go to order_product table.
Now i go to hikashop cart and click on move_to and move the product to wishlist's.
if i go to wishlist and then select product and click on add to cart it will add the product in cart but never remove the product from wish list.that mean customer have to remove manually.
so i added this code.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQxLXdpc2hsaXN0Lzg4MzUzNC13aXNobGlzdC1ub3QtY2xlYXJpbmctd2hlbi1pdGVtcy1tb3ZlZC10by1jYXJ0P3RtcGw9bWFya2Rvd24=) 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: 86587
- Thank you received: 14325
-
-

7 years 4 months ago [\#308455](#308455) 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 Clearing When items moved to cart](/forum/41-wishlist/883534-wishlist-not-clearing-when-items-moved-to-cart#308455 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.45  I am not sure if this is standard behavior of not. When a user add items to his Wishlist then places a check next to each item and clicks &quot;Add To Cart&quot;, the items do not clear out from his wishlist. They do transfer over to the cart but a copy of them remains in the wishlist. Is this standard? If so, can anything be changed to remove the items once added to the cart?")*

Hi,

Thank you for the details.
It's actually normal that if you click on the add to cart button, it adds the product to the cart and doesn't remove the product from the wishlist.
If you want to do that, then you need to click on the "move to" button instead.
If you do your change, then both the "move to" and the "add to" button will do the same thing.
If the modification you made works for you, then great, but I'm afraid we won't be able to include it on our end if we're talking about the same thing.

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

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

Less More

- Posts: 10
- Thank you received: 1
-
-

6 years 3 weeks ago [\#325342](#325342) by [mSnus](/forum/user/58186-msnus "View mSnus's Profile")  Replied by *[mSnus](/forum/user/58186-msnus "View mSnus's Profile")* on topic *[Wishlist Not Clearing When items moved to cart](/forum/41-wishlist/883534-wishlist-not-clearing-when-items-moved-to-cart#325342 "-- HikaShop version -- : 2.6.1 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.45  I am not sure if this is standard behavior of not. When a user add items to his Wishlist then places a check next to each item and clicks &quot;Add To Cart&quot;, the items do not clear out from his wishlist. They do transfer over to the cart but a copy of them remains in the wishlist. Is this standard? If so, can anything be changed to remove the items once added to the cart?")*

I ended up with following solution:

in **components/com\_hikashop/controllers/cart.php**
you should find this cycle: Code:

if($add) { $formData = hikaInput::get()-&gt;get('data', array(), 'array'); foreach($products as $key =&gt; &amp;$product) {

at the end of the cycle just before the closing bracket insert the check and the removal:
Code:

if ($destCart-&gt;cart_type == "cart" &amp;&amp; $cart-&gt;cart_type == "wishlist") { $cartClass-&gt;update($product-&gt;cart_product_id, 0,0,'item',true,false,$cart-&gt;cart_id); }

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQxLXdpc2hsaXN0Lzg4MzUzNC13aXNobGlzdC1ub3QtY2xlYXJpbmctd2hlbi1pdGVtcy1tb3ZlZC10by1jYXJ0P3RtcGw9bWFya2Rvd24=) 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.072 seconds

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