Example #1
0
 /**
  * Retrieve Item Store for URL
  *
  * @param Mage_Catalog_Model_Product|Mage_Wishlist_Model_Item $item
  * @return Mage_Core_Model_Store
  */
 protected function _getUrlStore($item)
 {
     $storeId = null;
     if ($item instanceof Mage_Catalog_Model_Product) {
         if ($item->isVisibleInSiteVisibility()) {
             $storeId = $item->getStoreId();
         } else {
             if ($item->hasUrlDataObject()) {
                 $storeId = $item->getUrlDataObject()->getStoreId();
             }
         }
     }
     return Mage::app()->getStore($storeId);
 }
Example #2
0
 /**
  * @param Mage_Wishlist_Model_Item $item
  * @param int                      $index
  *
  * @return Bronto_Common_Model_Email_Template_Filter
  */
 protected function _filterWishlistItem(Mage_Wishlist_Model_Item $item, $index = null)
 {
     if ($item->getParentItem()) {
         return $this;
     }
     $this->setStoreId($item->getStoreId());
     $this->setField("productName_{$index}", $item->getName());
     $this->setField("productPrice_{$index}", $this->formatPrice($item->getPrice()));
     $this->setField("productQty_{$index}", $item->getQty());
     $this->setField("productUrl_{$index}", $this->_getWishlistItemUrl($item));
     /* @var $product Mage_Catalog_Model_Product */
     $product = $item->getProduct();
     if (!$product) {
         $product = Mage::helper('bronto_common/product')->getProduct($item->getProductId(), $this->getStoreId() ? $this->getStoreId() : false);
     }
     $this->setField("productSku_{$index}", $product->getSku());
     $this->_filterProduct($product, $index);
     return $this;
 }