Example #1
0
 /**
  * Render shopping cart content as hidden meta data if the module is
  * enabled for the current store.
  *
  * @return string
  */
 protected function _toHtml()
 {
     /** @var Nosto_Tagging_Helper_Account $helper */
     $helper = Mage::helper('nosto_tagging/account');
     if (!Mage::helper('nosto_tagging')->isModuleEnabled() || !$helper->existsAndIsConnected()) {
         return '';
     }
     // If we have items in the cart, then update the Nosto customer quote
     // link. This is done to enable server-to-server order confirmation
     // requests once the quote is turned into an order.
     // We do it here as this will be run on every request when we have a
     // quote. This is important as the Nosto customer ID will change after
     // a period of time while the Mage quote ID can be the same.
     // The ideal place to run it would be once when the customer goes to
     // the `checkout/cart` page, but there are no events that are fired on
     // that page only, and the cart page recommendation elements we output
     // come through a generic block that cannot be used for this specific
     // action.
     if (count($this->getItems()) > 0) {
         /** @var Nosto_Tagging_Helper_Customer $customerHelper */
         $customerHelper = Mage::helper('nosto_tagging/customer');
         $customerHelper->updateNostoId();
     }
     return parent::_toHtml();
 }
Example #2
0
 /**
  * Render block HTML
  *
  * @return string
  */
 protected function _toHtml()
 {
     $html = '';
     if ((bool) Mage::app()->getStore()->getConfig('checkout/sidebar/display')) {
         $html = parent::_toHtml();
     }
     return $html;
 }