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

#   Hikabtn/cart won't work on products with options

##

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

Less More

- Posts: 1191
- Thank you received: 13
-
-

5 years 9 months ago [\#328023](#328023) by [verzevoul](/forum/user/8351-verzevoul "View verzevoul's Profile")  *[Hikabtn/cart won't work on products with options](/forum/26-product-category-display/901621-hikabtn-cart-wont-work-on-products-with-options#328023 "Hi.If you go to the link I provided and click on the product button (shown in the picture), it doesn't redirect me to the product page as it should. The button works with products that don't have...")* was created by *[verzevoul](/forum/user/8351-verzevoul "View verzevoul's Profile")*

Hi.If you go to the link I provided and click on the product button (shown in the picture), it doesn't redirect me to the product page as it should. The button works with products that don't have characteristics. The products, in that case, are directly added to the cart. Any idea what could be wrong?

We've temporarily fixed the issue with a script, but I've disabled it so you can see the issue we're facing as well.

Here's the script:
This message contains confidential information

This message contains confidential information

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDE2MjEtaGlrYWJ0bi1jYXJ0LXdvbnQtd29yay1vbi1wcm9kdWN0cy13aXRoLW9wdGlvbnM/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: 86316
- Thank you received: 14276
-
-

5 years 9 months ago [\#328029](#328029) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hikabtn/cart won't work on products with options](/forum/26-product-category-display/901621-hikabtn-cart-wont-work-on-products-with-options#328029 "Hi.If you go to the link I provided and click on the product button (shown in the picture), it doesn't redirect me to the product page as it should. The button works with products that don't have...")*

Hi,

When I click on that button and look at the developer's network tool, I can see this:
[ monosnap.com/file/De65tt9pJDdFX6zcUw9lgQOV6pCpyJ](https://monosnap.com/file/De65tt9pJDdFX6zcUw9lgQOV6pCpyJ)
So first there is a request to the product page initiated by the click on the button.
However, while the product page is being loaded by the browser, there is a second request to the listing page which cancels the first request to the product page. This second request originates from a setTimeout function call binded on a event on the button.
And the setTimeout is not in an external javascript file but directly inline.
So I looked at the HTML on that page and I can see this code:
[ monosnap.com/file/PyTjBxi2v7zdTIP0Tjd2K0WIGxgxtk](https://monosnap.com/file/PyTjBxi2v7zdTIP0Tjd2K0WIGxgxtk)
This code does exactly what you don't want the button to do. It refreshes the current page when a button with the class hikacart is clicked on (and the button you're talking about has that class).
So I don't know why that javascript was added on the page (it's not in HikaShop by default), but that code needs to be adapted.

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

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

Less More

- Posts: 1191
- Thank you received: 13
-
-

5 years 9 months ago [\#328099](#328099) by [verzevoul](/forum/user/8351-verzevoul "View verzevoul's Profile")  Replied by *[verzevoul](/forum/user/8351-verzevoul "View verzevoul's Profile")* on topic *[Hikabtn/cart won't work on products with options](/forum/26-product-category-display/901621-hikabtn-cart-wont-work-on-products-with-options#328099 "Hi.If you go to the link I provided and click on the product button (shown in the picture), it doesn't redirect me to the product page as it should. The button works with products that don't have...")*

The script you're seeing there was written by our programmer because we were facing another issue. I've disabled it now so it fixed the button, but when adding a product to cart, the number of products in the cart (if you look at the little icon number above) doesn't change to display the number of products. Do you think we can find a solution to that?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDE2MjEtaGlrYWJ0bi1jYXJ0LXdvbnQtd29yay1vbi1wcm9kdWN0cy13aXRoLW9wdGlvbnM/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: 86316
- Thank you received: 14276
-
-

5 years 9 months ago [\#328103](#328103) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hikabtn/cart won't work on products with options](/forum/26-product-category-display/901621-hikabtn-cart-wont-work-on-products-with-options#328103 "Hi.If you go to the link I provided and click on the product button (shown in the picture), it doesn't redirect me to the product page as it should. The button works with products that don't have...")*

Hi,

Sure. The issue comes from the customization of the cart module that you have.
If you rename the file templates/YOUR_TEMPLATE/html/com_hikashop/product/cart.php it will deactivate your view override of the cart module, and you'll see the cart module being refreshed.
In your view override, you're missing HTML and javascript code to plug the module to the add to cart system.
Either you've based yourself on an old version of the view file which didn't support the AJAX add to cart system, or the way the customization was done removed the necessary HTML / js in there.

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

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

[](#top)
