Public Member Functions | |
getProductUrl ($product) | |
getPrice ($product) | |
getFinalPrice ($product) | |
getImageUrl ($product) | |
getSmallImageUrl ($product) | |
getThumbnailUrl ($product) | |
getEmailToFriendUrl ($product) | |
getStatuses () | |
canShow ($product, $where= 'catalog') | |
getProductUrlSuffix ($storeId=null) | |
Public Attributes | |
const | XML_PATH_PRODUCT_URL_SUFFIX = 'catalog/seo/product_url_suffix' |
Protected Attributes | |
$_productUrlSuffix = array() | |
$_statuses | |
$_priceBlock |
Definition at line 32 of file Product.php.
canShow | ( | $ | product, | |
$ | where = 'catalog' | |||
) |
Check if a product can be shown
Mage_Catalog_Model_Product|int | $product |
Definition at line 157 of file Product.php.
00158 { 00159 if (is_int($product)) { 00160 $product = Mage::getModel('catalog/product')->load($product); 00161 } 00162 00163 /* @var $product Mage_Catalog_Model_Product */ 00164 00165 if (!$product->getId()) { 00166 return false; 00167 } 00168 00169 return $product->isVisibleInCatalog() && $product->isVisibleInSiteVisibility(); 00170 }
getEmailToFriendUrl | ( | $ | product | ) |
Definition at line 130 of file Product.php.
00131 { 00132 $categoryId = null; 00133 if ($category = Mage::registry('current_category')) { 00134 $categoryId = $category->getId(); 00135 } 00136 return $this->_getUrl('sendfriend/product/send', array( 00137 'id' => $product->getId(), 00138 'cat_id' => $categoryId 00139 )); 00140 }
getFinalPrice | ( | $ | product | ) |
Retrieve product final price
Mage_Catalog_Model_Product | $product |
Definition at line 81 of file Product.php.
getImageUrl | ( | $ | product | ) |
Retrieve base image url
Definition at line 91 of file Product.php.
00092 { 00093 $url = false; 00094 if (!$product->getImage()) { 00095 $url = Mage::getDesign()->getSkinUrl('images/no_image.jpg'); 00096 } 00097 elseif ($attribute = $product->getResource()->getAttribute('image')) { 00098 $url = $attribute->getFrontend()->getUrl($product); 00099 } 00100 return $url; 00101 }
getPrice | ( | $ | product | ) |
Retrieve product price
Mage_Catalog_Model_Product | $product |
Definition at line 70 of file Product.php.
getProductUrl | ( | $ | product | ) |
Retrieve product view page url
mixed | $product |
Definition at line 53 of file Product.php.
00054 { 00055 if ($product instanceof Mage_Catalog_Model_Product) { 00056 return $product->getProductUrl(); 00057 } 00058 elseif (is_numeric($product)) { 00059 return Mage::getModel('catalog/product')->load($product)->getProductUrl(); 00060 } 00061 return false; 00062 }
getProductUrlSuffix | ( | $ | storeId = null |
) |
Retrieve product rewrite sufix for store
int | $storeId |
Definition at line 178 of file Product.php.
00179 { 00180 if (is_null($storeId)) { 00181 $storeId = Mage::app()->getStore()->getId(); 00182 } 00183 00184 if (!isset($this->_productUrlSuffix[$storeId])) { 00185 $this->_productUrlSuffix[$storeId] = Mage::getStoreConfig(self::XML_PATH_PRODUCT_URL_SUFFIX, $storeId); 00186 } 00187 return $this->_productUrlSuffix[$storeId]; 00188 }
getSmallImageUrl | ( | $ | product | ) |
Retrieve small image url
Definition at line 108 of file Product.php.
00109 { 00110 $url = false; 00111 if (!$product->getSmallImage()) { 00112 $url = Mage::getDesign()->getSkinUrl('images/no_image.jpg'); 00113 } 00114 elseif ($attribute = $product->getResource()->getAttribute('small_image')) { 00115 $url = $attribute->getFrontend()->getUrl($product); 00116 } 00117 return $url; 00118 }
getStatuses | ( | ) |
Definition at line 142 of file Product.php.
00143 { 00144 if(is_null($this->_statuses)) { 00145 $this->_statuses = array();//Mage::getModel('catalog/product_status')->getResourceCollection()->load(); 00146 } 00147 00148 return $this->_statuses; 00149 }
getThumbnailUrl | ( | $ | product | ) |
$_priceBlock [protected] |
Definition at line 45 of file Product.php.
$_productUrlSuffix = array() [protected] |
Definition at line 41 of file Product.php.
$_statuses [protected] |
Definition at line 43 of file Product.php.
const XML_PATH_PRODUCT_URL_SUFFIX = 'catalog/seo/product_url_suffix' |
Definition at line 34 of file Product.php.