I am trying to create a query connecting to Opencart through SQL bypassing Opencart altogether for the system I am making for a client.
The problem I am having with this is that the purchased products items are being duplicated and I cannot figure out exactly where the duplication is coming from.
oc_order_option is the part where I'm deriving the information for the values are coming in from oc_order_option.value all useing a JOIN by order_id. I think this might be where the duplications are coming from but I'm unsure.
I'm Useing Opencart 2.1.0.2
oc_order_option.name
oc_order_option.order_id
oc_order_option.name
oc_order_option.value
Any help that anyone could give me I would really appreciate thanks
The code below is the query I have made for my program it is running through SQL
Code: Select all
SELECT
oc_order.store_url,
oc_order.order_id,
oc_order.firstname,
oc_order.lastname,
oc_order.email,
oc_order_option.order_id,
oc_order_option.name,
oc_order_option.value,
oc_order_product.order_id,
oc_order_product.name,
oc_order_product.model,
oc_order_product.quantity,
oc_order_history.order_id
FROM oc_order
INNER JOIN oc_order_product ON oc_order.order_id = oc_order_product.order_id
INNER JOIN oc_order_option ON oc_order.order_id = oc_order_option.order_id
INNER JOIN oc_order_history ON oc_order.order_id = oc_order_history.order_id