本文整理汇总了PHP中Mage::GetSingleton方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage::GetSingleton方法的具体用法?PHP Mage::GetSingleton怎么用?PHP Mage::GetSingleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage
的用法示例。
在下文中一共展示了Mage::GetSingleton方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCheckoutUrl
/**
* Return url for checkout
*
* @return url
*/
public function getCheckoutUrl()
{
$mageSessHandler = Mage::GetSingleton('vbw_punchout/session');
if ($mageSessHandler->getPunchoutId()) {
return $this->_getUrl('checkout/punchout');
// , array('_secure'=>true));
} else {
return parent::getCheckoutUrl();
}
}
示例2: addCheckoutLink
/**
* Add link on checkout page to parent block
*
* @return Mage_Checkout_Block_Links
*/
public function addCheckoutLink()
{
$poSession = Mage::GetSingleton("vbw_punchout/session");
// $poSession->reviewSession();
if ($parentBlock = $this->getParentBlock()) {
$label = Mage::helper('vbw_punchout/config')->getConfig('display/checkout_nav_button');
$text = $this->__(!empty($label) ? $label : 'Punchout');
$parentBlock->addLink($text, 'checkout/cart', $text, true, array('_secure' => true), 60, null, 'class="top-link-checkout"');
}
return $this;
}
示例3: exitAction
/**
* exit the session.
*
*/
public function exitAction()
{
$response = $this->getResponse();
if ($response->isRedirect()) {
return true;
}
/**
* @var $session Vbw_Punchout_Model_Session
*/
$helper = Mage::helper('vbw_punchout/config');
if (Mage::getSingleton('vbw_punchout/session')->isPunchoutSession()) {
$session = Mage::GetSingleton("vbw_punchout/session");
$punchoutOrder = $session->getPunchoutOrder();
$url = $helper->getConfig('display/return_url');
if (empty($url)) {
$session = Mage::GetSingleton("vbw_punchout/session");
$url = $session->getRemoteHost() . "/gateway/link/return/id/" . $session->getPunchoutId() . "/?redirect=1";
//$url = Mage::getSingleton('vbw_punchout/session')->getPunchoutRequest()->getBody()->getPostForm();
}
$target = $helper->getConfig('display/return_target');
$string = '<form action="' . $url . '" method=GET name="punchoutSend" id="punchoutSend" target="' . $target . '">';
$string .= '</form>';
$html = "<html>\n";
$html .= "<head><title>Closing your punchout session...</title></head>\n";
$html .= "<body onload=\"self.document.forms[0].submit()\">\n";
$html .= $string;
//$html .= "<script>self.document.forms[0].submit()</script>";
$html .= "</body>\n";
$html .= "</html>";
$this->getResponse()->setBody($html);
}
}