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

#   Custom js on specific product

##

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

Less More

- Posts: 134
- Thank you received: 6
-
-
-
- [](https://madein-bg.com)
-

11 years 1 day ago -  11 years 1 day ago [\#220365](#220365) by [filiar](/forum/user/33070-filiar "View filiar's Profile")  *[Custom js on specific product](/forum/35-orders-management/880419-custom-js-on-specific-product#220365 "-- HikaShop version -- : 2.6.0  Hi,  how could I develop customised Modal message which contains links to some actions on specific product.  I have a Child Party Club site. The main purpose of HikaShop there is that the clients have the ability to request a party for their children. So the main product is Child Party. It has some options and characteristics (number of childs invited, predefined child food menus... etc.), but I would like to give the client the ability to add some more products (food for the parents for example).  So I would like to make custom modal, only for the product Child Party. That modal should give the oportunity (if he would like) to the client to order food and drinks for the parents. So it should contain two buttons: 1. Choose food and drinks 2. Continue with checkout.  For the other products the default popup should be present.  In other words, how could I add custom JS to specific product.")* was created by *[filiar](/forum/user/33070-filiar "View filiar's Profile")*

-- HikaShop version -- : 2.6.0

Hi,

how could I develop customised Modal message which contains links to some actions on specific product.

I have a Child Party Club site. The main purpose of HikaShop there is that the clients have the ability to request a party for their children. So the main product is Child Party. It has some options and characteristics (number of childs invited, predefined child food menus... etc.), but I would like to give the client the ability to add some more products (food for the parents for example).

So I would like to make custom modal, only for the product Child Party. That modal should give the oportunity (if he would like) to the client to order food and drinks for the parents. So it should contain two buttons:
1. Choose food and drinks
2. Continue with checkout.

For the other products the default popup should be present.

In other words, how could I add custom JS to specific product.

Last edit: 11 years 1 day ago by [filiar](/forum/user/33070-filiar "View filiar's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg4MDQxOS1jdXN0b20tanMtb24tc3BlY2lmaWMtcHJvZHVjdD90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 1 day ago [\#220407](#220407) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom js on specific product](/forum/35-orders-management/880419-custom-js-on-specific-product#220407 "-- HikaShop version -- : 2.6.0  Hi,  how could I develop customised Modal message which contains links to some actions on specific product.  I have a Child Party Club site. The main purpose of HikaShop there is that the clients have the ability to request a party for their children. So the main product is Child Party. It has some options and characteristics (number of childs invited, predefined child food menus... etc.), but I would like to give the client the ability to add some more products (food for the parents for example).  So I would like to make custom modal, only for the product Child Party. That modal should give the oportunity (if he would like) to the client to order food and drinks for the parents. So it should contain two buttons: 1. Choose food and drinks 2. Continue with checkout.  For the other products the default popup should be present.  In other words, how could I add custom JS to specific product.")*

Hi,

If you want to add custom javascript on the product page, you can edit the file "show_default" via the menu Display&gt;Views and add it there.

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

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

Less More

- Posts: 134
- Thank you received: 6
-
-
-
- [](https://madein-bg.com)
-

11 years 1 day ago -  11 years 1 day ago [\#220451](#220451) by [filiar](/forum/user/33070-filiar "View filiar's Profile")  Replied by *[filiar](/forum/user/33070-filiar "View filiar's Profile")* on topic *[Custom js on specific product](/forum/35-orders-management/880419-custom-js-on-specific-product#220451 "-- HikaShop version -- : 2.6.0  Hi,  how could I develop customised Modal message which contains links to some actions on specific product.  I have a Child Party Club site. The main purpose of HikaShop there is that the clients have the ability to request a party for their children. So the main product is Child Party. It has some options and characteristics (number of childs invited, predefined child food menus... etc.), but I would like to give the client the ability to add some more products (food for the parents for example).  So I would like to make custom modal, only for the product Child Party. That modal should give the oportunity (if he would like) to the client to order food and drinks for the parents. So it should contain two buttons: 1. Choose food and drinks 2. Continue with checkout.  For the other products the default popup should be present.  In other words, how could I add custom JS to specific product.")*

My question as stated in the topic title is about customisation of a specific (exact one single product) not the whole product page.

And it is about what happens when clicking on add to card button.
I have to redirect the client (somewhere) after adding to card ONE EXACT product. For all the others the defaults are ok.

And as I found, the page is reloaded after adding to card and notice is shown that gives one the choise to continue or to finalize.

How can I skip that notice (for the exact one product) and redirect somewhere instead?

Last edit: 11 years 1 day ago by [filiar](/forum/user/33070-filiar "View filiar's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL29yZGVycy1tYW5hZ2VtZW50Lzg4MDQxOS1jdXN0b20tanMtb24tc3BlY2lmaWMtcHJvZHVjdD90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 12 hours ago [\#220464](#220464) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom js on specific product](/forum/35-orders-management/880419-custom-js-on-specific-product#220464 "-- HikaShop version -- : 2.6.0  Hi,  how could I develop customised Modal message which contains links to some actions on specific product.  I have a Child Party Club site. The main purpose of HikaShop there is that the clients have the ability to request a party for their children. So the main product is Child Party. It has some options and characteristics (number of childs invited, predefined child food menus... etc.), but I would like to give the client the ability to add some more products (food for the parents for example).  So I would like to make custom modal, only for the product Child Party. That modal should give the oportunity (if he would like) to the client to order food and drinks for the parents. So it should contain two buttons: 1. Choose food and drinks 2. Continue with checkout.  For the other products the default popup should be present.  In other words, how could I add custom JS to specific product.")*

Hi,

It's that code which displays the popup when the product page refreshes after the add to cart: Code:

if($app-&gt;getUserState( HIKASHOP_COMPONENT.'.popup', '0')) { $js = $this-&gt;getJS(); $app-&gt;setUserState( HIKASHOP_COMPONENT.'.popup', '0'); }

in the file components/com_hikashop/views/product/view.html.php
So you would have to change the content of that if and instead do a redirection ( the header function of PHP on the location ).
Doing it for only one product is dead simple. Just check on the cid in the $_REQUEST array which contains the product_id of the current product.

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

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

Less More

- Posts: 134
- Thank you received: 6
-
-
-
- [](https://madein-bg.com)
-

11 years 11 hours ago [\#220528](#220528) by [filiar](/forum/user/33070-filiar "View filiar's Profile")  Replied by *[filiar](/forum/user/33070-filiar "View filiar's Profile")* on topic *[Custom js on specific product](/forum/35-orders-management/880419-custom-js-on-specific-product#220528 "-- HikaShop version -- : 2.6.0  Hi,  how could I develop customised Modal message which contains links to some actions on specific product.  I have a Child Party Club site. The main purpose of HikaShop there is that the clients have the ability to request a party for their children. So the main product is Child Party. It has some options and characteristics (number of childs invited, predefined child food menus... etc.), but I would like to give the client the ability to add some more products (food for the parents for example).  So I would like to make custom modal, only for the product Child Party. That modal should give the oportunity (if he would like) to the client to order food and drinks for the parents. So it should contain two buttons: 1. Choose food and drinks 2. Continue with checkout.  For the other products the default popup should be present.  In other words, how could I add custom JS to specific product.")*

Thank you, Nicolas. I think that was the answer I was looking for!

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

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