Post by Nordikota » Fri Feb 22, 2019 6:10 pm

Is there any way to know what products are assigned with a specific option without having to look at every product individually? Ideally look at the Options list and find out what products are assigned to the option. We've 100s of options and have some duplicates over the years :-\

Thanks in advance ;D

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by paulfeakins » Fri Feb 22, 2019 8:10 pm

Try this (obviously adjust "option name"):

Code: Select all

select pd.name, po.value from oc_product_description pd
join oc_product p on p.product_id = pd.product_id
join oc_product_option po on po.product_id = p.product_id
where po.value like '%option name%'

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by Nordikota » Fri Feb 22, 2019 8:18 pm

Thanks. I tried that but it returned Zero values and the message below?

Code: Select all

select pd.name, po.value from oc_product_description pd join oc_product p on p.product_id = pd.product_id join oc_product_option po on po.product_id = p.product_id where po.value like '%Preferred Print Colour%'

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by paulfeakins » Fri Feb 22, 2019 8:23 pm

Ah I see what you're trying to do, try this:

Code: Select all

select pd.name from oc_product_description pd
join oc_product p on p.product_id = pd.product_id
join oc_product_option po on po.product_id = p.product_id
join oc_option_description od on od.option_id = po.option_id
where od.name like '%Preferred Print Colour%'

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by Nordikota » Fri Feb 22, 2019 9:31 pm

B-E-A-UTIFUL! Works a treat. Thanks for your help - it's saved me hours ;D

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by paulfeakins » Fri Feb 22, 2019 9:59 pm

You're welcome :)

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom
Who is online

Users browsing this forum: No registered users and 5 guests