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
–dispatch=exim.import
–section=products
–pattern_id=qty_discounts
–import_options[price_dec_sign_delimiter]=.
–import_options[delimiter]=C
–csv_file=quantdis.csv
–path=/path/to/files/quantdis.csv

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

Cheers!

Hello!

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/
type_csv_file_image_data=url

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