L E O Posted December 4, 2014 Share Posted December 4, 2014 Hi, I am creating a multistore server with Prestashop 1.6.0.9. I have 2 shops A and B, I would like to make all prices of shop B products more expensive (+10%) than those in shop A. I don't found anything to do this. Could anybody help me to realise that ?? Thanks for your help. Leo Link to comment Share on other sites More sharing options...
Tung at RockPOS.com Posted December 5, 2014 Share Posted December 5, 2014 Leo, I haven't never done the same thing, but as far as I understand, you should try this: UPDATE `product_shop` SET `price` = `price` * 1.1 WHERE `id_shop` = B Hope this helps! Tung 2 Link to comment Share on other sites More sharing options...
L E O Posted December 8, 2014 Author Share Posted December 8, 2014 Good idea Tung ! That solves temporarely my problem ... but my customer needs to specify price for each new product. Thanks. Link to comment Share on other sites More sharing options...
PrestaHeroes USA Posted December 8, 2014 Share Posted December 8, 2014 Here is nice way to have different prices by shop. back office-->catalog-->products-->edit a product-->add new specific price (select shop you want specific price for) that's it! 2 Link to comment Share on other sites More sharing options...
mono1 Posted March 10, 2016 Share Posted March 10, 2016 Leo, I haven't never done the same thing, but as far as I understand, you should try this: UPDATE `product_shop` SET `price` = `price` * 1.1 WHERE `id Leo, I haven't never done the same thing, but as far as I understand, you should try this: UPDATE `product_shop` SET `price` = `price` * 1.1 WHERE `id_shop` = B Hope this helps! Tung Tung you 're a Rock Star Life Saver...you can change your avatar into this One question IF you 're aware. Supposedly we wanted to automate this very same procedure, day by day -in order to change prices to reflect currency exchange rates fluctuation- what I should do? I want to be the very same procedure for the following reason. I have created a multishop environment. The one shop is the base shop and the other is additional shop. The base shop should have localization for Germany (default lang German, default currency Euro) and the additional shop localization for UK (default lang English, default currency GBP). So brilliantly enough you gave me the solution of how to do this, and thank you VERY much. Now I would like to automate this procedure but unfortunately I have not idea of how to do this. Somewhere I read that maybe I can achieve this through cron jobs but its an unknown field for me. So I would appreciate any help on this matter. Link to comment Share on other sites More sharing options...
Tung at RockPOS.com Posted March 11, 2016 Share Posted March 11, 2016 (edited) You're welcome To automate this, yes I have no other option than setting a cron job! But how? There are approaches: - Approach 1: If your prices reflect the real exchange rates (provided by PrestaShop), you can be easily to do that. Just go to Localization > Currencies, scroll down and you will the cron URL. Like this: - Approach 2: If you go with the solution mentioned previously in this topic, probably you have to write your own code: Look the file at [admin folder] / cron_currency_rates.php Create the similar one, and not tested yet but the code should look like this: if (!defined('_PS_ADMIN_DIR_')) { define('_PS_ADMIN_DIR_', getcwd()); } include(_PS_ADMIN_DIR_ . '/../config/config.inc.php'); if (isset($_GET['secure_key'])) { $secureKey = md5(_COOKIE_KEY_ . Configuration::get('PS_SHOP_NAME')); if (!empty($secureKey) && $secureKey === $_GET['secure_key']) { $sql = 'UPDATE `' . _DB_PREFIX_ . 'product_shop` SET `price` = `price` * 1.1 WHERE `id_shop` = B'; Db::getInstance()->execute($sql); } } The cron URL should be the same like the approach 1 above, except for 1 thing: change cron_currency_rates.php with your own file name. What's next? How to set up a cron job on your server? You can google for that, very easy. Or open a new topic. Hope that helps! Edited March 11, 2016 by Tung at RockPOS.com (see edit history) 1 Link to comment Share on other sites More sharing options...
mono1 Posted March 11, 2016 Share Posted March 11, 2016 You're welcome To automate this, yes I have no other option than setting a cron job! But how? There are approaches: - Approach 1: If your prices reflect the real exchange rates (provided by PrestaShop), you can be easily to do that. Just go to Localization > Currencies, scroll down and you will the cron URL. Like this: - Approach 2: If you go with the solution mentioned previously in this topic, probably you have to write your own code: Look the file at [admin folder] / cron_currency_rates.php Create the similar one, and not tested yet but the code should look like this: if (!defined('_PS_ADMIN_DIR_')) { define('_PS_ADMIN_DIR_', getcwd()); } include(_PS_ADMIN_DIR_ . '/../config/config.inc.php'); if (isset($_GET['secure_key'])) { $secureKey = md5(_COOKIE_KEY_ . Configuration::get('PS_SHOP_NAME')); if (!empty($secureKey) && $secureKey === $_GET['secure_key']) { $sql = 'UPDATE `' . _DB_PREFIX_ . 'product_shop` SET `price` = `price` * 1.1 WHERE `id_shop` = B'; Db::getInstance()->execute($sql); } } The cron URL should be the same like the approach 1 above, except for 1 thing: change cron_currency_rates.php with your own file name. What's next? How to set up a cron job on your server? You can google for that, very easy. Or open a new topic. Hope that helps! Thank you very much for your time. It's a great help for me. I will try to apply these suggestions. Cheers! Link to comment Share on other sites More sharing options...
Ableson Posted March 13, 2016 Share Posted March 13, 2016 "What's next? How to set up a cron job on your server? You can google for that, very easy. Or open a new topic." Look like the tutorial is solution for you, at: https://www.easycron.com/cron-job-tutorials/how-to-set-up-cron-job-for-prestashop-currencies, hope help you. 1 Link to comment Share on other sites More sharing options...
mono1 Posted March 15, 2016 Share Posted March 15, 2016 "What's next? How to set up a cron job on your server? You can google for that, very easy. Or open a new topic." Look like the tutorial is solution for you, at: https://www.easycron.com/cron-job-tutorials/how-to-set-up-cron-job-for-prestashop-currencies, hope help you. Ableson thank you for your help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now