Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Checkout_Block_Agreements
  • Mage_Checkout_Block_Cart
  • Mage_Checkout_Block_Cart_Abstract
  • Mage_Checkout_Block_Cart_Coupon
  • Mage_Checkout_Block_Cart_Crosssell
  • Mage_Checkout_Block_Cart_Item_Configure
  • Mage_Checkout_Block_Cart_Item_Renderer
  • Mage_Checkout_Block_Cart_Item_Renderer_Configurable
  • Mage_Checkout_Block_Cart_Item_Renderer_Grouped
  • Mage_Checkout_Block_Cart_Shipping
  • Mage_Checkout_Block_Cart_Sidebar
  • Mage_Checkout_Block_Cart_Totals
  • Mage_Checkout_Block_Links
  • Mage_Checkout_Block_Multishipping_Abstract
  • Mage_Checkout_Block_Multishipping_Address_Select
  • Mage_Checkout_Block_Multishipping_Addresses
  • Mage_Checkout_Block_Multishipping_Billing
  • Mage_Checkout_Block_Multishipping_Billing_Items
  • Mage_Checkout_Block_Multishipping_Link
  • Mage_Checkout_Block_Multishipping_Overview
  • Mage_Checkout_Block_Multishipping_Payment_Info
  • Mage_Checkout_Block_Multishipping_Shipping
  • Mage_Checkout_Block_Multishipping_State
  • Mage_Checkout_Block_Multishipping_Success
  • Mage_Checkout_Block_Onepage
  • Mage_Checkout_Block_Onepage_Abstract
  • Mage_Checkout_Block_Onepage_Billing
  • Mage_Checkout_Block_Onepage_Failure
  • Mage_Checkout_Block_Onepage_Link
  • Mage_Checkout_Block_Onepage_Login
  • Mage_Checkout_Block_Onepage_Payment
  • Mage_Checkout_Block_Onepage_Payment_Info
  • Mage_Checkout_Block_Onepage_Payment_Methods
  • Mage_Checkout_Block_Onepage_Progress
  • Mage_Checkout_Block_Onepage_Review
  • Mage_Checkout_Block_Onepage_Review_Info
  • Mage_Checkout_Block_Onepage_Shipping
  • Mage_Checkout_Block_Onepage_Shipping_Method
  • Mage_Checkout_Block_Onepage_Shipping_Method_Additional
  • Mage_Checkout_Block_Onepage_Shipping_Method_Available
  • Mage_Checkout_Block_Onepage_Success
  • Mage_Checkout_Block_Success
  • Mage_Checkout_Block_Total_Default
  • Mage_Checkout_Block_Total_Nominal
  • Mage_Checkout_Block_Total_Tax
  • Mage_Checkout_CartController
  • Mage_Checkout_Controller_Action
  • Mage_Checkout_Exception
  • Mage_Checkout_Helper_Cart
  • Mage_Checkout_Helper_Data
  • Mage_Checkout_Helper_Url
  • Mage_Checkout_IndexController
  • Mage_Checkout_Model_Agreement
  • Mage_Checkout_Model_Api_Resource
  • Mage_Checkout_Model_Api_Resource_Customer
  • Mage_Checkout_Model_Api_Resource_Product
  • Mage_Checkout_Model_Cart
  • Mage_Checkout_Model_Cart_Api
  • Mage_Checkout_Model_Cart_Api_V2
  • Mage_Checkout_Model_Cart_Coupon_Api
  • Mage_Checkout_Model_Cart_Coupon_Api_V2
  • Mage_Checkout_Model_Cart_Customer_Api
  • Mage_Checkout_Model_Cart_Customer_Api_V2
  • Mage_Checkout_Model_Cart_Payment_Api
  • Mage_Checkout_Model_Cart_Payment_Api_V2
  • Mage_Checkout_Model_Cart_Product_Api
  • Mage_Checkout_Model_Cart_Product_Api_V2
  • Mage_Checkout_Model_Cart_Shipping_Api
  • Mage_Checkout_Model_Cart_Shipping_Api_V2
  • Mage_Checkout_Model_Config_Source_Cart_Summary
  • Mage_Checkout_Model_Mysql4_Agreement
  • Mage_Checkout_Model_Mysql4_Agreement_Collection
  • Mage_Checkout_Model_Mysql4_Cart
  • Mage_Checkout_Model_Mysql4_Setup
  • Mage_Checkout_Model_Observer
  • Mage_Checkout_Model_Resource_Agreement
  • Mage_Checkout_Model_Resource_Agreement_Collection
  • Mage_Checkout_Model_Resource_Cart
  • Mage_Checkout_Model_Resource_Setup
  • Mage_Checkout_Model_Session
  • Mage_Checkout_Model_Type_Abstract
  • Mage_Checkout_Model_Type_Multishipping
  • Mage_Checkout_Model_Type_Multishipping_State
  • Mage_Checkout_Model_Type_Onepage
  • Mage_Checkout_Multishipping_AddressController
  • Mage_Checkout_MultishippingController
  • Mage_Checkout_OnepageController

Interfaces

  • Mage_Checkout_Model_Cart_Interface
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Checkout
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: /**
 28:  * One page checkout success page
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_Checkout
 32:  * @author      Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Checkout_Block_Onepage_Success extends Mage_Core_Block_Template
 35: {
 36:     /**
 37:      * @deprecated after 1.4.0.1
 38:      */
 39:     private $_order;
 40: 
 41:     /**
 42:      * Retrieve identifier of created order
 43:      *
 44:      * @return string
 45:      * @deprecated after 1.4.0.1
 46:      */
 47:     public function getOrderId()
 48:     {
 49:         return $this->_getData('order_id');
 50:     }
 51: 
 52:     /**
 53:      * Check order print availability
 54:      *
 55:      * @return bool
 56:      * @deprecated after 1.4.0.1
 57:      */
 58:     public function canPrint()
 59:     {
 60:         return $this->_getData('can_view_order');
 61:     }
 62: 
 63:     /**
 64:      * Get url for order detale print
 65:      *
 66:      * @return string
 67:      * @deprecated after 1.4.0.1
 68:      */
 69:     public function getPrintUrl()
 70:     {
 71:         return $this->_getData('print_url');
 72:     }
 73: 
 74:     /**
 75:      * Get url for view order details
 76:      *
 77:      * @return string
 78:      * @deprecated after 1.4.0.1
 79:      */
 80:     public function getViewOrderUrl()
 81:     {
 82:         return $this->_getData('view_order_id');
 83:     }
 84: 
 85:     /**
 86:      * See if the order has state, visible on frontend
 87:      *
 88:      * @return bool
 89:      */
 90:     public function isOrderVisible()
 91:     {
 92:         return (bool)$this->_getData('is_order_visible');
 93:     }
 94: 
 95:     /**
 96:      * Getter for recurring profile view page
 97:      *
 98:      * @param $profile
 99:      */
100:     public function getProfileUrl(Varien_Object $profile)
101:     {
102:         return $this->getUrl('sales/recurring_profile/view', array('profile' => $profile->getId()));
103:     }
104: 
105:     /**
106:      * Initialize data and prepare it for output
107:      */
108:     protected function _beforeToHtml()
109:     {
110:         $this->_prepareLastOrder();
111:         $this->_prepareLastBillingAgreement();
112:         $this->_prepareLastRecurringProfiles();
113:         return parent::_beforeToHtml();
114:     }
115: 
116:     /**
117:      * Get last order ID from session, fetch it and check whether it can be viewed, printed etc
118:      */
119:     protected function _prepareLastOrder()
120:     {
121:         $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
122:         if ($orderId) {
123:             $order = Mage::getModel('sales/order')->load($orderId);
124:             if ($order->getId()) {
125:                 $isVisible = !in_array($order->getState(),
126:                     Mage::getSingleton('sales/order_config')->getInvisibleOnFrontStates());
127:                 $this->addData(array(
128:                     'is_order_visible' => $isVisible,
129:                     'view_order_id' => $this->getUrl('sales/order/view/', array('order_id' => $orderId)),
130:                     'print_url' => $this->getUrl('sales/order/print', array('order_id'=> $orderId)),
131:                     'can_print_order' => $isVisible,
132:                     'can_view_order'  => Mage::getSingleton('customer/session')->isLoggedIn() && $isVisible,
133:                     'order_id'  => $order->getIncrementId(),
134:                 ));
135:             }
136:         }
137:     }
138: 
139:     /**
140:      * Prepare billing agreement data from an identifier in the session
141:      */
142:     protected function _prepareLastBillingAgreement()
143:     {
144:         $agreementId = Mage::getSingleton('checkout/session')->getLastBillingAgreementId();
145:         $customerId = Mage::getSingleton('customer/session')->getCustomerId();
146:         if ($agreementId && $customerId) {
147:             $agreement = Mage::getModel('sales/billing_agreement')->load($agreementId);
148:             if ($agreement->getId() && $customerId == $agreement->getCustomerId()) {
149:                 $this->addData(array(
150:                     'agreement_ref_id' => $agreement->getReferenceId(),
151:                     'agreement_url' => $this->getUrl('sales/billing_agreement/view',
152:                         array('agreement' => $agreementId)
153:                     ),
154:                 ));
155:             }
156:         }
157:     }
158: 
159:     /**
160:      * Prepare recurring payment profiles from the session
161:      */
162:     protected function _prepareLastRecurringProfiles()
163:     {
164:         $profileIds = Mage::getSingleton('checkout/session')->getLastRecurringProfileIds();
165:         if ($profileIds && is_array($profileIds)) {
166:             $collection = Mage::getModel('sales/recurring_profile')->getCollection()
167:                 ->addFieldToFilter('profile_id', array('in' => $profileIds))
168:             ;
169:             $profiles = array();
170:             foreach ($collection as $profile) {
171:                 $profiles[] = $profile;
172:             }
173:             if ($profiles) {
174:                 $this->setRecurringProfiles($profiles);
175:                 if (Mage::getSingleton('customer/session')->isLoggedIn()) {
176:                     $this->setCanViewProfiles(true);
177:                 }
178:             }
179:         }
180:     }
181: }
182: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0