private:koding:hostcms:modules:shop:elements:otkljuchenie_indeksacii_modifikacij

Отключение индексации модификаций

<?php
 
/*
* @author Kuts Artem, KAD Systems (©)
* Отключение индексации модификаций 
 
* В 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;
		}
	}
}
private/koding/hostcms/modules/shop/elements/otkljuchenie_indeksacii_modifikacij.txt · Last modified: 27.06.17 в 15:48 by maximzasorin_gmail.com