Mage_GoogleCheckout_Block_Link Class Reference

Inheritance diagram for Mage_GoogleCheckout_Block_Link:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getImageStyle ()
 getImageUrl ()
 getCheckoutUrl ()
 getIsActiveAanalytics ()
 getImageWidth ()
 getImageHeight ()
 _toHtml ()
 getIsDisabled ()


Detailed Description

Definition at line 34 of file Link.php.


Member Function Documentation

_toHtml (  ) 

Render block HTML

Returns:
string

Reimplemented from Mage_Core_Block_Template.

Definition at line 78 of file Link.php.

00079     {
00080         if (!Mage::getSingleton('checkout/session')->getQuote()->validateMinimumAmount()) {
00081             return '';
00082         }
00083         if (Mage::getStoreConfigFlag('google/checkout/active')) {
00084             return parent::_toHtml();
00085         }
00086 
00087         return '';
00088     }

getCheckoutUrl (  ) 

Definition at line 56 of file Link.php.

00057     {
00058         return $this->getUrl('googlecheckout/redirect/checkout');
00059     }

getImageHeight (  ) 

Definition at line 72 of file Link.php.

00073     {
00074          $v = $this->getImageStyle();
00075          return $v[1];
00076     }

getImageStyle (  ) 

Definition at line 36 of file Link.php.

00037     {
00038         $s = Mage::getStoreConfig('google/checkout/checkout_image');
00039         if (!$s) {
00040             $s = '180/46/trans';
00041         }
00042         return explode('/', $s);
00043     }

getImageUrl (  ) 

Definition at line 45 of file Link.php.

00046     {
00047         $url = 'https://checkout.google.com/buttons/checkout.gif';
00048         $url .= '?merchant_id='.Mage::getStoreConfig('google/checkout/merchant_id');
00049         $v = $this->getImageStyle();
00050         $url .= '&w='.$v[0].'&h='.$v[1].'&style='.$v[2];
00051         $url .= '&variant='.($this->getIsDisabled() ? 'disabled' : 'text');
00052         $url .= '&loc='.Mage::getStoreConfig('google/checkout/locale');
00053         return $url;
00054     }

getImageWidth (  ) 

Definition at line 66 of file Link.php.

00067     {
00068          $v = $this->getImageStyle();
00069          return $v[0];
00070     }

getIsActiveAanalytics (  ) 

Definition at line 61 of file Link.php.

00062     {
00063         return Mage::getStoreConfig('google/analytics/active');
00064     }

getIsDisabled (  ) 

Definition at line 90 of file Link.php.

00091     {
00092         $quote = Mage::getSingleton('checkout/session')->getQuote();
00093         /* @var $quote Mage_Sales_Model_Quote */
00094         foreach ($quote->getAllVisibleItems() as $item) {
00095             /* @var $item Mage_Sales_Model_Quote_Item */
00096             if (!$item->getProduct()->getEnableGooglecheckout()) {
00097                 return true;
00098             }
00099         }
00100         return false;
00101     }


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

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