Advertisement
Guest User

Untitled

a guest
Mar 6th, 2017
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.69 KB | None | 0 0
  1. <?php ose($O000O0O00);eval($OO00O00O0);
  2. class Price extends CsyncTools
  3. {
  4. public static function spec_price($xml,&$mass,&$product_label,&$ids)
  5. {
  6. $tovars = $xml->{
  7. 'shop'
  8. }->{
  9. 'offers'
  10. }->{
  11. 'offer'
  12. };
  13. if (!empty($tovars)) {
  14. foreach ($tovars as $tovar) {
  15. $id_product = Db::getInstance()->getValue($GLOBALS['OOO0000O0']('U0VMRUNUIGBpZF9wcm9kdWN0YCBGUk9NIGA=') ._DB_PREFIX_ ."product` WHERE `xml`='".$tovar->attributes()->id ."'");
  16. $ids[] = $id_product;
  17. $opt = (float)$tovar->price;
  18. $pro = (float)$tovar->oldprice;
  19. if ((!empty($opt)) &&(!empty($pro)) &&$pro >$opt) {
  20. Db::getInstance()->Execute($GLOBALS['OOO0000O0']('DQogICAgICAgICAgICAgICAgICAgICAgICBERUxFVEUgRlJPTSBg')._DB_PREFIX_."specific_price`
  21.                        WHERE `id_product`= '".$id_product."'
  22.                        ");
  23. self::optrice($id_product,0,0,"$pro","$opt",$mass);
  24. $product_label[] = $id_product;
  25. }
  26. }
  27. Configuration::updateGlobalValue($GLOBALS['OOO0000O0']('UFNfU1BFQ0lGSUNfUFJJQ0VfRkVBVFVSRV9BQ1RJVkU='),$GLOBALS['OOO0000O0']('MQ=='));
  28. }
  29. }
  30. public static function getprice($prices)
  31. {
  32. if (!empty($prices->recommendedPrice)) {
  33. $price = str_replace(',','.',$prices->recommendedPrice) * Configuration::get('_KURS_');
  34. }else {
  35. $price = str_replace($GLOBALS['OOO0000O0']('LA=='),$GLOBALS['OOO0000O0']('Lg=='),$prices->retailPrice) * Configuration::get($GLOBALS['OOO0000O0']('X0tVUlNf'));
  36. }
  37. if (!empty($price))return $price;
  38. }
  39. public static function optrice($id_product,$id_product_attribute,$id_group,$pro,$price,&$mass)
  40. {
  41. $reduction = $pro -$price;
  42. $mass[] = "('".$id_product."','".$id_product_attribute."', '".$id_group."',-1,'".$reduction."',1 ,'amount')";
  43. }
  44. public static
  45. function updateproducttable ($table,$table_tmp)
  46. {
  47. $table     = _DB_PREFIX_.$table;
  48. $table_tmp = _DB_PREFIX_.$table_tmp;
  49. return    Db::getInstance()->Execute("
  50.            UPDATE $table dest, $table_tmp src
  51.            SET
  52.            dest.price=src.price,
  53.            dest.wholesale_price=src.wholesale_price,
  54.            dest.quantity=src.quantity,
  55.            dest.date_upd=src.date_upd
  56.            WHERE
  57.            dest.xml=src.xml
  58.            ");
  59. }
  60. public static
  61. function updateproducttableshop ($table,$table_tmp)
  62. {
  63. $table     = _DB_PREFIX_.$table;
  64. $table_tmp = _DB_PREFIX_.$table_tmp;
  65. return    Db::getInstance()->Execute("
  66.            UPDATE $table dest, $table_tmp src
  67.            SET
  68.            dest.price=src.price,
  69.            dest.wholesale_price=src.wholesale_price,
  70.            dest.date_upd=src.date_upd
  71.            WHERE
  72.            dest.xml=src.xml
  73.            ");
  74. }
  75. public static
  76. function updateproducttablenull ($table,$table_tmp)
  77. {
  78. $table     = _DB_PREFIX_.$table;
  79. $table_tmp = _DB_PREFIX_.$table_tmp;
  80. return    Db::getInstance()->Execute("
  81.            UPDATE $table dest, $table_tmp src
  82.            SET
  83.            dest.price=src.price
  84.            WHERE
  85.            dest.xml=src.xml
  86.            ");
  87. }
  88. public static
  89. function updateproducttableatr ($table,$table_tmp)
  90. {
  91. $table     = _DB_PREFIX_.$table;
  92. $table_tmp = _DB_PREFIX_.$table_tmp;
  93. return    Db::getInstance()->Execute("
  94.            UPDATE $table dest, $table_tmp src
  95.            SET
  96.            dest.price=src.price,
  97.            dest.wholesale_price=src.wholesale_price,
  98.            dest.quantity=src.quantity
  99.            WHERE
  100.            dest.xml=src.xml
  101.            ");
  102. }
  103. public static
  104. function updateproducttableatrshop ($table,$table_tmp)
  105. {
  106. $table     = _DB_PREFIX_.$table;
  107. $table_tmp = _DB_PREFIX_.$table_tmp;
  108. return    Db::getInstance()->Execute("
  109.            UPDATE $table dest, $table_tmp src
  110.            SET
  111.            dest.price=src.price,
  112.            dest.wholesale_price=src.wholesale_price
  113.            WHERE
  114.            dest.xml ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement