* Plugin for overriding Nosto default behavior.
* Depends on the "Personalization for Shopware" plugin by Nosto.
* Extends Shopware_Components_Plugin_Bootstrap.
* @subpackage Plugins_Frontend
class Shopware_Plugins_Frontend_MyNosto_Bootstrap extends Shopware_Components_Plugin_Bootstrap
public function getCapabilities()
public function getLabel()
public function getVersion()
public function getInfo()
'version' => $this->getVersion(),
'label' => $this->getLabel(),
'source' => $this->getSource(),
'copyright' => 'Copyright (c) 2018, Unknown',
'description' => 'Plugin for overriding Nosto default behavior',
'link' => 'http://example.com'
public function install()
$this->registerMyEvents();
public function uninstall()
public function update($version)
* Event listener for `Shopware_Plugins_Frontend_NostoTagging_Components_Model_Customer_AfterLoad`.
* Listener for modifying the Nosto customer information before it is used in
* the shop frontend or the server-to-server API.
* The event arguments will always include:
* - "nostoCustomer" the Shopware_Plugins_Frontend_NostoTagging_Components_Model_Customer
* Modifying the customer object will directly reflect on the data that is
* sent to Nosto. The object has a public API of setter methods to modify
* @param Enlight_Event_EventArgs $args
public function onNostoTaggingComponentsModelCustomerAfterLoad(Enlight_Event_EventArgs $args)
/** @var Shopware_Plugins_Frontend_NostoTagging_Components_Model_Customer $nostoCustomer */
$nostoCustomer = $args->get('nostoCustomer');
if ($nostoCustomer->getEmail()) {
// Do your extra validation here
// $nostoCustomer->setMarketingPermission(true);
return $nostoCustomer->getMarketingPermission();
* Registers events for this plugin.
protected function registerMyEvents()
* Register an event listener for the Nosto Customer object "AfterLoad"
* event. This event is dispatched when the customer object has been
* loaded with data, before it is used in either the frontend or in the
* server-to-server API calls. At this point you can modify it's content
'Shopware_Plugins_Frontend_NostoTagging_Components_Model_Customer_AfterLoad',
'onNostoTaggingComponentsModelCustomerAfterLoad'