Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php ose($O000O0O00);eval($OO00O00O0);
- class Price extends CsyncTools
- {
- public static function spec_price($xml,&$mass,&$product_label,&$ids)
- {
- $tovars = $xml->{
- 'shop'
- }->{
- 'offers'
- }->{
- 'offer'
- };
- if (!empty($tovars)) {
- foreach ($tovars as $tovar) {
- $id_product = Db::getInstance()->getValue($GLOBALS['OOO0000O0']('U0VMRUNUIGBpZF9wcm9kdWN0YCBGUk9NIGA=') ._DB_PREFIX_ ."product` WHERE `xml`='".$tovar->attributes()->id ."'");
- $ids[] = $id_product;
- $opt = (float)$tovar->price;
- $pro = (float)$tovar->oldprice;
- if ((!empty($opt)) &&(!empty($pro)) &&$pro >$opt) {
- Db::getInstance()->Execute($GLOBALS['OOO0000O0']('DQogICAgICAgICAgICAgICAgICAgICAgICBERUxFVEUgRlJPTSBg')._DB_PREFIX_."specific_price`
- WHERE `id_product`= '".$id_product."'
- ");
- self::optrice($id_product,0,0,"$pro","$opt",$mass);
- $product_label[] = $id_product;
- }
- }
- Configuration::updateGlobalValue($GLOBALS['OOO0000O0']('UFNfU1BFQ0lGSUNfUFJJQ0VfRkVBVFVSRV9BQ1RJVkU='),$GLOBALS['OOO0000O0']('MQ=='));
- }
- }
- public static function getprice($prices)
- {
- if (!empty($prices->recommendedPrice)) {
- $price = str_replace(',','.',$prices->recommendedPrice) * Configuration::get('_KURS_');
- }else {
- $price = str_replace($GLOBALS['OOO0000O0']('LA=='),$GLOBALS['OOO0000O0']('Lg=='),$prices->retailPrice) * Configuration::get($GLOBALS['OOO0000O0']('X0tVUlNf'));
- }
- if (!empty($price))return $price;
- }
- public static function optrice($id_product,$id_product_attribute,$id_group,$pro,$price,&$mass)
- {
- $reduction = $pro -$price;
- $mass[] = "('".$id_product."','".$id_product_attribute."', '".$id_group."',-1,'".$reduction."',1 ,'amount')";
- }
- public static
- function updateproducttable ($table,$table_tmp)
- {
- $table = _DB_PREFIX_.$table;
- $table_tmp = _DB_PREFIX_.$table_tmp;
- return Db::getInstance()->Execute("
- UPDATE $table dest, $table_tmp src
- SET
- dest.price=src.price,
- dest.wholesale_price=src.wholesale_price,
- dest.quantity=src.quantity,
- dest.date_upd=src.date_upd
- WHERE
- dest.xml=src.xml
- ");
- }
- public static
- function updateproducttableshop ($table,$table_tmp)
- {
- $table = _DB_PREFIX_.$table;
- $table_tmp = _DB_PREFIX_.$table_tmp;
- return Db::getInstance()->Execute("
- UPDATE $table dest, $table_tmp src
- SET
- dest.price=src.price,
- dest.wholesale_price=src.wholesale_price,
- dest.date_upd=src.date_upd
- WHERE
- dest.xml=src.xml
- ");
- }
- public static
- function updateproducttablenull ($table,$table_tmp)
- {
- $table = _DB_PREFIX_.$table;
- $table_tmp = _DB_PREFIX_.$table_tmp;
- return Db::getInstance()->Execute("
- UPDATE $table dest, $table_tmp src
- SET
- dest.price=src.price
- WHERE
- dest.xml=src.xml
- ");
- }
- public static
- function updateproducttableatr ($table,$table_tmp)
- {
- $table = _DB_PREFIX_.$table;
- $table_tmp = _DB_PREFIX_.$table_tmp;
- return Db::getInstance()->Execute("
- UPDATE $table dest, $table_tmp src
- SET
- dest.price=src.price,
- dest.wholesale_price=src.wholesale_price,
- dest.quantity=src.quantity
- WHERE
- dest.xml=src.xml
- ");
- }
- public static
- function updateproducttableatrshop ($table,$table_tmp)
- {
- $table = _DB_PREFIX_.$table;
- $table_tmp = _DB_PREFIX_.$table_tmp;
- return Db::getInstance()->Execute("
- UPDATE $table dest, $table_tmp src
- SET
- dest.price=src.price,
- dest.wholesale_price=src.wholesale_price
- WHERE
- dest.xml ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement