Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZCartItem Class Reference

## Public Member Functions
| __construct ( $id="")
| store ()
| get ( $id="")
| delete ()
| id ()
& | product ()
| cart ()
| count ()
| localePrice ( $calcCount=true, $withOptions=true, $calcVAT=false, $withPriceGroups=true)
| correctPrice ( $calcCount=true, $withOptions=true, $calcVAT=false, $withPriceGroups=true)
| localeSavings ( $calcCount=true, $withOptions=true, $calcVAT=false)
| correctSavings ( $calcCount=true, $withOptions=true, $calcVAT=false)
| price ( $calcCount=true, $withOptions=true)
| vat ( $calcCount=true, $withOptions=true)
| setProduct ( $product)
| setCart ( $cart)
| setCount ( $count)
| setVoucherInformation ( $value)
| mail ( $asObject=true)
| setWishListItem ( $wishlist)
& | wishListItem ()
& | voucherInformation ()
& | optionValues ()

## Public Attributes
| $ID
| $ProductID
| $CartID
| $Count
| $VoucherInformationID
| $WishListItemID
| ID to a wishlist item. Indicates which wishlistitem the cart item comes from. 0 if added from product. More...

## Detailed Description

! eZTrade eZCartItem handles a shopping cart

Example code:

$product = new eZProduct( 3 );
$cartItem = new eZCartItem();
$cartItem->setProduct( $product );
$cartItem->setCart( $cart );
// Store to the database
$cartItem->store();
$cart
$cart
Definition: buy.php:27
eZCartItem
Definition: ezcartitem.php:56
eZProduct
Definition: ezproduct.php:71
$product
$product
Definition: homepage.php:202

See also
  eZCart

Definition at line 55 of file ezcartitem.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZCartItem::__construct | ( |  | $id = `""` | ) |

Constructs a new eZCart object.

If $id is set the object's values are fetched from the database.

Definition at line 63 of file ezcartitem.php.

References $id, and $ID.

## Member Function Documentation

## ◆ cart()

eZCartItem::cart | ( |  | ) |

Returns the cart.

Definition at line 204 of file ezcartitem.php.

References $cart, and $ret.

## ◆ correctPrice()

eZCartItem::correctPrice | ( |  | $calcCount = `true`,
|  |  | $withOptions = `true`,
|  |  | $calcVAT = `false`,
|  |  | $withPriceGroups = `true`
| ) |  |

Returns the correct price of the product based on the logged in user, and the VAT status and use.

Definition at line 246 of file ezcartitem.php.

References $price, $product, count(), optionValues(), product(), and voucherInformation().

Referenced by localePrice(), and vat().

## ◆ correctSavings()

eZCartItem::correctSavings | ( |  | $calcCount = `true`,
|  |  | $withOptions = `true`,
|  |  | $calcVAT = `false`
| ) |  |

Returns the correct savings of the product based on the logged in user, and the VAT status and use.

Definition at line 315 of file ezcartitem.php.

References $price, $product, count(), optionValues(), and product().

Referenced by localeSavings().

## ◆ count()

eZCartItem::count | ( |  | ) |

Returns the product count.

Definition at line 220 of file ezcartitem.php.

References $Count.

Referenced by correctPrice(), correctSavings(), get(), and price().

## ◆ delete()

eZCartItem::delete | ( |  | ) |

Deletes a eZCartItem object from the database.

Definition at line 159 of file ezcartitem.php.

References $db, $res, and eZDB\globalDatabase().

## ◆ get()

eZCartItem::get | ( |  | $id = `""` | ) |

Fetches the object information from the database.

Definition at line 129 of file ezcartitem.php.

References $db, $id, $ret, count(), and eZDB\globalDatabase().

## ◆ id()

eZCartItem::id | ( |  | ) |

Returns the object id.

Definition at line 179 of file ezcartitem.php.

References $ID.

## ◆ localePrice()

eZCartItem::localePrice | ( |  | $calcCount = `true`,
|  |  | $withOptions = `true`,
|  |  | $calcVAT = `false`,
|  |  | $withPriceGroups = `true`
| ) |  |

Returns the correct localized price of the product.

Definition at line 228 of file ezcartitem.php.

References $currency, $ini, $locale, $price, and correctPrice().

## ◆ localeSavings()

eZCartItem::localeSavings | ( |  | $calcCount = `true`,
|  |  | $withOptions = `true`,
|  |  | $calcVAT = `false`
| ) |  |

Returns the correct localized price of the product.

Definition at line 297 of file ezcartitem.php.

References $currency, $ini, $locale, $price, and correctSavings().

## ◆ mail()

eZCartItem::mail | ( |  | $asObject = `true` | ) |

Returns the mail.

Definition at line 464 of file ezcartitem.php.

References $ret.

## ◆ optionValues()

& eZCartItem::optionValues | ( |  | ) |

Returns all the option values as an array of eZCartOptionValue objects.

An empty array is returned if none exists.

Definition at line 524 of file ezcartitem.php.

References $db, $item, and eZDB\globalDatabase().

Referenced by correctPrice(), correctSavings(), and price().

## ◆ price()

eZCartItem::price | ( |  | $calcCount = `true`,
|  |  | $withOptions = `true`
| ) |  |

Returns the price of the cart item.

Options and count is calculated if not disabled.

Definition at line 354 of file ezcartitem.php.

References $price, $PriceGroup, $product, eZPriceGroup\correctPrice(), count(), optionValues(), and product().

## ◆ product()

& eZCartItem::product | ( |  | ) |

Returns the product to the cart item as an eZProduct object.

Definition at line 188 of file ezcartitem.php.

References $ret.

Referenced by correctPrice(), correctSavings(), and price().

## ◆ setCart()

eZCartItem::setCart | ( |  | $cart | ) |

Sets the cart.

Definition at line 430 of file ezcartitem.php.

References $cart.

## ◆ setCount()

eZCartItem::setCount | ( |  | $count | ) |

Sets the number of products.

Definition at line 441 of file ezcartitem.php.

References $count.

## ◆ setProduct()

eZCartItem::setProduct | ( |  | $product | ) |

Sets the product.

Definition at line 419 of file ezcartitem.php.

References $product.

## ◆ setVoucherInformation()

eZCartItem::setVoucherInformation | ( |  | $value | ) |

Sets the voucherinformation.

Definition at line 449 of file ezcartitem.php.

## ◆ setWishListItem()

eZCartItem::setWishListItem | ( |  | $wishlist | ) |

Sets the wishlist item.

Definition at line 481 of file ezcartitem.php.

References $wishlist.

## ◆ store()

eZCartItem::store | ( |  | ) |

Stores a cart to the database.

Definition at line 82 of file ezcartitem.php.

References $db, $query, $res, and eZDB\globalDatabase().

## ◆ vat()

eZCartItem::vat | ( |  | $calcCount = `true`,
|  |  | $withOptions = `true`
| ) |  |

Return the vat for the product.

Definition at line 409 of file ezcartitem.php.

References $vat, and correctPrice().

## ◆ voucherInformation()

& eZCartItem::voucherInformation | ( |  | ) |

Returns the voucher information.

Definition at line 507 of file ezcartitem.php.

References $ret.

Referenced by correctPrice().

## ◆ wishListItem()

& eZCartItem::wishListItem | ( |  | ) |

Returns the wishlist item as a eZWishListItem object. 0 if the

Definition at line 492 of file ezcartitem.php.

References $ret.

## Member Data Documentation

## ◆ $CartID

eZCartItem::$CartID

Definition at line 543 of file ezcartitem.php.

## ◆ $Count

eZCartItem::$Count

Definition at line 544 of file ezcartitem.php.

Referenced by count().

## ◆ $ID

eZCartItem::$ID

Definition at line 541 of file ezcartitem.php.

Referenced by __construct(), and id().

## ◆ $ProductID

eZCartItem::$ProductID

Definition at line 542 of file ezcartitem.php.

## ◆ $VoucherInformationID

eZCartItem::$VoucherInformationID

Definition at line 545 of file ezcartitem.php.

## ◆ $WishListItemID

eZCartItem::$WishListItemID

ID to a wishlist item. Indicates which wishlistitem the cart item comes from. 0 if added from product.

Definition at line 548 of file ezcartitem.php.

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

- ezcartitem.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.