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_Paypal_Adminhtml_Paypal_ReportsController
  • Mage_Paypal_Block_Adminhtml_Settlement_Details
  • Mage_Paypal_Block_Adminhtml_Settlement_Details_Form
  • Mage_Paypal_Block_Adminhtml_Settlement_Report
  • Mage_Paypal_Block_Adminhtml_Settlement_Report_Grid
  • Mage_Paypal_Block_Adminhtml_System_Config_ApiWizard
  • Mage_Paypal_Block_Adminhtml_System_Config_Field_Country
  • Mage_Paypal_Block_Adminhtml_System_Config_Field_Hidden
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Expanded
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Group
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Hint
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Location
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Payment
  • Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Store
  • Mage_Paypal_Block_Adminhtml_System_Config_Payflowlink_Advanced
  • Mage_Paypal_Block_Adminhtml_System_Config_Payflowlink_Info
  • Mage_Paypal_Block_Express_Form
  • Mage_Paypal_Block_Express_Review
  • Mage_Paypal_Block_Express_Review_Billing
  • Mage_Paypal_Block_Express_Review_Details
  • Mage_Paypal_Block_Express_Review_Shipping
  • Mage_Paypal_Block_Express_Shortcut
  • Mage_Paypal_Block_Hosted_Pro_Form
  • Mage_Paypal_Block_Hosted_Pro_Iframe
  • Mage_Paypal_Block_Hosted_Pro_Info
  • Mage_Paypal_Block_Iframe
  • Mage_Paypal_Block_Logo
  • Mage_Paypal_Block_Payflow_Advanced_Form
  • Mage_Paypal_Block_Payflow_Advanced_Iframe
  • Mage_Paypal_Block_Payflow_Advanced_Info
  • Mage_Paypal_Block_Payflow_Link_Form
  • Mage_Paypal_Block_Payflow_Link_Iframe
  • Mage_Paypal_Block_Payflow_Link_Info
  • Mage_Paypal_Block_Payment_Info
  • Mage_Paypal_Block_Standard_Form
  • Mage_Paypal_Block_Standard_Redirect
  • Mage_Paypal_Controller_Express_Abstract
  • Mage_Paypal_ExpressController
  • Mage_Paypal_Helper_Data
  • Mage_Paypal_Helper_Hss
  • Mage_Paypal_HostedproController
  • Mage_Paypal_IpnController
  • Mage_Paypal_Model_Api_Abstract
  • Mage_Paypal_Model_Api_Nvp
  • Mage_Paypal_Model_Api_Standard
  • Mage_Paypal_Model_Cart
  • Mage_Paypal_Model_Cert
  • Mage_Paypal_Model_Config
  • Mage_Paypal_Model_Direct
  • Mage_Paypal_Model_Express
  • Mage_Paypal_Model_Express_Checkout
  • Mage_Paypal_Model_Hostedpro
  • Mage_Paypal_Model_Hostedpro_Request
  • Mage_Paypal_Model_Info
  • Mage_Paypal_Model_Ipn
  • Mage_Paypal_Model_Method_Agreement
  • Mage_Paypal_Model_Mysql4_Cert
  • Mage_Paypal_Model_Mysql4_Report_Settlement
  • Mage_Paypal_Model_Mysql4_Report_Settlement_Row
  • Mage_Paypal_Model_Mysql4_Report_Settlement_Row_Collection
  • Mage_Paypal_Model_Mysql4_Setup
  • Mage_Paypal_Model_Observer
  • Mage_Paypal_Model_Payflow_Request
  • Mage_Paypal_Model_Payflowadvanced
  • Mage_Paypal_Model_Payflowlink
  • Mage_Paypal_Model_Payflowpro
  • Mage_Paypal_Model_Payment_Transaction
  • Mage_Paypal_Model_Pro
  • Mage_Paypal_Model_Report_Settlement
  • Mage_Paypal_Model_Report_Settlement_Row
  • Mage_Paypal_Model_Resource_Cert
  • Mage_Paypal_Model_Resource_Report_Settlement
  • Mage_Paypal_Model_Resource_Report_Settlement_Row
  • Mage_Paypal_Model_Resource_Report_Settlement_Row_Collection
  • Mage_Paypal_Model_Resource_Setup
  • Mage_Paypal_Model_Session
  • Mage_Paypal_Model_Standard
  • Mage_Paypal_Model_System_Config_Backend_Cert
  • Mage_Paypal_Model_System_Config_Backend_Cron
  • Mage_Paypal_Model_System_Config_Backend_MerchantCountry
  • Mage_Paypal_Model_System_Config_Source_BuyerCountry
  • Mage_Paypal_Model_System_Config_Source_FetchingSchedule
  • Mage_Paypal_Model_System_Config_Source_Logo
  • Mage_Paypal_Model_System_Config_Source_MerchantCountry
  • Mage_Paypal_Model_System_Config_Source_PaymentActions
  • Mage_Paypal_Model_System_Config_Source_PaymentActions_Express
  • Mage_Paypal_Model_System_Config_Source_RequireBillingAddress
  • Mage_Paypal_Model_System_Config_Source_UrlMethod
  • Mage_Paypal_PayflowadvancedController
  • Mage_Paypal_PayflowController
  • Mage_Paypal_StandardController

Exceptions

  • Mage_Paypal_Exception
  • Overview
  • Package
  • Class
  • Tree

Class Mage_Paypal_Model_Cart

PayPal-specific model for shopping cart items and totals The main idea is to accommodate all possible totals into PayPal-compatible 4 totals and line items

Package: Mage\Paypal
Copyright: Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
License: Open Software License (OSL 3.0)
Located at code/core/Mage/Paypal/Model/Cart.php
Methods summary
public
# __construct( array $params = array() )

Require instance of an order or a quote

Require instance of an order or a quote

Parameters

$params
array
$params
public Mage_Sales_Model_Order
# getSalesEntity( )

Getter for the current sales entity

Getter for the current sales entity

Returns

Mage_Sales_Model_Order
Mage_Sales_Model_Quote
public array|false
# getItems( boolean $bypassValidation = false )

Render and get line items By default returns false if the items are invalid

Render and get line items By default returns false if the items are invalid

Parameters

$bypassValidation
boolean
$bypassValidation

Returns

array|false
public array
# getTotals( boolean $mergeDiscount = false )

Render and get totals If the totals are invalid for any reason, they will be merged into one amount (subtotal is utilized for it) An option to substract discount from the subtotal is available

Render and get totals If the totals are invalid for any reason, they will be merged into one amount (subtotal is utilized for it) An option to substract discount from the subtotal is available

Parameters

$mergeDiscount
boolean
$mergeDiscount

Returns

array
public Varien_Object
# addItem( string $name, numeric $qty, float $amount, string $identifier = null )

Add a line item

Add a line item

Parameters

$name
string
$name
$qty
numeric
$qty
$amount
float
$amount
$identifier
string
$identifier

Returns

Varien_Object
public boolean
# removeItem( string $identifier )

Remove item from cart by identifier

Remove item from cart by identifier

Parameters

$identifier
string
$identifier

Returns

boolean
public Mage_Paypal_Model_Cart
# updateTotal( string $code, float $amount, string $lineItemDescription = null )

Compound the specified amount with the specified total

Compound the specified amount with the specified total

Parameters

$code
string
$code
$amount
float
$amount
$lineItemDescription
string
$lineItemDescription

Returns

Mage_Paypal_Model_Cart
public boolean|Mage_Paypal_Model_Cart
# isDiscountAsItem( mixed $setValue = null )

Get/Set whether to render the discount total as a line item

Get/Set whether to render the discount total as a line item

Parameters

$setValue
mixed
$setValue

Returns

boolean|Mage_Paypal_Model_Cart
public boolean|Mage_Paypal_Model_Cart
# isShippingAsItem( mixed $setValue = null )

Get/Set whether to render the discount total as a line item

Get/Set whether to render the discount total as a line item

Parameters

$setValue
mixed
$setValue

Returns

boolean|Mage_Paypal_Model_Cart
protected
# _render( )

(re)Render all items and totals

(re)Render all items and totals

protected string
# _renderTotalLineItemDescriptions( string $code, string $prepend = '', string $append = '', string $glue = '; ' )

Merge multiple descriptions by a total code into a string

Merge multiple descriptions by a total code into a string

Parameters

$code
string
$code
$prepend
string
$prepend
$append
string
$append
$glue
string
$glue

Returns

string
protected
# _validate( )

Check the line items and totals according to PayPal business logic limitations

Check the line items and totals according to PayPal business logic limitations

protected Varien_Object
# _addRegularItem( Varien_Object $salesItem )

Add a usual line item with amount and qty

Add a usual line item with amount and qty

Parameters

$salesItem
Varien_Object
$salesItem

Returns

Varien_Object
private boolean|Mage_Paypal_Model_Cart
# _totalAsItem( string $var, mixed $setValue = null )

Get/Set for the specified variable. If the value changes, the re-rendering is commenced

Get/Set for the specified variable. If the value changes, the re-rendering is commenced

Parameters

$var
string
$var
$setValue
mixed
$setValue

Returns

boolean|Mage_Paypal_Model_Cart
private
# _applyHiddenTaxWorkaround( Mage_Core_Model_Abstract $salesEntity )

Add "hidden" discount and shipping tax

Add "hidden" discount and shipping tax

Go ahead, try to understand ]:->

Tax settings for getting "discount tax":

  • Catalog Prices = Including Tax
  • Apply Customer Tax = After Discount
  • Apply Discount on Prices = Including Tax

Test case for getting "hidden shipping tax":

  • Make sure shipping is taxable (set shipping tax class)
  • Catalog Prices = Including Tax
  • Shipping Prices = Including Tax
  • Apply Customer Tax = After Discount
  • Create a shopping cart price rule with % discount applied to the Shipping Amount
  • run shopping cart and estimate shipping
  • go to PayPal

Parameters

$salesEntity
Mage_Core_Model_Abstract
$salesEntity
Constants summary
string TOTAL_SUBTOTAL 'subtotal'
#

Totals that PayPal suppports when passing shopping cart

Totals that PayPal suppports when passing shopping cart

string TOTAL_DISCOUNT 'discount'
#
string TOTAL_TAX 'tax'
#
string TOTAL_SHIPPING 'shipping'
#
Properties summary
protected Mage_Sales_Model_Order $_salesEntity null
#

Order or quote instance

Order or quote instance

protected array $_items array()
#

Rendered cart items Array of Varien_Objects

Rendered cart items Array of Varien_Objects

protected array $_totals array()
#

Rendered cart totals Associative array with the keys from constants above

Rendered cart totals Associative array with the keys from constants above

protected array $_totalLineItemDescriptions array()
#

Set of optional descriptions for the item that may replace a total and composed of several amounts Array of strings

Set of optional descriptions for the item that may replace a total and composed of several amounts Array of strings

protected boolean $_shouldRender true
#

Lazy initialization indicator for rendering

Lazy initialization indicator for rendering

protected boolean $_areItemsValid false
#

Validation result for the rendered cart items

Validation result for the rendered cart items

protected boolean $_areTotalsValid false
#

Validation result for the rendered totals

Validation result for the rendered totals

protected boolean $_isDiscountAsItem false
#

Whether to render discount total as a line item Use case: WPP

Whether to render discount total as a line item Use case: WPP

protected boolean $_isShippingAsItem false
#

Whether to render shipping total as a line item Use case: WPS

Whether to render shipping total as a line item Use case: WPS

Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0