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

#   Based on a custom field set a value in the cart...

##

- **[TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")**
- [![TheEdge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1997.gif)](/forum/user/1997-theedge "View TheEdge's Profile") Topic Author
- [ Offline](/forum/user/1997-theedge)

Less More

- Posts: 62
- Thank you received: 0
-
-

12 years 3 months ago [\#168249](#168249) by [TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")  *[Based on a custom field set a value in the cart...](/forum/27-checkout/870503-based-on-a-custom-field-set-a-value-in-the-cart#168249 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.3  Hi,  I want to have a drop down list in the checkout process that has two values Yes and No. That is easy enough, however I want to add/remove a line item in the cart based on what is selected. So if YES is selected add a line to cart of:  Cooler Box 1.00  if NO then I want  Cooler Box 0.00  Naturally as those changes are made I need the total of the cart updated as part of the checkout process.")* was created by *[TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")*

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.3

Hi,

I want to have a drop down list in the checkout process that has two values Yes and No. That is easy enough, however I want to add/remove a line item in the cart based on what is selected. So if YES is selected add a line to cart of:

Cooler Box 1.00

if NO then I want

Cooler Box 0.00

Naturally as those changes are made I need the total of the cart updated as part of the checkout process.

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 3 months ago [\#168292](#168292) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Based on a custom field set a value in the cart...](/forum/27-checkout/870503-based-on-a-custom-field-set-a-value-in-the-cart#168292 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.3  Hi,  I want to have a drop down list in the checkout process that has two values Yes and No. That is easy enough, however I want to add/remove a line item in the cart based on what is selected. So if YES is selected add a line to cart of:  Cooler Box 1.00  if NO then I want  Cooler Box 0.00  Naturally as those changes are made I need the total of the cart updated as part of the checkout process.")*

Hi,

You can create this custom field thanks to our custom fields system.
Create a custom field with the type "order" via the menu Display &gt; Custom fields, and set it as a dropdown with the desired values.

Then you will have to create your own plugin to edit the cart based on the value of this custom field.
So it require good PHP knwoledges, here is documentation for the plugins:
[ hikashop.com/support/support/documentati...r-documentation.html](https://hikashop.com/support/support/documentation/62-hikashop-developer-documentation.html)

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

- **[TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")**
- [![TheEdge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1997.gif)](/forum/user/1997-theedge "View TheEdge's Profile") Topic Author
- [ Offline](/forum/user/1997-theedge)

Less More

- Posts: 62
- Thank you received: 0
-
-

12 years 3 months ago [\#169160](#169160) by [TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")  Replied by *[TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")* on topic *[Based on a custom field set a value in the cart...](/forum/27-checkout/870503-based-on-a-custom-field-set-a-value-in-the-cart#169160 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.3  Hi,  I want to have a drop down list in the checkout process that has two values Yes and No. That is easy enough, however I want to add/remove a line item in the cart based on what is selected. So if YES is selected add a line to cart of:  Cooler Box 1.00  if NO then I want  Cooler Box 0.00  Naturally as those changes are made I need the total of the cart updated as part of the checkout process.")*

Hi,

OK, I can do the PHP side of things. My questions Hikashop are

1) What trigger do I hook off the custom field so that I know when the select box changes?
2) In that trigger how do I get hold of the cart global object so I can add/remove an item?
3) Will doing 2) change the total for the cart or will I have to perform a postback of some form?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MDUwMy1iYXNlZC1vbi1hLWN1c3RvbS1maWVsZC1zZXQtYS12YWx1ZS1pbi10aGUtY2FydD90bXBsPW1hcmtkb3du) 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: 14326
-
-

12 years 3 months ago [\#169244](#169244) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Based on a custom field set a value in the cart...](/forum/27-checkout/870503-based-on-a-custom-field-set-a-value-in-the-cart#169244 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.3  Hi,  I want to have a drop down list in the checkout process that has two values Yes and No. That is easy enough, however I want to add/remove a line item in the cart based on what is selected. So if YES is selected add a line to cart of:  Cooler Box 1.00  if NO then I want  Cooler Box 0.00  Naturally as those changes are made I need the total of the cart updated as part of the checkout process.")*

Hi,

1. It depends what kind of custom field you're using so I can't answer to that without more information. Could you maybe do a screenshot of the options of the custom field so that we can tell you ?

2. You could do that directly in the trigger of point 1 by adding/removing the product from the cart directly in the hikashop_cart_product table of the database.

3. It depends. If you do that via a query to the database and that the cart was already loaded on the page, a redirect to the same page could be necessary so that the system reloads the cart with/without the product.

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

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