Post by 21Monkey_Cubes » Fri Jul 23, 2021 5:04 am

I have a question. I have been trying to figure this out for hours.
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


Posts

Joined
Fri Jul 23, 2021 4:58 am

Post by straightlight » Fri Jul 23, 2021 10:36 pm

21Monkey_Cubes wrote:
Fri Jul 23, 2021 5:04 am
I have a question. I have been trying to figure this out for hours.
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
Since it's for a client, or family-client, then you should be able to achieve this. Otherwise, you could always create a new service request in the Commercial Support section of the forum to have this issue investigated as a custom job.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 45 guests