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

#   Additional Parameter in Cart

##

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

Less More

- Posts: 42
- Thank you received: 3
-
-

3 years 4 months ago [\#353005](#353005) by [JF](/forum/user/67343-jf "View JF's Profile")  *[Additional Parameter in Cart](/forum/27-checkout/906654-additional-parameter-in-cart#353005 "-- url of the page with the problem -- :   lazykitchen.satumalaysiahosting.com/checkout  Hi,  May I know Is there any way to save the additional parameter in cart but not override?  I would like to append additional parameter on every add to cart.")* was created by *[JF](/forum/user/67343-jf "View JF's Profile")*

-- url of the page with the problem -- : [ lazykitchen.satumalaysiahosting.com/checkout](https://lazykitchen.satumalaysiahosting.com/checkout)

Hi,

May I know Is there any way to save the additional parameter in cart but not override?

I would like to append additional parameter on every add to cart.

- [ ![Capture&#95;2023-07-04.PNG](/forum/attachment/57317) ](/forum/attachment/57317 "...2023-07-04.PNG") [ ](/forum/attachment/57317?download=1 "...2023-07-04.PNG")
- [ ![Capture1&#95;2023-07-04.PNG](/forum/attachment/57318) ](/forum/attachment/57318 "...2023-07-04.PNG") [ ](/forum/attachment/57318?download=1 "...2023-07-04.PNG")

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

3 years 4 months ago [\#353016](#353016) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Additional Parameter in Cart](/forum/27-checkout/906654-additional-parameter-in-cart#353016 "-- url of the page with the problem -- :   lazykitchen.satumalaysiahosting.com/checkout  Hi,  May I know Is there any way to save the additional parameter in cart but not override?  I would like to append additional parameter on every add to cart.")*

Hi,

If you check the save function of class.cart, you can see that the data in $element-&gt;additional is moved to $element-&gt;cart_params-&gt;additional before the event onBeforeCartSave is called. And after the event, the content of $element-&gt;cart_params is json_encode

So you can do it in onBeforeCartSave, but you need to add it to $element-&gt;cart_params-&gt;additional yourself so that it is taken into account.

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

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

Less More

- Posts: 42
- Thank you received: 3
-
-

3 years 4 months ago [\#353815](#353815) by [JF](/forum/user/67343-jf "View JF's Profile")  Replied by *[JF](/forum/user/67343-jf "View JF's Profile")* on topic *[Additional Parameter in Cart](/forum/27-checkout/906654-additional-parameter-in-cart#353815 "-- url of the page with the problem -- :   lazykitchen.satumalaysiahosting.com/checkout  Hi,  May I know Is there any way to save the additional parameter in cart but not override?  I would like to append additional parameter on every add to cart.")*

Hi,

I tried use $element-&gt;cart_params-&gt;additional = $additional; but the discount not loaded also.

- [ ![c1.PNG](/forum/attachment/57485) ](/forum/attachment/57485 "c1.PNG") [ ](/forum/attachment/57485?download=1 "c1.PNG")
- [ ![c2.PNG](/forum/attachment/57486) ](/forum/attachment/57486 "c2.PNG") [ ](/forum/attachment/57486?download=1 "c2.PNG")

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

3 years 4 months ago [\#353833](#353833) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Additional Parameter in Cart](/forum/27-checkout/906654-additional-parameter-in-cart#353833 "-- url of the page with the problem -- :   lazykitchen.satumalaysiahosting.com/checkout  Hi,  May I know Is there any way to save the additional parameter in cart but not override?  I would like to append additional parameter on every add to cart.")*

Hi,

Ah yes. You need to move the additional from $element-&gt;cart_params-&gt;additional to $element-&gt;additional yourself when the cart is being loaded. For example with the event onAfterCartLoad(&amp;$element, &amp;$options)

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

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