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

#   Product not added to cart, cookies

##

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

Less More

- Posts: 7
- Thank you received: 0
-
-

5 years 8 months ago [\#330265](#330265) by [ebollman](/forum/user/58388-ebollman "View ebollman's Profile")  *[Product not added to cart, cookies](/forum/27-checkout/902071-product-not-added-to-cart-cookies#330265 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.20 -- PHP version -- : 7.2.34 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : Product not added to the cart This operation can only work if you accept the use of cookies  Hello, I am allowing one of my hikamarket vendors to embed their vendor category on their own website. If you view the link I provided you'll see that it's working pretty nice (white section on homepage below main showcase area of site). However when I click on a product and then click the add to cart button from this site where it's embedded, the product cannot be added to the cart and it shows the message. Product not added to the cart. This operation can only work if you accept the use of cookies. I have added an attachment showing a screenshot of this. Why is this message showing up? My browser has cookies enabled and the message is clearly a system type message from hikashop.")* was created by *[ebollman](/forum/user/58388-ebollman "View ebollman's Profile")*

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.20
-- PHP version -- : 7.2.34
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : Product not added to the cart
This operation can only work if you accept the use of cookies

Hello, I am allowing one of my hikamarket vendors to embed their vendor category on their own website. If you view the link I provided you'll see that it's working pretty nice (white section on homepage below main showcase area of site). However when I click on a product and then click the add to cart button from this site where it's embedded, the product cannot be added to the cart and it shows the message. Product not added to the cart. This operation can only work if you accept the use of cookies. I have added an attachment showing a screenshot of this. Why is this message showing up? My browser has cookies enabled and the message is clearly a system type message from hikashop.  [ ![ScreenShot2021-03-02at2.26.45PM.png](/forum/attachment/52145) ](/forum/attachment/52145 "...t2.26.45PM.png")

- [ ![ScreenShot2021-03-02at2.26.45PM.png](/forum/attachment/52145) ](/forum/attachment/52145 "...t2.26.45PM.png") [ ](/forum/attachment/52145?download=1 "...t2.26.45PM.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMjA3MS1wcm9kdWN0LW5vdC1hZGRlZC10by1jYXJ0LWNvb2tpZXM/dG1wbD1tYXJrZG93bg==) 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: 86357
- Thank you received: 14289
-
-

5 years 8 months ago [\#330267](#330267) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Product not added to cart, cookies](/forum/27-checkout/902071-product-not-added-to-cart-cookies#330267 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.20 -- PHP version -- : 7.2.34 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : Product not added to the cart This operation can only work if you accept the use of cookies  Hello, I am allowing one of my hikamarket vendors to embed their vendor category on their own website. If you view the link I provided you'll see that it's working pretty nice (white section on homepage below main showcase area of site). However when I click on a product and then click the add to cart button from this site where it's embedded, the product cannot be added to the cart and it shows the message. Product not added to the cart. This operation can only work if you accept the use of cookies. I have added an attachment showing a screenshot of this. Why is this message showing up? My browser has cookies enabled and the message is clearly a system type message from hikashop.")*

Hi,

That's because to be able to maintain a cart across different pages of the website, HikaShop needs to link the cart to the current PHP user session. That way, as long as the user session's lifetime is not finished, the cart is accessible.
And for PHP / Joomla to maintain the user session, it needs to set some cookies.
However, when you embed a website page in another website page using an iframe, cookies are blocked by browsers:
[ codethatcounts.com/setting-cookie-in-ifr...in-different-domain/](https://codethatcounts.com/setting-cookie-in-iframe-that-is-in-different-domain/)
And thus, the session cannot be maintained by PHP and because of that the cart will be lost from one page to the other.
This normally happens when cookies are disabled by the customer, which is why HikaShop displays that error message.
Now apparently, since PHP 7.3, there is a setting in php.ini to circumvent that:
[ stackoverflow.com/questions/59534999/how...r-cross-site-cookies](https://stackoverflow.com/questions/59534999/how-to-tell-php-to-use-samesite-none-for-cross-site-cookies)
Now I'm not sure if you need to do that in the php.ini of your website or the one of your vendor or both.

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

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