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

#   Update Value from Product data to Order Product Data

##

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

Less More

- Posts: 6
- Thank you received: 0
-
-

9 years 4 months ago [\#272705](#272705) by [candyokid](/forum/user/50441-candyokid "View candyokid's Profile")  *[Update Value from Product data to Order Product Data](/forum/44-mass-actions/890883-update-value-from-product-data-to-order-product-data#272705 "Hello, I am trying to setup mass actions to take a value from a custom field in the product table and save it with the order product data in the Order&#95;Product table. I have created a custom field...")* was created by *[candyokid](/forum/user/50441-candyokid "View candyokid's Profile")*

Hello, I am trying to setup mass actions to take a value from a custom field in the product table and save it with the order product data in the Order_Product table. I have created a custom field called "order_product_case_size" under the option for table = "item" and I can see the column in the database in the right table. Below is the screenshot of my mass action settings (which I am sure are not right).

[ ![mass-action-settings.png](/forum/attachment/38893) ](/forum/attachment/38893 "...n-settings.png")

How can I accomplish this? If there is no built in solution, I would love a work around. Maybe there should be a massaction plugin for order_product?

Thank You.

- [ ![error-update-case-size.png](/forum/attachment/38891) ](/forum/attachment/38891 "...-case-size.png") [ ](/forum/attachment/38891?download=1 "...-case-size.png")
- [ ![customfield-item.png](/forum/attachment/38892) ](/forum/attachment/38892 "...field-item.png") [ ](/forum/attachment/38892?download=1 "...field-item.png")
- [ ![mass-action-settings.png](/forum/attachment/38893) ](/forum/attachment/38893 "...n-settings.png") [ ](/forum/attachment/38893?download=1 "...n-settings.png")

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

9 years 4 months ago [\#272707](#272707) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Update Value from Product data to Order Product Data](/forum/44-mass-actions/890883-update-value-from-product-data-to-order-product-data#272707 "Hello, I am trying to setup mass actions to take a value from a custom field in the product table and save it with the order product data in the Order&#95;Product table. I have created a custom field...")*

Hi,

There are 2 problems with your mass action:
1. the "after an order is created" trigger is after the order is created, but before the insertion of the products of the order in the order_product table.
2. there is no product.unitspercase tag you can use there. The only column tags you can use are the columns listed in the first dropdown and custom product fields are not listed there.

So it won't be possible with a mass action.
The only proper way to do this would be to create a small plugin impelmenting the onAfterOrderCreate trigger and setting the value yourself in the plugin.

As a trick, if you have a column with the same name in the hikashop_product table as you custom item field and that you display the custom item field on the product page (you can hide it in CSS and it will still work) the system will automaticaly copy the value from the column in the hikashop_product table to your custom item field in the cart and then the order.
You can then potentially have a mass action to copy the value from your unitspercase custom product field column to the column order_product_case_size with a product mass action when you create/update a product.
That way, you can still edit the value in the backend interface and have it synchronized in the column of the hikashop_product table.
That's the only solution I see without any coding.

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

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

Less More

- Posts: 6
- Thank you received: 0
-
-

9 years 4 months ago [\#272712](#272712) by [candyokid](/forum/user/50441-candyokid "View candyokid's Profile")  Replied by *[candyokid](/forum/user/50441-candyokid "View candyokid's Profile")* on topic *[Update Value from Product data to Order Product Data](/forum/44-mass-actions/890883-update-value-from-product-data-to-order-product-data#272712 "Hello, I am trying to setup mass actions to take a value from a custom field in the product table and save it with the order product data in the Order&#95;Product table. I have created a custom field...")*

Thank you! I made a plugin to do the trick. I attached it here in case its helpful or in case you have time to review it you can tell me if its okay or if I did it the wrong way, the end result is that it works.

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

9 years 4 months ago [\#272720](#272720) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Update Value from Product data to Order Product Data](/forum/44-mass-actions/890883-update-value-from-product-data-to-order-product-data#272720 "Hello, I am trying to setup mass actions to take a value from a custom field in the product table and save it with the order product data in the Order&#95;Product table. I have created a custom field...")*

Hi,

That looks good yes. I would just recommend removing the echo lines so that they don't display to the customer, but I suppose you already know that ![:)](/media/kunena/emoticons/3.png ":)")

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

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