This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$defaultLocation = Core_Entity::factory('shop_country_location', 2); // Санкт-Петербург и область | |
$defaultCity = Core_Entity::factory('shop_country_location_city', 173); // Санкт-Петербург | |
$oShopCountry = Core_Entity::factory('shop_country', $oShop->shop_country_id); | |
if ($oShopCountry) | |
{ | |
$aoShopCountryLocations = $oShopCountry | |
->Shop_Country_Locations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mysql -u *username* -p *dbname* < *file* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Максимум: | |
/foo/bar/@score[not(. < ../../bar/@score)][1] | |
Минимум: | |
/foo/bar/@score[not(. > ../../bar/@score)][1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* В bootstrap.php: | |
* | |
// Запрет индексации модификаций и товаров, которых нет в наличии | |
Core_Event::attach('shop_item.onAfterSave', array('Shop_Item_Observers_Setindexing', 'onAfterSave')); | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* В bootstrap.php: | |
* | |
// Скрываем товары, которых нет в наличии на текущем складе | |
Core_Event::attach('Shop_Controller_Show.onBeforeRedeclaredShow', array('Shop_Item_Observers_Hidenotavailableitems', 'onBeforeRedeclaredShow')); | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* В bootstrap.php: | |
* | |
// KAD: Скрываем модификации, которых нет в наличии на текущем складе | |
Core_Event::attach('shop_item.onBeforeShowXmlModifications', array('Shop_Item_Observers_Hidenotavailablemods', 'onBeforeShowXmlModifications')); | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* В bootstrap.php: | |
* | |
// Подменяем цену товара в зависимости от текущего склада | |
Core_Event::attach('Shop_Item_Controller.onBeforeCalculatePrice', array('Shop_Item_Observers_Regionprices', 'onBeforeCalculatePrice')); | |
Core_Event::attach('Shop_Item_Controller.onBeforeCalculatePriceInItemCurrency', array('Shop_Item_Observers_Regionprices', 'onBeforeCalculatePrice')); | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* В bootstrap.php: | |
* | |
// Заполнение числового свойства на основе списочного свойства «Площадь освещения» | |
Core_Event::attach('shop_item.onAfterSave', array('Shop_Item_Observers_Updateulluminationarea', 'onAfterSave')); | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* В bootstrap.php: | |
// Установка значения свойства «Товары» равным названию группы товара | |
Core_Event::attach('shop_item.onAfterSave', array('Shop_Item_Observers_Updateshopitemtype', 'onAfterSave')); | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Передаем токен на сервер для запуска скрипта авторизации | |
$.ajax({ | |
method: 'POST', | |
url: '/ulogin/', | |
data: $.param({ | |
ajax: 1, | |
token: token | |
}), | |
success: function() { | |
// Обновляем страницу |