This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
koding:hostcms:shop:otkljuchenie_indeksacii_modifikacij [06.05.15 в 19:04] Артем Куц |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <code><?php | ||
- | /* | ||
- | * @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> |