Jump to content
  • Posts

    29
  • Joined

  • Last visited

1 Follower

Profile Information

  • Activity
    User/Merchant

[email protected]'s Achievements

Newbie

Newbie (1/14)

5

Reputation

  1. Hi, I have a script which is changing order status from external program^ but it is changing order status directly in the database. Can somebody help me to change the script in order to use native Prestashop status change? Here is my code: <? ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); include(dirname(__FILE__).'/config/config.inc.php'); $result = Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'orders where date_add >= now() - INTERVAL 24 HOUR;'); if(isset($result) && !empty($result)){ foreach($result as $item){ if((int)$item['current_state']==5){continue;} $url=" XXXXXXXXX". "idOrder=".$item['shipping_number']. "&user=test". "&password=123456". "&cid=4541"; $mych = curl_init(); curl_setopt($mych, CURLOPT_URL, $url); curl_setopt($mych, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($mych, CURLOPT_HEADER, 0); $data = curl_exec($mych); curl_close($mych); /* echo "<pre>"; print_r($data); echo "</pre>";*/ $rez=""; if(isset($data) && !empty($data) && $data != 'null' ){ $rez = json_decode($data, true); switch ((int)$rez['status']){ case 3: Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET current_state = 1 WHERE shipping_number = '.$item["shipping_number"]); break; case 4: Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET current_state = 1 WHERE shipping_number = '.$item["shipping_number"]); break; case 5: Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET current_state = 1 WHERE shipping_number = '.$item["shipping_number"]); break; case 6: Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET current_state = 1 WHERE shipping_number = '.$item["shipping_number"]); break; case 7: Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET current_state = 1 WHERE shipping_number = '.$item["shipping_number"]); break; case 8: Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET current_state = 4 WHERE shipping_number = '.$item["shipping_number"]); break; default: Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET current_state = 3 WHERE shipping_number = '.$item["shipping_number"]); } }else{ /*Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'orders` SET `current_state` = 5 WHERE `shipping_number` = '.$item["shipping_number"]);*/ } } } echo 1; ?> Regards Suren
  2. Hi, I am looking for solution to call a pop-up on site pages with notice "We are closed now. But you can make pre-order" when the shop is closed. I also have food delivery site and I think it is better way to communicate with customer. Regards
  3. Yes, I know about "display:none" but as you said it only hide html output and not reducing the size of resulting page.
  4. Is it possible to disable module for certain screen resolution in 1.5.4?
  5. Can you help to show product weight on category page. I try to insert following {sprintf("%1\$u",$product->weight)} but it shows 0 (zero) while on product page this code works. PS: I use 1.5.4
  6. Hi, Pascal! I moved file SetCartRule.php to parent directory and now everything works. Thank you very much for you support! Regards
  7. This I get from console: root@pushpizza:~# /usr/bin/wget -O /dev/null -t 1 http://pushpizza.ru/config/SetCartRuleTime.php --2014-02-01 16:34:00-- http://pushpizza.ru/config/SetCartRuleTime.php Resolving pushpizza.ru (pushpizza.ru)... 78.24.221.120 Connecting to pushpizza.ru (pushpizza.ru)|78.24.221.120|:80... connected. HTTP request sent, awaiting response... 403 Forbidden 2014-02-01 16:34:00 ERROR 403: Forbidden. Regards Suren
  8. Hi, Pascal Yes I run command under root. /usr/bin/wget -O /dev/null -t 1 http://pushpizza.ru/config/SetCartRuleTime.php Regards Suren
  9. Hi Pascal! I made everything like you wrote but it doesn't work. When I run cron job it gives me: Exited with return code = 8 and doesn't change my cart rule. My file looks like: <?php // cron job php script to set shop into maintenance mode // by Pascal van Geest @ ModulesModules.com // use with cron job string like this: // //Setup connection variables, such as database username //and password $hostname="localhost"; $dbname="***"; $username="***"; $password="***"; //Connect to the database $connection = mysql_connect($hostname, $username, $password); mysql_select_db($dbname, $connection); //Setup our query $query = "UPDATE `ps_cart_rule` SET `date_from`=CURDATE() + INTERVAL 10 HOUR, `date_to`= CURDATE() + INTERVAL 16 HOUR WHERE `id_cart_rule` = 167;"; //Run the Query $result = mysql_query($query); ?> What to do? Regards
  10. Thanks, Pascal! I'll try it and will get you know if it works.
  11. How to create price rules depending on time? I need to give X% discount on some categories starting 13:00 till 16:00 for example.
×
×
  • Create New...