Product option linked to the right product

  • Posts: 105
  • Thank you received: 2
9 years 1 month ago #217004

-- HikaShop version -- : Business 2.2.3
-- Browser(s) name and version -- : A

Hello,
how can we know that an option added to a main product in the product page is linked to that product?

for example, if I order in the same order several main products (M1, M2, M3) which may have several options (OA, OB) chosen in each individual product page like this:
M1 - OA
M2 - OB
M3 - OB
How do I know that option OA is "linked" to M1, (and not M2 for example?)

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 1 month ago #217023

Hi,

The options are grouped with the product that you add to the cart together.
So you know that automatically.
That is unless you turned off the "group options with product" of the HikaShop configuration so that the options don't get grouped with the products :)

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

  • Posts: 105
  • Thank you received: 2
9 years 1 month ago #217064

thanks. my question was maybe not clear enough.
I can clearly see the grouping. however what i try to know is another piece of code of my website can see it also: is there a variable (or some variables linked in a database row) that can be read from another function nof my website to see this grouping?

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 1 month ago #217073

Hi,

From a database structure perspective, here is my answer:
The product data of an order is stored in the table hikashop_order_product.
There, you can see the column order_product_option_parent_id
Each row of the table hikashop_order_product is a product in an order. And if there is something in that order_product_option_parent_id column, it means that the row is an option of another product and the value of that column is actually the id of that other product to which the current row is attached as an option.

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

  • Posts: 105
  • Thank you received: 2
9 years 1 month ago #217103

thanks a lot; exactly what I needed :)

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

Time to create page: 0.059 seconds
Powered by Kunena Forum