Page 1 of 1

MySQL rule

Posted: Tue Feb 19, 2019 6:48 am
by Vindojeens
Hello! :)

I have a problem, I'm runing an extension for exporting all my product to a YML file (2 years already on Opencart The extension runs well.

The extensions allows to specify a SQL "rule" in order to dertermine what products to pick and which not.
This is the "rule" I run:

p.status = true AND p.quantity > 0 AND p.quantity < 15000 AND (p.date_added = date '2016-12-23 22:37:56' OR p.date_added >= date '2017-11-01 21:16:29')

Basically it is self-explamentory. Products are adressed with "p.".

My problem is, i want to extend that rule in the following way:

IF category id=100, above rule should apply, ELSE another rule should apply.

I do not know how to phrase it and I cannot reach the developer and have no means to get support from the author.

Can someone help me?

I am really thankfull for any help as I've been thinking about this for months now and reading a lot, but I lack the basic knowledge of MySQL and PHP.

Re: MySQL rule

Posted: Tue Feb 19, 2019 7:49 am
by thekrotek
Well... category ID for products is saved in different table. What is the full SQL query, in which this rule is added?