LemonStand Documentation

shop:onConfigureProductsController event

The shop:onConfigureProductsController event allows to load extra CSS or JavaScript files on the Product List, Product Preview, Create/Edit Product and other pages related to a product. The event handler should accept a single parameter - the controller object reference. Call addJavaScript() and addCss() methods of the controller object to add references to JavaScript and CSS files. Use paths relative to LemonStand installation URL for your resource files.

Event handler example: 

public function subscribeEvents()
{
	Backend::$events->addEvent('shop:onConfigureProductsController', $this, 'load_resources');
}
 
public function load_resources($controller)
{
	$controller->addJavaScript('/modules/mymodule/resources/javascript/my.js');
	$controller->addCss('/modules/mymodule/resources/css/my.css');
}

Next: cms:onAfterHandleAjax event
Previous: shop:onOrderStockChange event
Return to Handling LemonStand events