This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
koding:hostcms:shop:otkljuchenie_indeksacii_modifikacij [06.05.15 в 18:35] Артем Куц создано |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <?php | ||
- | <code>/* | ||
- | * @author KAD artem.kuts@gmail.com | ||
- | * Отключение индексации модификаций | ||
- | |||
- | * В bootstrap.php | ||
- | // KAD:Предотвращение поиска модификаций | ||
- | Core_Event::attach('shop_item.onBeforeSave', array('Kad_Shop_Observers_Modnoindex', 'onBeforeSave')); | ||
- | |||
- | * Запрос на отключение модификаций | ||
- | update shop_items set indexing = 0 where modification_id != 0 and shop_id = 3 | ||
- | |||
- | * | ||
- | * Копирование и использование файлов модуля | ||
- | * в коммерческих целях ЗАПРЕЩЕНО | ||
- | * | ||
- | */ | ||
- | |||
- | defined('HOSTCMS') || exit('HostCMS: access denied.'); | ||
- | |||
- | class Kad_Shop_Observers_Modnoindex | ||
- | { | ||
- | static public function onBeforeSave($object, $args) | ||
- | { | ||
- | if ($object->modification_id != 0) | ||
- | { | ||
- | // Запрет индексации | ||
- | $object->indexing = 0; | ||
- | } | ||
- | } | ||
- | }</code> |