- ShopCMS, DataLife Engine, XenForo и другие CMS - помощь и поддержка
- → Просмотр профиля: Сообщения: wwwsasa2
Статистика
- Группа: Download User
- Сообщений: 53
- Просмотров: 2284
- Статус: Продвинутый пользователь
- Возраст: 39 лет
- День рождения: Июль 16, 1984
-
Пол
Мужчина
-
Город
Киев
Мои сообщения
В теме: Помогите исправить ошибку
08 December 2015 - 12:04 PM
Вот этот файл создает запрос к БД. На строке 247 ряд 15 возникает ошибка. Это какая-то товарная позиция, как понять какая?
В теме: Помогите исправить ошибку
07 December 2015 - 11:41 PM
Внутренняя проверка выдает такую ошибку [FATAL ERROR] 2015-12-07 06-34 | file:/home/cempinga/sezonx.com.ua/www/vcene/export/XmlDB.php | ln:36 | msg:mysqli::query() [<a href='mysqli.query'>mysqli.query</a>]: (70100/1317): Query execution was interrupted
В теме: Помогите исправить ошибку
07 December 2015 - 12:23 AM
Нигде это я так понял. Сам файл export.php к чему-то обращается. И это что-то содержит ошибку.Это где я такое писал?Рекомендуете попробовать другой браузер?
Видимо, в export.php.Только где ее искать?
This page contains the following errors:
error on line 247 at column 15: Extra content at the end of the document
Below is a rendering of the page up to the first error.
Вот здесь
Вот его код
require_once dirname(__FILE__) . '/config/config.php';
require_once dirname(__FILE__) . '/export/YandexString.php';
require_once dirname(__FILE__) . '/export/Shop.php';
date_default_timezone_set('Europe/Kiev');
ini_set('error_log', dirname(__FILE__) . '/xml-errors.log');
//ini_set('error_reporting', 'E_ERROR & E_WARNING & E_NOTICE');
register_shutdown_function('handleShutdown');
function handleShutdown()
{
$error = error_get_last();
if($error !== NULL){
$info = '[FATAL ERROR] ' . date('Y-m-d H-i', time())
. ' | file:' . $error['file']
. ' | ln:' . $error['line']
. ' | msg:' . $error['message'] . PHP_EOL;
echo '<pre> [FATAL ERROR] ' . $error['message'] . ': line ' . $error['line'] . ': file ' . $error['file'] . '</pre>';
error_log($info, 3, dirname(__FILE__) . '/xml-errors.log');
}
}
try
{
$shop = new Shop();
$shop->processShopInfo()
->processCurrency()
->processCategories()
->processOffers();
$shop->xml->getXml();
}
catch(Exception $e)
{
$info = '[ERROR] ' . date('Y-m-d H-i', time())
. ' | file:' . $e->getFile()
. ' | ln:' . $e->getLine()
. ' | msg:' . $e->getMessage() . PHP_EOL;
echo '<pre>' . $e->getMessage() . ': line ' . $e->getLine() . ': file ' . $e->getFile() . '</pre>';
error_log($info, 3, dirname(__FILE__) . '/xml-errors.log');
}
И shop.php
<?php
/**
* @category
* @package
* @version $Id$
*/
require_once dirname(__FILE__) . '/XmlDB.php';
class Shop extends XmlDB
{
protected $_mainCurrency;
//Number of main category
protected $_parentIdNumber = 1;
public $categories;
public $currencies;
public $parentCategories;
public $xml;
/**
* Get and set currencies
*
* @return object Shop $_xml;
*/
public function __construct()
{
parent::__construct();
$this->xml = new Xml('./price.xml');
}
/**
* Set shop information
*
* @return object Shop
*/
public function processShopInfo()
{
//do not change sequence of fields
$shopInfo = array(
'name' =>NAME,
'company' =>COMPANY,
'url' =>URL,
'platform' =>PLATFORM,
'version' =>VERSION,
'agency' =>AGENCY,
'email' =>EMAIL
);
foreach($shopInfo as $key=>$node)
{
if(empty($node))
{
unset($shopInfo[$key]);
}
}
$this->xml->textNodesAdd($shopInfo);
return $this;
}
/**
* Get currencies
*
* @return Shop
*/
public function processCurrency()
{
//-----------------------------------------
//if shop have not currency, set it default
//-----------------------------------------
$currencies = array(array('id' => 'UAH', 'rate' => '1'));
$this->_mainCurrency = 'UAH';
//-----------------------------------------
// else
//-----------------------------------------
$currencies = $this->query(
'SELECT `currency_iso_3` `id`, `currency_value` `rate` FROM `yncu_currency_types` WHERE 1', 2);
foreach($currencies as $id => $currency)
{
if(intval($currency['rate']) == 1)
{
$this->_mainCurrency = $currencies[$id]['id'];
}
}
//$currencies must be as array(array('id'=>$idValue, 'rate'=>$rateValue), ...)
$this->xml->textNodesAdd($currencies, 'currencies', 'currency', array('id', 'rate'));
return $this;
}
/**
* Get and set shop categories
*
* @return object Shop
*/
public function processCategories()
{
$categories = $this->query(
'SELECT `categoryID` `id`, `parent` `parentId`, `name`
FROM `yncu_categories`
WHERE `categoryID` > 1 ORDER BY `id` ASC', 2, 'id');
$categories = $this->xml->fixCharSetValues($categories, array('name'));
foreach($categories as $id => $category)
{
if($category['parentId'] == $this->_parentIdNumber)
{
unset($categories[$id]['parentId']);
}
}
$this->categories = $this->xml->fixCharSetValues($categories, array('name'));
//$categories must be as array(array('id'=>$idValue, 'parentId'=>$parentIdValue, 'name'=>$nameValue), ...)
$this->xml->textNodesAdd($categories, 'categories', 'category', array('id', 'parentId'));
return $this;
}
/**
* Get and set shop products
*
* @return object Shop
*/
public function processOffers()
{
$offers = $this->query(
"SELECT
`p`.`productID` `id`,
`p`.`name` `name`,
`p`.`categoryID` `categoryId`,
`p`.`description` `description`,
`p`.`Price` `price`,
`img`.`enlarged` `picture_big`,
`img`.`thumbnail` `picture_small`,
`img`.`filename` `picture_norm`,
`pr`.`option_value` `man1`,
`prv`.`option_value` `man2`
FROM `yncu_products` `p`
LEFT JOIN `yncu_product_options_values` `pr`
ON `pr`.`productID` = `p`.`productID` and `pr`.`optionID` = 1
LEFT JOIN `yncu_products_opt_val_variants` `prv`
ON `prv`.`variantID` = `pr`.`variantID`
LEFT JOIN `yncu_product_pictures` `img`
ON `p`.`productID` = `img`.`productID`
WHERE `p`.`enabled` = 1
AND `p`.`categoryID` > 1
AND `p`.`in_stock` > 0
ORDER BY `p`.`productID` ASC, `img`.`photoID` DESC
", 2, 'id');
$offers = $this->xml->fixCharSetValues($offers, array('description', 'name', 'vendor'));
foreach($offers as $id => $offer)
{
$offers[$id]['url'] = URL . "/product_{$id}.html";
if (isset($offer['picture_big']) && !empty($offer['picture_big']))
{
$offers[$id]['picture'] = IMG_URL . $offer['picture_big'];
}
elseif (isset($offer['picture_norm']) && !empty($offer['picture_norm']))
{
$offers[$id]['picture'] = IMG_URL . $offer['picture_norm'];
}
elseif (isset($offer['picture_small']) && !empty($offer['picture_small']))
{
$offers[$id]['picture'] = IMG_URL . $offer['picture_small'];
}
else
{
$offers[$id]['picture'] = "";
}
unset($offers[$id]['picture_big'], $offers[$id]['picture_norm'], $offers[$id]['picture_small']);
if (isset($offer['man1']) && !empty($offer['man1']))
{
$offers[$id]['vendor'] = $offer['man1'];
}
elseif (isset($offer['man2']) && !empty($offer['man2']))
{
$offers[$id]['vendor'] = $offer['man2'];
}
else
{
$offers[$id]['vendor'] = "";
}
unset($offers[$id]['man1'], $offers[$id]['man2']);
$offers[$id]['currencyId'] = $this->_mainCurrency;
$offers[$id]['name'] = htmlspecialchars(strip_tags(htmlspecialchars_decode($offer['name'])));
$offers[$id]['description'] = htmlspecialchars(strip_tags(htmlspecialchars_decode($offer['description'])));
$offers[$id]['available'] = 'true';
$offers[$id] = $this->_sortYandex($offers[$id]);
}
$this->xml->textNodesAdd($offers, 'offers', 'offer', array('id', 'available'));
$this->xml->close();
return $this;
}
//
private function _sortYandex($offer)
{
$sortOffer = array();
$sortList = array('id', 'available', 'url', 'price', 'currencyId', 'categoryId', 'picture', 'name', 'vendor', 'description');
foreach($sortList as $value)
{
if(isset($offer[$value]))
{
$sortOffer[$value] = $offer[$value];
}
}
return $sortOffer;
}
}
В теме: Помогите исправить ошибку
06 December 2015 - 06:24 PM
Именно так http://sezonx.com.ua/vcene/export.php по этой ссылке формируется прайс. Рекомендуете попробовать другой браузер? Ща попробую
Не помогло. Это гдето не проставило зяпятую и мотает мне нервы. Только где ее искать?
Не помогло. Это гдето не проставило зяпятую и мотает мне нервы. Только где ее искать?
В теме: Штатный модуль оплаты webMoney
17 November 2015 - 05:36 PM
Спасибо большое блок заработал
- ShopCMS, DataLife Engine, XenForo и другие CMS - помощь и поддержка
- → Просмотр профиля: Сообщения: wwwsasa2