From OXID eShop version 4.6.x on, the feature “Automatic Product Price Update” (PU) on a defined time will be available. This feature enables you to update your prices before they come into effect for your front end user.
To set up special prices for PU, go to the administration area of your OXID eShop -> Administer Products -> Products -> Extended” and enter the needed information into the PU area. Prices entered into base price, price A, price B, price C will overwrite the standard product prices (usually entered via the tab “Main”) on a defined time.
Usually, prices are updated on page load, but there is an interesting alternative way: run cron jobs 🙂
Of course, your hosting provider has to support cron jobs, you also have to have shell access to your server. This example shall demonstrate how to setup this cron jobs for Automatic Product Price Update:
1. enable cron in config.inc.php:
$this->blUseCron = true;
2. Find out your shop installation path, which you will need for cron. Usually, your config.inc.php already contains this information:
$this->sShopDir = '/var/www/eshop/source';
3. Login to your server shell and execute the command:
4. Enter similar instructions into the opened crontab:
* * * * * php /var/www/eshop/source/bin/cron.php > /var/www/eshop/source/bin/log.txt
This example will execute a cron task every minute and will write any error or other message to your defined “log.txt” file. More information about cron jobs can be found on http://en.wikipedia.org/wiki/Cron
Important information for Enterprise Edition
“config.inc.php” also has to be updated. Append
"OXUPDATEPRICE", "OXUPDATEPRICEA", "OXUPDATEPRICEB", "OXUPDATEPRICEC", "OXUPDATEPRICETIME"
so it should look:
$this->aMultishopArticleFields = array("OXPRICE", "OXPRICEA", "OXPRICEB", "OXPRICEC", "OXUPDATEPRICE", "OXUPDATEPRICEA", "OXUPDATEPRICEB", "OXUPDATEPRICEC", "OXUPDATEPRICETIME");