User Tools

Site Tools


koding:hostcms:shop:otkljuchenie_indeksacii_modifikacij

This is an old revision of the document!


<?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;
		}
	}
}
koding/hostcms/shop/otkljuchenie_indeksacii_modifikacij.1430928261.txt.gz · Last modified: 26.06.15 в 15:07 (external edit)