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

#   Coping with HK ajax

##

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

Less More

- Posts: 19
- Thank you received: 0
-
-

12 years 6 months ago -  12 years 6 months ago [\#151110](#151110) by [Helveticus](/forum/user/20683-helveticus "View Helveticus's Profile")  *[Coping with HK ajax](/forum/26-product-category-display/867241-coping-with-hk-ajax#151110 "-- url of the page with the problem -- localhost -- HikaShop version -- :HK Essential: 2.3.0 -- Joomla version -- :2.5.19 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : FreFox 27.0.1 -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hi, I am struggling with two HK ajax issues related to product selection and checkout updating.  1. Product text description. Once a selection is made, the product text description is updated. Instead of appearing next to the product header, I would like the text to be displayed just above the &quot;Add to Cart&quot; button for improved clarity. I tried to use some jQuery to copy the text between the two highlighted spans, but the event handlers are probably destroyed by ajax once a selection is made. The html code is attached below. Could you tell me where to inject the js code to handle this issue?  2. CSS checkout button class lost after &quot;Add to cart&quot; button click event. By default, all buttons in the site include a custom CSS class. Once the &quot;Add to cart&quot; button is clicked, the checkout input button is regenerated causing this custom CSS class to be lost. Could you tell me how to add custom CSS classes back to HK elements after a HK ajax update?  TIA for any hints.")* was created by *[Helveticus](/forum/user/20683-helveticus "View Helveticus's Profile")*

-- url of the page with the problem -- localhost
-- HikaShop version -- :HK Essential: 2.3.0
-- Joomla version -- :2.5.19
-- PHP version -- : 5.3.13
-- Browser(s) name and version -- : FreFox 27.0.1
-- Error-message(debug-mod must be tuned on) -- : Error_message

Hi, I am struggling with two HK ajax issues related to product selection and checkout updating.

1. *Product text description*. Once a selection is made, the product text description is updated. Instead of appearing next to the product header, I would like the text to be displayed just above the "Add to Cart" button for improved clarity. I tried to use some jQuery to copy the text between the two highlighted spans, but the event handlers are probably destroyed by ajax once a selection is made. The html code is attached below. Could you tell me where to inject the js code to handle this issue?

[ ![h46cf3af.jpg](/forum/attachment/16542) ](/forum/attachment/16542 "h46cf3af.jpg")

[ ![h3eec185.jpg](/forum/attachment/16543) ](/forum/attachment/16543 "h3eec185.jpg")

2. *CSS checkout button class lost after "Add to cart" button click event*. By default, all buttons in the site include a custom CSS class. Once the "Add to cart" button is clicked, the checkout input button is regenerated causing this custom CSS class to be lost. Could you tell me how to add custom CSS classes back to HK elements after a HK ajax update?

[ ![h28e9206.jpg](/forum/attachment/16544) ](/forum/attachment/16544 "h28e9206.jpg")

[ ![h6435872.jpg](/forum/attachment/16545) ](/forum/attachment/16545 "h6435872.jpg")

TIA for any hints.

- [ ![h46cf3af.jpg](/forum/attachment/16542) ](/forum/attachment/16542 "h46cf3af.jpg") [ ](/forum/attachment/16542?download=1 "h46cf3af.jpg")
- [ ![h3eec185.jpg](/forum/attachment/16543) ](/forum/attachment/16543 "h3eec185.jpg") [ ](/forum/attachment/16543?download=1 "h3eec185.jpg")
- [ ![h28e9206.jpg](/forum/attachment/16544) ](/forum/attachment/16544 "h28e9206.jpg") [ ](/forum/attachment/16544?download=1 "h28e9206.jpg")
- [ ![h6435872.jpg](/forum/attachment/16545) ](/forum/attachment/16545 "h6435872.jpg") [ ](/forum/attachment/16545?download=1 "h6435872.jpg")

Last edit: 12 years 6 months ago by [Helveticus](/forum/user/20683-helveticus "View Helveticus's Profile").

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

12 years 6 months ago [\#151113](#151113) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Coping with HK ajax](/forum/26-product-category-display/867241-coping-with-hk-ajax#151113 "-- url of the page with the problem -- localhost -- HikaShop version -- :HK Essential: 2.3.0 -- Joomla version -- :2.5.19 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : FreFox 27.0.1 -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hi, I am struggling with two HK ajax issues related to product selection and checkout updating.  1. Product text description. Once a selection is made, the product text description is updated. Instead of appearing next to the product header, I would like the text to be displayed just above the &quot;Add to Cart&quot; button for improved clarity. I tried to use some jQuery to copy the text between the two highlighted spans, but the event handlers are probably destroyed by ajax once a selection is made. The html code is attached below. Could you tell me where to inject the js code to handle this issue?  2. CSS checkout button class lost after &quot;Add to cart&quot; button click event. By default, all buttons in the site include a custom CSS class. Once the &quot;Add to cart&quot; button is clicked, the checkout input button is regenerated causing this custom CSS class to be lost. Could you tell me how to add custom CSS classes back to HK elements after a HK ajax update?  TIA for any hints.")*

Hi,

1. I would recommend to edit the show_default view file and add your event listener on the onchange trigger of the characteristic dropdowns. Then you could do the move of the HTML in the DOM with jquery each time the characteristic dropdowns are changed.

2. This means that the buttons styling is added dynamically by a plugin/the template when the page is loaded. And thus, when the HTML of the cart module is retrieved and replaced, that dynamic process is not run again.
I guess that the simplest would be to edit the file "cart" of the view "product" via the menu Display-&gt;Views and modify the code adding that button Code:

echo $this-&gt;cart-&gt;displayButton(JText::_('PROCEED_TO_CHECKOUT'),'checkout',$this-&gt;params,hikashop_completeLink('checkout'.$url_itemid),'window.location=\''.hikashop_completeLink('checkout'.$url_itemid).'\';return false;');

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

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

[](#top)
