Mage_Downloadable_Block_Catalog_Product_Links Class Reference

Inheritance diagram for Mage_Downloadable_Block_Catalog_Product_Links:

Mage_Catalog_Block_Product_Abstract Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getLinksPurchasedSeparately ()
 getLinkSelectionRequired ()
 hasLinks ()
 getLinks ()
 getFormattedLinkPrice ($link)
 getJsonConfig ()
 getLinkSamlpeUrl ($link)
 getLinksTitle ()
 getIsOpenInNewWindow ()


Detailed Description

Definition at line 34 of file Links.php.


Member Function Documentation

getFormattedLinkPrice ( link  ) 

Enter description here...

Parameters:
Mage_Downloadable_Model_Link $link
Returns:
string

Definition at line 85 of file Links.php.

00086     {
00087         $price = $link->getPrice();
00088 
00089         if (0 == $price) {
00090             return '';
00091         }
00092 
00093         $_priceInclTax = Mage::helper('tax')->getPrice($link->getProduct(), $price, true);
00094         $_priceExclTax = Mage::helper('tax')->getPrice($link->getProduct(), $price);
00095 
00096         $priceStr = '<span class="price-notice">+';
00097         if (Mage::helper('tax')->displayPriceIncludingTax()) {
00098             $priceStr .= $this->helper('core')->currency($_priceInclTax, true, true);
00099         } elseif (Mage::helper('tax')->displayPriceExcludingTax()) {
00100             $priceStr .= $this->helper('core')->currency($_priceExclTax, true, true);
00101         } elseif (Mage::helper('tax')->displayBothPrices()) {
00102             $priceStr .= $this->helper('core')->currency($_priceExclTax, true, true);
00103             if ($_priceInclTax != $_priceExclTax) {
00104                 $priceStr .= ' (+'.$this->helper('core')
00105                     ->currency($_priceInclTax, true, true).' '.$this->__('Incl. Tax').')';
00106             }
00107         }
00108         $priceStr .= '</span>';
00109 
00110         return $priceStr;
00111     }

getIsOpenInNewWindow (  ) 

Return true if target of link new window

Returns:
bool

Definition at line 152 of file Links.php.

getJsonConfig (  ) 

Enter description here...

Returns:
string

Definition at line 118 of file Links.php.

00119     {
00120         $config = array();
00121 
00122         foreach ($this->getLinks() as $link) {
00123             $config[$link->getId()] = Mage::helper('core')->currency($link->getPrice(), false, false);
00124         }
00125 
00126         return Zend_Json::encode($config);
00127     }

getLinks (  ) 

Enter description here...

Returns:
array

Definition at line 73 of file Links.php.

00074     {
00075         return $this->getProduct()->getTypeInstance(true)
00076             ->getLinks($this->getProduct());
00077     }

getLinkSamlpeUrl ( link  ) 

Definition at line 129 of file Links.php.

00130     {
00131         return $this->getUrl('downloadable/download/linkSample', array('link_id' => $link->getId()));
00132     }

getLinkSelectionRequired (  ) 

Enter description here...

Returns:
boolean

Definition at line 51 of file Links.php.

00052     {
00053         return $this->getProduct()->getTypeInstance(true)
00054             ->getLinkSelectionRequired($this->getProduct());
00055     }

getLinksPurchasedSeparately (  ) 

Enter description here...

Returns:
boolean

Definition at line 41 of file Links.php.

00042     {
00043         return $this->getProduct()->getLinksPurchasedSeparately();
00044     }

getLinksTitle (  ) 

Return title of links section

Returns:
string

Definition at line 139 of file Links.php.

00140     {
00141         if ($this->getProduct()->getLinksTitle()) {
00142             return $this->getProduct()->getLinksTitle();
00143         }
00144         return Mage::getStoreConfig(Mage_Downloadable_Model_Link::XML_PATH_LINKS_TITLE);
00145     }

hasLinks (  ) 

Enter description here...

Returns:
boolean

Definition at line 62 of file Links.php.

00063     {
00064         return $this->getProduct()->getTypeInstance(true)
00065             ->hasLinks($this->getProduct());
00066     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:07 2009 for Magento by  doxygen 1.5.8