public function __construct() { $this->filename = 'log_commerceml.txt'; list($this->path, $url_commerceml, $url_images) = RusEximCommerceml::getDirCommerceML(); if (!is_dir($this->path)) { fn_mkdir($this->path); @chmod($this->path, 0777); } $file_is_new = !file_exists($this->path . $this->filename); $this->file = fopen($this->path . $this->filename, 'ab'); if ($file_is_new) { fwrite($this->file, 'Message: ' . PHP_EOL); @chmod($this->file, 0777); } }
$prices = array(); $list_price_1c = $base_price_1c = ''; foreach ($prices_data as $price) { if ($price['type'] == 'base') { $base_price_1c .= $price['price_1c'] . ','; } elseif ($price['type'] == 'list') { $list_price_1c .= $price['price_1c'] . ','; } else { $prices[] = $price; } } Tygh::$app['view']->assign('list_price_1c', trim($list_price_1c, ',')); Tygh::$app['view']->assign('base_price_1c', trim($base_price_1c, ',')); Tygh::$app['view']->assign('prices_data', $prices); if ($s_commerceml['exim_1c_check_prices'] == 'Y') { list($path_commerceml, $url_commerceml, $url_images) = RusEximCommerceml::getDirCommerceML(); $result = array(); $file_offers = glob($path_commerceml . "offers*"); if (!empty($file_offers)) { $filename = fn_basename(reset($file_offers)); $xml = RusEximCommerceml::getFileCommerceml($filename); if (isset($xml->{$cml}['packages']->{$cml}['offers']->{$cml}['offer'])) { $result = RusEximCommerceml::checkPricesOffers($xml->{$cml}['packages']); } } else { fn_set_notification('W', __('warning'), __('offers_not_found')); } Tygh::$app['view']->assign('resul_test', $result); } } if ($s_commerceml['exim_1c_add_tax'] == 'Y') {