order_product_status is used??

  • Posts: 3
  • Thank you received: 0
5 years 1 month ago #311995

-- HikaShop version -- : 4.2.2
-- Joomla version -- : Joomla! 3.9.12
-- PHP version -- : PHP/7.3.9
-- Browser(s) name and version -- : FIREFOX 69.0.2 (64 biT)
-- Info about : `order_product_status` IN 'hikashop_order_product`

Hi,
I would like to use the 'order_product_status' field in' hikashop_order_product` table to store custom data.
To avoid problems, I would like to know what is the real use for the 'order_product_status' field of the 'hikashop_order_product' table
Thanks

Pavel

Last edit: 5 years 1 month ago by pavel.70.

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
5 years 1 month ago #311996

Hi,

The goal of this field is to be able to have different statuses for different products of an order on top of one main status in the main order. For now that field isn't used but it is planned to be used in the future.
It could be used for example if you want to shipping the products of the same order with different packages. You could change the status of each product (or group of products) in the order to shipped independently until all the products are shipped and the main order status itself switches to shipped.
I would thus recommend to not store anything in that column of the database.
If you want to store something in the order_product table without creating a new column, you could store that in the order_product_params column. It needs to be json_encoded in the same way HikaShop does it.
But otherwise, the simplest would just be to create a new column via your phpmyadmin where you could do whatever you want with.
In fact, if you have HikaShop Business, you could just create a custom field of the table "item" via the menu Display>Views. That would add a column with the column name of your custom field in the orde_product table. And you would even be able to display its content in emails, invoice, etc if necessary thanks to the display settings of the custom field.

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
5 years 1 month ago #312025

I think the simplest solution is to create a new column on the "hikashop_order_product" table with the name "order_product_custom_status".
My purpose is to modify the "order_product_custom_status" field as if it were a discount counter.
Whenever the customer uses 1 specific discount for a product of his order, the "order_product_custom_status" field will increase by 1 until the number of products ordered is equalized.
When the "order_product_custom_status" counter is equal to the quantity of the products ordered for that specific order, the customer will no longer have the discounts available for the specific product.
I would also like to be able to show and edit the new "order_product_custom_status" field from back-end order management, is it possible?
I also didn't understand the proposed solution:

nicolas wrote: Hi,
.......
But otherwise, the simplest would just be to create a new column via your phpmyadmin where you could do whatever you want with. (OK)
In fact, if you have HikaShop Business, you could just create a custom field of the table "item" via the menu Display>Views. That would add a column with the column name of your custom field in the orde_product table. And you would even be able to display its content in emails, invoice, etc if necessary thanks to the display settings of the custom field.

Attachments:
Last edit: 5 years 1 month ago by pavel.70.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
5 years 1 month ago #312027

Hello,

I would also like to be able to show and edit the new "order_product_custom_status" field from back-end order management, is it possible?


Sure, custom "Item" fields can be displayed through the back-end order management page, by enabling the following options through your custom field configuration page:
- Product edition form in order
- Back-end form

Kind regards,
Mohamed Thelji.

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum