Jump to content

Fix to catalog price rules mixed-up in multi-shop mode


Recommended Posts

Hi,

 

When working on a multi-shop environment all the existent catalog price rules appear on the backoffice list notwhistanding the operator permissions or the shop selected, so one operator with permissions only for shop "A" can see, change and delete rules for shops "B", "C", etc.

 

This problem has bugged me a lot and I've made this little code to fix it.

 

In override/controllers/admin/AdminSpecificPriceRuleController.php I add this function:

	public function init()
	{
		parent::init();
		if (Shop::getContext() == Shop::CONTEXT_SHOP) {		// Hay seleccionada una tienda
			$this->_where = 'AND s.id_shop = ' .(int)$this->context->shop->id;
		}
	}
 

And that's all. Dont forget to delete cache/class_index.php before testing it if you're using 1.5.6.0 or so.

 

Hope it helps somebody.

 

Greetings from Spain.

Juan María.

Edited by Juanmaria (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...