Creating a CLI command to automate Quantity Discount imports

Hi team,

Basically as the title states, I’m looking to create a command that I can use as a Cron job for importing quantity discounts.

As a bit of background info, our company works on 4 different prices depending on B2B/B2C/users registered with us etc. The simplest way that we’ve found to be able to achieve these different prices is through quantity discounts and user groups, with minimum quantity set to 1 for all user groups on all items.

Currently, the rest of our import process for products is automated, so it’s tedious having to update the prices manually.

I’ve had a look at exim.php to see if I could glean any info on what the required parameters for the dispatch are and this is what I have so far:

php /path/to/cart/admin.php

Does anyone have any knowledge that they could impart, or point me in the right direction?



I’m afraid there is no way to import the Quantity discounts via CLI in the default CS-Cart.

You can try, however add the path/URL of the file to the following params:

file_csv_file_image_data = /URL/to/file/

and necessarily add the p parameter for CS-Cart to treat this request as POST.