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

#   Pop up information when user click on add to cart button

##

- **[twscott](/forum/user/43011-twscott "View twscott's Profile")**
- [![twscott's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/beer.png)](/forum/user/43011-twscott "View twscott's Profile") Topic Author
- [ Offline](/forum/user/43011-twscott)

Less More

- Posts: 252
- Thank you received: 1
-
-
-
-

3 years 3 months ago [\#354011](#354011) by [twscott](/forum/user/43011-twscott "View twscott's Profile")  *[Pop up information when user click on add to cart button](/forum/26-product-category-display/906815-pop-up-information-when-user-click-on-add-to-cart-button#354011 "-- url of the page with the problem -- :   bloominggreens.com.tw/zh/  -- HikaShop version -- : 4.7.5 -- Joomla version -- : 3.10 -- PHP version -- : 7.8 -- Browser(s) name and version -- : chrome  Hi, We want to show a pop up message when user click on add to cart button in product page for some products. But we can't find the add to card button in my show&#95;default or add to cart view to add the javascript code, would you tell me how do I do this.  Thanks in advance")* was created by *[twscott](/forum/user/43011-twscott "View twscott's Profile")*

-- url of the page with the problem -- : [ bloominggreens.com.tw/zh/](http://bloominggreens.com.tw/zh/)
-- HikaShop version -- : 4.7.5
-- Joomla version -- : 3.10
-- PHP version -- : 7.8
-- Browser(s) name and version -- : chrome

Hi,
We want to show a pop up message when user click on add to cart button in product page for some products.
But we can't find the add to card button in my show_default or add to cart view to add the javascript code, would you tell me how do I do this.

Thanks in advance

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

3 years 3 months ago [\#354017](#354017) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pop up information when user click on add to cart button](/forum/26-product-category-display/906815-pop-up-information-when-user-click-on-add-to-cart-button#354017 "-- url of the page with the problem -- :   bloominggreens.com.tw/zh/  -- HikaShop version -- : 4.7.5 -- Joomla version -- : 3.10 -- PHP version -- : 7.8 -- Browser(s) name and version -- : chrome  Hi, We want to show a pop up message when user click on add to cart button in product page for some products. But we can't find the add to card button in my show&#95;default or add to cart view to add the javascript code, would you tell me how do I do this.  Thanks in advance")*

Hi,

There is already a pop up message displayed by default when the user clicks on an add to cart button in HikaShop.
So I'm not sure what you're trying to do.
I tried to look at the situation on your website, but I couldn't see any add to cart buttons.
Could you provide more information on the situation and a way to check what happens when the add to cart button is clicked on on your website ?

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

- **[twscott](/forum/user/43011-twscott "View twscott's Profile")**
- [![twscott's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/beer.png)](/forum/user/43011-twscott "View twscott's Profile") Topic Author
- [ Offline](/forum/user/43011-twscott)

Less More

- Posts: 252
- Thank you received: 1
-
-
-
-

3 years 3 months ago [\#354020](#354020) by [twscott](/forum/user/43011-twscott "View twscott's Profile")  Replied by *[twscott](/forum/user/43011-twscott "View twscott's Profile")* on topic *[Pop up information when user click on add to cart button](/forum/26-product-category-display/906815-pop-up-information-when-user-click-on-add-to-cart-button#354020 "-- url of the page with the problem -- :   bloominggreens.com.tw/zh/  -- HikaShop version -- : 4.7.5 -- Joomla version -- : 3.10 -- PHP version -- : 7.8 -- Browser(s) name and version -- : chrome  Hi, We want to show a pop up message when user click on add to cart button in product page for some products. But we can't find the add to card button in my show&#95;default or add to cart view to add the javascript code, would you tell me how do I do this.  Thanks in advance")*

Thank you for the quick reply.

We have a special product that is a combination of other products. The user needs to choose 12 items from the same category. We have developed a module for this, but we need to check if the user has selected the correct number of products when they press the "Add to Cart" button. If the user hasn't selected the right number of products, we will display a message to them, otherwise, the process will proceed as usual with other products.

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

3 years 3 months ago [\#354024](#354024) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pop up information when user click on add to cart button](/forum/26-product-category-display/906815-pop-up-information-when-user-click-on-add-to-cart-button#354024 "-- url of the page with the problem -- :   bloominggreens.com.tw/zh/  -- HikaShop version -- : 4.7.5 -- Joomla version -- : 3.10 -- PHP version -- : 7.8 -- Browser(s) name and version -- : chrome  Hi, We want to show a pop up message when user click on add to cart button in product page for some products. But we can't find the add to card button in my show&#95;default or add to cart view to add the javascript code, would you tell me how do I do this.  Thanks in advance")*

Hi,

Can you provide the URL of the page with that add to cart button ? It will be necessary to check the situation to be able to tell you what JS code would be necessary.

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

- **[twscott](/forum/user/43011-twscott "View twscott's Profile")**
- [![twscott's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/beer.png)](/forum/user/43011-twscott "View twscott's Profile") Topic Author
- [ Offline](/forum/user/43011-twscott)

Less More

- Posts: 252
- Thank you received: 1
-
-
-
-

3 years 3 months ago [\#354210](#354210) by [twscott](/forum/user/43011-twscott "View twscott's Profile")  Replied by *[twscott](/forum/user/43011-twscott "View twscott's Profile")* on topic *[Pop up information when user click on add to cart button](/forum/26-product-category-display/906815-pop-up-information-when-user-click-on-add-to-cart-button#354210 "-- url of the page with the problem -- :   bloominggreens.com.tw/zh/  -- HikaShop version -- : 4.7.5 -- Joomla version -- : 3.10 -- PHP version -- : 7.8 -- Browser(s) name and version -- : chrome  Hi, We want to show a pop up message when user click on add to cart button in product page for some products. But we can't find the add to card button in my show&#95;default or add to cart view to add the javascript code, would you tell me how do I do this.  Thanks in advance")*

Hi,
This is the url :
[ testlorena.diggo.com.tw/zh/hots/12/produ...ramel-cocoa-cup.html](http://testlorena.diggo.com.tw/zh/hots/12/product/58-caramel-cocoa-cup.html)

when user click the 'Add to cart', we need to verify if the correct number of products was selected.
Thanks for helping.

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

3 years 3 months ago [\#354212](#354212) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pop up information when user click on add to cart button](/forum/26-product-category-display/906815-pop-up-information-when-user-click-on-add-to-cart-button#354212 "-- url of the page with the problem -- :   bloominggreens.com.tw/zh/  -- HikaShop version -- : 4.7.5 -- Joomla version -- : 3.10 -- PHP version -- : 7.8 -- Browser(s) name and version -- : chrome  Hi, We want to show a pop up message when user click on add to cart button in product page for some products. But we can't find the add to card button in my show&#95;default or add to cart view to add the javascript code, would you tell me how do I do this.  Thanks in advance")*

Hi,

I think the best is to create a view override for product / quantity via the menu Display&gt;Views and change the line: Code:

$attributes = ' class="' . $css_button . ' ' . $css_button_cart. '" onclick="if(window.hikashop.addToCart) { return window.hikashop.addToCart(this); }" data-addToCart="'.$this-&gt;row-&gt;product_id.'" data-addTo-div="hikashop_product_form" data-addTo-class="add_in_progress"';

In the onclick attribute, you can add a call to your javascript function in order to check that the correct number of products is selected and only call window.hikashop.addToCart if that's the case.

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

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

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