VirtueMart  3.2.14.9808
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Attributes | List of all members
VirtueMartCart Class Reference

Public Member Functions

 __construct ()
 
 loadSetRenderBTSTAddress ()
 
 prepareAddressFieldsInCart ()
 
 loadCart (&$existingSession)
 
 storeCart ($cartDataToStore=false)
 
 deleteCart ()
 
 setCartIntoSession ($storeDb=false, $forceWrite=false)
 
 getCartDataToStore ()
 
 removeCartFromSession ()
 
 setDataValidation ($valid=false)
 
 getDataValidated ()
 
 getInCheckOut ()
 
 setOutOfCheckout ()
 
 blockConfirm ()
 
 setRedirectDisabled ($bool=TRUE)
 
 add ($virtuemart_product_ids=null, &$errorMsg='')
 
 removeProductCart ($prod_id=0)
 
 updateProductCart ()
 
 getCardCategoryId ($virtuemart_product_id)
 
 setCouponCode ($coupon_code)
 
 validateCoupon ($coupon_code)
 
 setMethod ($type, $force=false, $redirect=true, $id=null)
 
 setShipmentMethod ($force=false, $redirect=true, $virtuemart_shipmentmethod_id=null)
 
 setPaymentMethod ($force=false, $redirect=true, $virtuemart_paymentmethod_id=null)
 
 confirmDone ()
 
 getLayoutUrlString ()
 
 checkoutData ($redirect=true)
 
 validateUserData ($type='BT', $obj=null, $redirect=false)
 
 confirmedOrder ()
 
 getCartHash ()
 
 emptyCart ()
 
 saveCartFieldsInCart ()
 
 saveAddressInCart ($data, $type, $putIntoSession=true, $prefix='')
 
 getST ($name=0, $FBBT=true)
 
 checkAutomaticSelectedPlug ($type)
 
 CheckAutomaticSelectedShipment ()
 
 CheckAutomaticSelectedPayment ()
 
 getCartPrices ($force=false)
 
 prepareVendor ()
 
 prepareCartData ($force=true)
 
 getCheckoutAdvertise ()
 
 prepareAjaxData ($withProductImages=false)
 

Static Public Member Functions

static & getCart ($forceNew=false, $options=array(), $cartData=NULL)
 
static deepCompare ($a, $b)
 
static emptyCartValues (&$cart, $session=true)
 

Public Attributes

 $products = array()
 
 $_productAdded = true
 
 $_calculated = false
 
 $_inCheckOut = false
 
 $_inConfirm = false
 
 $_fromCart = false
 
 $_dataValidated = false
 
 $_blockConfirm = false
 
 $_confirmDone = false
 
 $_redirect = false
 
 $_redirected = false
 
 $_redirect_disabled = false
 
 $_lastError = null
 
 $vendorId = 0
 
 $lastVisitedCategoryId = 0
 
 $virtuemart_shipmentmethod_id = 0
 
 $virtuemart_paymentmethod_id = 0
 
 $automaticSelectedShipment = false
 
 $automaticSelectedPayment = false
 
 $BT = 0
 
 $ST = 0
 
 $cartfields = null
 
 $couponCode = ''
 
 $order_language = ''
 
 $orderDetails = 0
 
 $lists = null
 
 $order_number =null
 
 $order_pass =null
 
 $virtuemart_order_id = false
 
 $customer_number =null
 
 $cartAdv = false
 
 $pricesCurrency = null
 
 $paymentCurrency = null
 
 $STsameAsBT = 1
 
 $selected_shipto = 0
 
 $productParentOrderable = TRUE
 
 $_triesValidateCoupon = array()
 
 $cartProductsData = array()
 
 $cartData = array()
 
 $cartPrices = array()
 
 $layout
 
 $layoutPath =''
 
 $orderdoneHtml = false
 
 $virtuemart_cart_id = 0
 
 $customer_notified = false
 
 $pricesUnformatted = array()
 
 $useSSL = 1
 

Private Member Functions

 redirecter ($relUrl, $redirectMsg)
 
 checkPurchaseValue ()
 
 filterCartInput ($v)
 
 checkForQuantities ($product, &$quantity=0)
 

Static Private Attributes

static $_cart = null
 

Constructor & Destructor Documentation

VirtueMartCart::__construct ( )

Member Function Documentation

VirtueMartCart::add (   $virtuemart_product_ids = null,
$errorMsg = '' 
)

Add a product to the cart

Author
Max Milbers public
VirtueMartCart::blockConfirm ( )
VirtueMartCart::CheckAutomaticSelectedPayment ( )
VirtueMartCart::checkAutomaticSelectedPlug (   $type)
Author
Valérie Isaksen, Max Milbers
Parameters
$type
Returns
bool
VirtueMartCart::CheckAutomaticSelectedShipment ( )
VirtueMartCart::checkForQuantities (   $product,
$quantity = 0 
)
private

Checks if the quantity is correct

Author
Max Milbers
VirtueMartCart::checkoutData (   $redirect = true)
VirtueMartCart::checkPurchaseValue ( )
private

Check if a minimum purchase value for this order has been set, and if so, if the current value is equal or hight than that value.

Author
Oscar van Eijk
Returns
An error message when a minimum value was set that was not eached, null otherwise
VirtueMartCart::confirmDone ( )
VirtueMartCart::confirmedOrder ( )

This function is called, when the order is confirmed by the shopper.

Here are the last checks done by payment plugins. The mails are created and send to vendor and shopper will show the orderdone page (thank you page)

static VirtueMartCart::deepCompare (   $a,
  $b 
)
static
VirtueMartCart::deleteCart ( )
VirtueMartCart::emptyCart ( )

emptyCart: Used for payment handling.

Author
Valerie Cartan Isaksen
static VirtueMartCart::emptyCartValues ( $cart,
  $session = true 
)
static

emptyCart: Used for payment handling.

Author
Valerie Cartan Isaksen
VirtueMartCart::filterCartInput (   $v)
private
VirtueMartCart::getCardCategoryId (   $virtuemart_product_id)

Get the category ID from a product ID

Author
RolandD, Patrick Kohl public
Returns
mixed if found the category ID else null
Deprecated:
, useless function, already done in the product model
static& VirtueMartCart::getCart (   $forceNew = false,
  $options = array(),
  $cartData = NULL 
)
static

Get the cart from the session

Author
Max Milbers public
Parameters
array$cartthe cart to store in the session
VirtueMartCart::getCartDataToStore ( )
VirtueMartCart::getCartHash ( )
VirtueMartCart::getCartPrices (   $force = false)

Function Description

Author
Max Milbers public
Parameters
array$cartthe cart to get the products for
Returns
array of product objects
VirtueMartCart::getCheckoutAdvertise ( )
VirtueMartCart::getDataValidated ( )
VirtueMartCart::getInCheckOut ( )
VirtueMartCart::getLayoutUrlString ( )
VirtueMartCart::getST (   $name = 0,
  $FBBT = true 
)

Returns ST address considering the set options, with fallback

Author
Max Milbers
VirtueMartCart::loadCart ( $existingSession)
Author
Max Milbers
VirtueMartCart::loadSetRenderBTSTAddress ( )
VirtueMartCart::prepareAddressFieldsInCart ( )
VirtueMartCart::prepareAjaxData (   $withProductImages = false)
VirtueMartCart::prepareCartData (   $force = true)
VirtueMartCart::prepareVendor ( )
VirtueMartCart::redirecter (   $relUrl,
  $redirectMsg 
)
private
VirtueMartCart::removeCartFromSession ( )

Remove the cart from the session

Author
Max Milbers public
VirtueMartCart::removeProductCart (   $prod_id = 0)

Remove a product from the cart

Author
RolandD
Parameters
array$cart_idthe cart IDs to remove from the cart public
VirtueMartCart::saveAddressInCart (   $data,
  $type,
  $putIntoSession = true,
  $prefix = '' 
)
VirtueMartCart::saveCartFieldsInCart ( )
VirtueMartCart::setCartIntoSession (   $storeDb = false,
  $forceWrite = false 
)

Set the cart in the session

public

Parameters
array$cartthe cart to store in the session
VirtueMartCart::setCouponCode (   $coupon_code)

Validate the coupon code. If ok,. set it in the cart

Parameters
string$coupon_codeCoupon code as entered by the user
Author
Oscar van Eijk TODO Change the coupon total/used in DB ? public
Returns
string On error the message text, otherwise an empty string
VirtueMartCart::setDataValidation (   $valid = false)
VirtueMartCart::setMethod (   $type,
  $force = false,
  $redirect = true,
  $id = null 
)
VirtueMartCart::setOutOfCheckout ( )
VirtueMartCart::setPaymentMethod (   $force = false,
  $redirect = true,
  $virtuemart_paymentmethod_id = null 
)
VirtueMartCart::setRedirectDisabled (   $bool = TRUE)

For one page checkouts, disable with this the redirects

Parameters
bool$bool
VirtueMartCart::setShipmentMethod (   $force = false,
  $redirect = true,
  $virtuemart_shipmentmethod_id = null 
)

Check the selected shipment data and store the info in the cart

Parameters
integer$shipment_idShipment ID taken from the form data
Author
Max Milbers
VirtueMartCart::storeCart (   $cartDataToStore = false)
VirtueMartCart::updateProductCart ( )

Update a product in the cart

Author
Max Milbers
Parameters
array$cart_idthe cart IDs to remove from the cart public
VirtueMartCart::validateCoupon (   $coupon_code)
VirtueMartCart::validateUserData (   $type = 'BT',
  $obj = null,
  $redirect = false 
)

Test userdata if valid

Author
Max Milbers
Parameters
Stringif BT or ST
ObjectIf given, an object with data address data that must be formatted to an array
Returns
redirectMsg, if there is a redirectMsg, the redirect should be executed after

Member Data Documentation

VirtueMartCart::$_blockConfirm = false
VirtueMartCart::$_calculated = false
VirtueMartCart::$_cart = null
staticprivate
VirtueMartCart::$_confirmDone = false
VirtueMartCart::$_dataValidated = false
VirtueMartCart::$_fromCart = false
VirtueMartCart::$_inCheckOut = false
VirtueMartCart::$_inConfirm = false
VirtueMartCart::$_lastError = null
VirtueMartCart::$_productAdded = true
VirtueMartCart::$_redirect = false
VirtueMartCart::$_redirect_disabled = false
VirtueMartCart::$_redirected = false
VirtueMartCart::$_triesValidateCoupon = array()
VirtueMartCart::$automaticSelectedPayment = false
VirtueMartCart::$automaticSelectedShipment = false
VirtueMartCart::$BT = 0
VirtueMartCart::$cartAdv = false
VirtueMartCart::$cartData = array()
VirtueMartCart::$cartfields = null
VirtueMartCart::$cartPrices = array()
VirtueMartCart::$cartProductsData = array()
VirtueMartCart::$couponCode = ''
VirtueMartCart::$customer_notified = false
VirtueMartCart::$customer_number =null
VirtueMartCart::$lastVisitedCategoryId = 0
VirtueMartCart::$layout
VirtueMartCart::$layoutPath =''
VirtueMartCart::$lists = null
VirtueMartCart::$order_language = ''
VirtueMartCart::$order_number =null
VirtueMartCart::$order_pass =null
VirtueMartCart::$orderDetails = 0
VirtueMartCart::$orderdoneHtml = false
VirtueMartCart::$paymentCurrency = null
VirtueMartCart::$pricesCurrency = null
VirtueMartCart::$pricesUnformatted = array()
VirtueMartCart::$productParentOrderable = TRUE
VirtueMartCart::$products = array()
VirtueMartCart::$selected_shipto = 0
VirtueMartCart::$ST = 0
VirtueMartCart::$STsameAsBT = 1
VirtueMartCart::$useSSL = 1
VirtueMartCart::$vendorId = 0
VirtueMartCart::$virtuemart_cart_id = 0
VirtueMartCart::$virtuemart_order_id = false
VirtueMartCart::$virtuemart_paymentmethod_id = 0
VirtueMartCart::$virtuemart_shipmentmethod_id = 0

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