Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZProduct Class Reference

## Public Member Functions
| __construct ( $id="")
| store ()
| get ( $id="", $categoryID=false)
| delete ()
| id ()
| name ()
& | remoteID ()
& | price ()
& | listPrice ()
| flatUps ()
| flatUsps ()
| flatCombine ()
| correctPrice ( $calcVAT, $withPriceGroups=true)
| localeSavings ( $calcVAT)
| correctSavings ( $calcVAT)
| correctPriceRange ( $calcVAT, $withPriceGroups=true)
& | localePrice ( $calcVAT, $withPriceGroups=true)
| hasPrice ()
& | priceExVAT ( $price="", $calcVAT=true)
& | priceIncVAT ( $price="")
| vatPercentage ()
& | vat ( $price="")
& | extractVAT ( $price="")
& | addVAT ( $price="")
| productType ( $price="")
| expiryTime ()
| stockDate ()
| setProductType ( $type=1)
| setTotalQuantity ( $quantity)
| setExpiryTime ( $time)
| setStockDate ( $time)
& | keywords ()
& | productNumber ()
& | catalogNumber ()
& | contents ()
& | BoxTypeID ()
& | brief ()
& | briefPlain ()
& | description ()
& | descriptionPlain ()
| showPrice ()
| showProduct ()
| discontinued ()
| externalLink ()
| weight ()
| isHotDeal ()
| setName ( $value)
| setRemoteID ( $remoteID)
| setBrief ( $value)
| setDescription ( $value)
| setContents ( $value)
| setKeywords ( $value)
| setProductNumber ( $value)
| setCatalogNumber ( $value)
| setPrice ( $value)
| setListPrice ( $value)
| setShowPrice ( $value)
| setShowProduct ( $value)
| setDiscontinued ( $value)
| setExternalLink ( $value)
| setWeight ( $value)
| setIsHotDeal ( $value)
| setFlatUPS ( $value)
| setFlatUSPS ( $value)
| setFlatCombine ( $value)
| addOption ( $value)
| options ()
| hasOptions ()
| addImage ( $value, $placement=false)
| deleteImage ( $value)
& | images ()
| setMainImage ( $image)
| setThumbnailImage ( $image)
| mainImage ()
| thumbnailImage ()
| activeProductSearch ( $query=false, $offset=false, $limit=false, $active=TRUE, $sortMode="time")
| activeProductSearchCount ( $query, $active=TRUE)
| extendedSearch ( $priceLower, $priceHigher, $text, $offset=0, $limit=10, $categoryArrayID=array())
| extendedSearchCount ( $priceLower, $priceHigher, $text, $categoryArrayID=array())
& | hotDealProducts ( $limit=false)
& | findProductNumber ( $id)
| categories ( $as_object=true)
| removeFromCategories ()
| existsInCategory ( $category)
| setCategoryDefinition ( $value)
| categoryDefinition ( $as_object=true)
| setType ( $type)
| type ()
| removeType ()
| getByRemoteID ( $id)
| productName ( $id)
| setVATType ( $type)
| setBoxType ( $type)
| boxType ()
| vatType ()
| setShippingGroup ( $group)
& | shippingGroup ()
& | priceRange ( $id=false)
| setIncludesVAT ( $inValue=true)
| includesVAT ()
| excludedVAT ()
| deleteForms ()
| addForm ( $form)
| forms ( $as_object=true)
& | activeProducts ( $sortMode="time", $offset=0, $limit=50, $categoryID=false)
& | products ( $sortMode="time", $fetchNonActive=false, $offset=0, $limit=50, $fetchDiscontinued=false, $categoryID=false)
| voucher ()
| voucherInformation ()
| forum ( $as_object=true)
| productIDFromForum ( $ForumID)
| addFile ( $value)
| deleteFile ( $value)
| files ( $as_object=true)

## Static Public Member Functions
| totalQuantity ( $id=false)
| hasQuantity ( $require=true, $id=false)
static | namedQuantity ( $quantity)

## Public Attributes
| $ID
| $Name
| $Contents
| $Brief
| $Description
| $Keywords
| $ProductNumber
| $CatalogNumber
| $ShowPrice
| $ShowProduct
| $Discontinued
| $ExternalLink
| $IsHotDeal
| $Weight
| $RemoteID
| $VATTypeID
| $BoxTypeID
| $ShippingGroupID
| $ProductType
| $Price
| $ListPrice
| $ExpiryTime
| $StockDate
| $IncludesVAT
| $FlatUPS
| $FlatUSPS
| $FlatDHL
| $FlatCombine

## Detailed Description

! eZTrade eZProduct handles product information.

Example code:

// Create a new product and set some values.
$product = new eZProduct();
$product->setName( "Toothbrush" );
$product->setBrief( "A nice and small toothbrush" );
$product->setDescription( "Bla bla environment bla bla cheap bla bla must have." );
$product->setProductNumber( "Jordan-A101" );
$product->setKeywords( "teeth cheap cool brush" );
$product->setPrice( 21.50 );
// Store the product to the database
$product->store();
eZProduct
Definition: ezproduct.php:71
$product
$product
Definition: homepage.php:202

See also
  eZProductCategory eZOption

TODO Add query builder to search. Use same as in eZLink.

Definition at line 70 of file ezproduct.php.

## Constructor & Destructor Documentation

## ◆ __construct()

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

Constructs a new eZProduct object.

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

Definition at line 78 of file ezproduct.php.

References $id, and $ID.

## Member Function Documentation

## ◆ activeProducts()

& eZProduct::activeProducts | ( |  | $sortMode = `"time"`,
|  |  | $offset = `0`,
|  |  | $limit = `50`,
|  |  | $categoryID = `false`
| ) |  |

Returns every active product as a array of eZProduct objects.

Definition at line 2697 of file ezproduct.php.

References $categoryID, $limit, $offset, and products().

## ◆ activeProductSearch()

eZProduct::activeProductSearch | ( |  | $query = `false`,
|  |  | $offset = `false`,
|  |  | $limit = `false`,
|  |  | $active = `TRUE`,
|  |  | $sortMode = `"time"`
| ) |  |

Searches through every product and returns the result as an array of eZProduct objects.

Definition at line 1777 of file ezproduct.php.

References $active, $db, $limit, $offset, $OrderBy, $product, $query, $ret, and eZDB\globalDatabase().

## ◆ activeProductSearchCount()

eZProduct::activeProductSearchCount | ( |  | $query,
|  |  | $active = `TRUE`
| ) |  |

Searches through every product and returns the result count

Definition at line 1893 of file ezproduct.php.

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

## ◆ addFile()

eZProduct::addFile | ( |  | $value | ) |

Adds an file to the product. $value can either be a eZVirtualFile or an ID

Definition at line 2952 of file ezproduct.php.

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

## ◆ addForm()

eZProduct::addForm | ( |  | $form | ) |

Adds a form to the product.

Definition at line 2636 of file ezproduct.php.

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

## ◆ addImage()

eZProduct::addImage | ( |  | $value,
|  |  | $placement = `false`
| ) |  |

Adds an image to the product.

Definition at line 1493 of file ezproduct.php.

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

## ◆ addOption()

eZProduct::addOption | ( |  | $value | ) |

Adds a option to the product.

Definition at line 1430 of file ezproduct.php.

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

## ◆ addVAT()

& eZProduct::addVAT | ( |  | $price = `""` | ) |

Returns the VAT value of the product.

If a value is given as argument this value is used for VAT calculation. This is used in carts where you have multiple products and prices on options.

Definition at line 873 of file ezproduct.php.

References $price, $Price, $vat, and vatType().

## ◆ boxType()

eZProduct::boxType | ( |  | ) |

Returns the box type as a eZBoxType object.

False if no type is not assigned.

Definition at line 2441 of file ezproduct.php.

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

## ◆ BoxTypeID()

& eZProduct::BoxTypeID | ( |  | ) |

Definition at line 1115 of file ezproduct.php.

References $BoxTypeID.

Referenced by boxType(), get(), and setBoxType().

## ◆ brief()

& eZProduct::brief | ( |  | ) |

Returns the introduction to the product.

This introduction is rendered from the XML contents. If you want to use another configuration you must render this from the Contents field manualli with the eZArticleRenderer class.

Definition at line 1127 of file ezproduct.php.

References $articleContents, and $renderer.

## ◆ briefPlain()

& eZProduct::briefPlain | ( |  | ) |

Definition at line 1136 of file ezproduct.php.

References $articleContents.

## ◆ catalogNumber()

& eZProduct::catalogNumber | ( |  | ) |

Returns the catalog product number of the product.

Definition at line 1099 of file ezproduct.php.

## ◆ categories()

eZProduct::categories | ( |  | $as_object = `true` | ) |

Returns the categrories a product is assigned to.

The categories are returned as an array of eZProductCategory objects.

Definition at line 2153 of file ezproduct.php.

References $category, $category_array, $db, $ret, and eZDB\globalDatabase().

## ◆ categoryDefinition()

eZProduct::categoryDefinition | ( |  | $as_object = `true` | ) |

Returns the product's definition category.

Definition at line 2256 of file ezproduct.php.

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

## ◆ contents()

& eZProduct::contents | ( |  | ) |

Returns the XML contents of the product.

Definition at line 1109 of file ezproduct.php.

## ◆ correctPrice()

eZProduct::correctPrice | ( |  | $calcVAT,
|  |  | $withPriceGroups = `true`
| ) |  |

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

Definition at line 453 of file ezproduct.php.

References $db, $groups, $i, $price, $Price, $vat, eZPriceGroup\correctPrice(), eZUser\currentUser(), excludedVAT(), eZDB\globalDatabase(), includesVAT(), eZPriceGroup\priceGroups(), eZPriceGroup\prices(), and vatType().

Referenced by correctPriceRange(), and localePrice().

## ◆ correctPriceRange()

eZProduct::correctPriceRange | ( |  | $calcVAT,
|  |  | $withPriceGroups = `true`
| ) |  |

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

Definition at line 634 of file ezproduct.php.

References $groups, $options, $price, $vat, correctPrice(), eZUser\currentUser(), eZPriceGroup\highestPrice(), includesVAT(), eZPriceGroup\lowestPrice(), options(), eZPriceGroup\priceGroups(), and vatPercentage().

Referenced by localePrice().

## ◆ correctSavings()

eZProduct::correctSavings | ( |  | $calcVAT | ) |

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

Definition at line 543 of file ezproduct.php.

References $db, $groups, $i, $price, $Price, $vat, eZPriceGroup\correctPrice(), eZUser\currentUser(), excludedVAT(), eZDB\globalDatabase(), includesVAT(), eZPriceGroup\priceGroups(), eZPriceGroup\prices(), and vatType().

Referenced by localeSavings().

## ◆ delete()

eZProduct::delete | ( |  | ) |

Deletes a eZProduct object from the database.

Definition at line 337 of file ezproduct.php.

References $db, $id, $ID, $options, $query, $res, $row, eZDB\globalDatabase(), and options().

## ◆ deleteFile()

eZProduct::deleteFile | ( |  | $value | ) |

Deletes an file from the product. $value can either be a eZVirtualFile or an ID

NOTE: the file does not get deleted from the file catalogue.

Definition at line 2988 of file ezproduct.php.

References $db, and eZDB\globalDatabase().

## ◆ deleteForms()

eZProduct::deleteForms | ( |  | ) |

Deletes all forms associated with the product.

Definition at line 2620 of file ezproduct.php.

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

## ◆ deleteImage()

eZProduct::deleteImage | ( |  | $value | ) |

Deletes an image from the product.

NOTE: the image does not get deleted from the image catalogue.

Definition at line 1551 of file ezproduct.php.

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

## ◆ description()

& eZProduct::description | ( |  | ) |

Returns the description of the product.

Definition at line 1166 of file ezproduct.php.

References $articleContents, and $renderer.

## ◆ descriptionPlain()

& eZProduct::descriptionPlain | ( |  | ) |

Definition at line 1175 of file ezproduct.php.

References $articleContents.

## ◆ discontinued()

eZProduct::discontinued | ( |  | ) |

Returns true if the product is discontinued.

Definition at line 1217 of file ezproduct.php.

References $Discontinued.

## ◆ excludedVAT()

eZProduct::excludedVAT | ( |  | ) |

Returns true if the prices of this product doesn't include vat.

Definition at line 2605 of file ezproduct.php.

References $ret.

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

## ◆ existsInCategory()

eZProduct::existsInCategory | ( |  | $category | ) |

Returns true if the product is assigned to the category given as argument. False if not.

Definition at line 2196 of file ezproduct.php.

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

## ◆ expiryTime()

eZProduct::expiryTime | ( |  | ) |

Returns the products expiry time

Definition at line 909 of file ezproduct.php.

References $ExpiryTime.

## ◆ extendedSearch()

eZProduct::extendedSearch | ( |  | $priceLower,
|  |  | $priceHigher,
|  |  | $text,
|  |  | $offset = `0`,
|  |  | $limit = `10`,
|  |  | $categoryArrayID = `array()`
| ) |  |

Search through the products.

Returns the products as an array of eZProducts objects.

Definition at line 1920 of file ezproduct.php.

References $cat, $categoryArrayID, $db, $i, $id, $price, $products, $query, and eZDB\globalDatabase().

## ◆ extendedSearchCount()

eZProduct::extendedSearchCount | ( |  | $priceLower,
|  |  | $priceHigher,
|  |  | $text,
|  |  | $categoryArrayID = `array()`
| ) |  |

Search through the products and returns the count.

Definition at line 2013 of file ezproduct.php.

References $cat, $categoryArrayID, $db, $i, $id, $price, $products, $query, and eZDB\globalDatabase().

## ◆ externalLink()

eZProduct::externalLink | ( |  | ) |

Returns the external link to the product.

Definition at line 1225 of file ezproduct.php.

## ◆ extractVAT()

& eZProduct::extractVAT | ( |  | $price = `""` | ) |

Definition at line 835 of file ezproduct.php.

References $price, $Price, $vat, includesVAT(), and vatType().

Referenced by vat().

## ◆ files()

eZProduct::files | ( |  | $as_object = `true` | ) |

Returns every file to a product as an array of eZFile objects.

Definition at line 3005 of file ezproduct.php.

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

## ◆ findProductNumber()

& eZProduct::findProductNumber | ( |  | $id | ) |

Returns the products for a given product number (SKU)).

Definition at line 2129 of file ezproduct.php.

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

## ◆ flatCombine()

eZProduct::flatCombine | ( |  | ) |

Returns bool value indicating if the flat shipped product should be combined with others if purchased in a group.

Definition at line 445 of file ezproduct.php.

References $FlatCombine.

## ◆ flatUps()

eZProduct::flatUps | ( |  | ) |

Returns the flat UPS shipping amount for the product.

Definition at line 429 of file ezproduct.php.

References $FlatUPS.

## ◆ flatUsps()

eZProduct::flatUsps | ( |  | ) |

Returns the flat USPS shipping amount for the product.

Definition at line 437 of file ezproduct.php.

References $FlatUSPS.

## ◆ forms()

eZProduct::forms | ( |  | $as_object = `true` | ) |

Returns an array of the forms for the current product.

Definition at line 2670 of file ezproduct.php.

References $count, $db, $i, $id, $ID, $query, and eZDB\globalDatabase().

## ◆ forum()

eZProduct::forum | ( |  | $as_object = `true` | ) |

Returns the review for the product.

Definition at line 2843 of file ezproduct.php.

References $category, $db, $forum, $ini, $module, $res, and eZDB\globalDatabase().

## ◆ get()

eZProduct::get | ( |  | $id = `""`,
|  |  | $categoryID = `false`
| ) |  |

Fetches the object information from the database.

Definition at line 263 of file ezproduct.php.

References $category_array, $categoryID, $db, $id, $query, $ret, BoxTypeID(), eZProductCategory\generatePermissionSQL(), eZDB\globalDatabase(), and Name.

## ◆ getByRemoteID()

eZProduct::getByRemoteID | ( |  | $id | ) |

Check if there are a product where RemoteID == $id. Return the product if true.

Definition at line 2369 of file ezproduct.php.

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

Referenced by eZFreeTradeImport\makeLinks().

## ◆ hasOptions()

eZProduct::hasOptions | ( |  | ) |

Returns true if the product has options.

Definition at line 1474 of file ezproduct.php.

References $db, and eZDB\globalDatabase().

Referenced by localePrice().

## ◆ hasPrice()

eZProduct::hasPrice | ( |  | ) |

Returns the price of the product.

Definition at line 729 of file ezproduct.php.

## ◆ hasQuantity()

eZProduct::hasQuantity | ( |  | $require = `true`,
|  |  | $id = `false`
| ) |  |
| static

Returns true if the product has some sort of quantity which can be bought.

Definition at line 1021 of file ezproduct.php.

References $id, $ID, and totalQuantity().

## ◆ hotDealProducts()

& eZProduct::hotDealProducts | ( |  | $limit = `false` | ) |

Returns the products set to hot deal.

Definition at line 2098 of file ezproduct.php.

References $db, $limit, $product, $query, $ret, eZProductCategory\generatePermissionSQL(), and eZDB\globalDatabase().

## ◆ id()

eZProduct::id | ( |  | ) |

Returns the object ID to the product. This is the unique ID stored in the database.

Definition at line 387 of file ezproduct.php.

References $ID.

## ◆ images()

& eZProduct::images | ( |  | ) |

Returns every image to a product as a array of eZImage objects.

Definition at line 1572 of file ezproduct.php.

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

## ◆ includesVAT()

eZProduct::includesVAT | ( |  | ) |

Returns true if the prices of this product includes vat.

Definition at line 2590 of file ezproduct.php.

References $ret.

Referenced by correctPrice(), correctPriceRange(), correctSavings(), extractVAT(), and priceExVAT().

## ◆ isHotDeal()

eZProduct::isHotDeal | ( |  | ) |

Returns true if the product is a hot deal. False if not.

Definition at line 1248 of file ezproduct.php.

References $ret.

## ◆ keywords()

& eZProduct::keywords | ( |  | ) |

Returns the keywords of the product.

Definition at line 1077 of file ezproduct.php.

## ◆ listPrice()

& eZProduct::listPrice | ( |  | ) |

Returns the manufacturer's list 'price of the product.

Definition at line 421 of file ezproduct.php.

References $ListPrice.

## ◆ localePrice()

& eZProduct::localePrice | ( |  | $calcVAT,
|  |  | $withPriceGroups = `true`
| ) |  |

Returns the correct localized price of the product.

Definition at line 694 of file ezproduct.php.

References $currency, $ini, $locale, $price, correctPrice(), correctPriceRange(), eZUser\currentUser(), and hasOptions().

## ◆ localeSavings()

eZProduct::localeSavings | ( |  | $calcVAT | ) |

Returns the correct localized savings of the product.

Definition at line 523 of file ezproduct.php.

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

## ◆ mainImage()

eZProduct::mainImage | ( |  | ) |

Returns the main image of the product as a eZImage object.

false (0) is returned if no main image is found.

Definition at line 1728 of file ezproduct.php.

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

## ◆ name()

eZProduct::name | ( |  | ) |

Returns the name of the product.

Definition at line 395 of file ezproduct.php.

References Name.

## ◆ namedQuantity()

static eZProduct::namedQuantity | ( |  | $quantity | ) |
| static

Returns a textual version of the quantity, this allows a site to hide the exact quantity but instead give indications. If no named quantity can be found the quantity is returned.

Definition at line 1037 of file ezproduct.php.

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

## ◆ options()

eZProduct::options | ( |  | ) |

Returns every option to a product as a array of eZOption objects.

Definition at line 1456 of file ezproduct.php.

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

Referenced by correctPriceRange(), and delete().

## ◆ price()

& eZProduct::price | ( |  | ) |

Returns the price of the product.

Definition at line 413 of file ezproduct.php.

References $Price.

## ◆ priceExVAT()

& eZProduct::priceExVAT | ( |  | $price = `""`,
|  |  | $calcVAT = `true`
| ) |  |

Returns the price of the product exclusive VAT ( prive - VAT value ).

If a value is given as argument this value is used for VAT calculation. This is used in carts where you have multiple products and prices on options.

Definition at line 740 of file ezproduct.php.

References $price, $Price, $vat, includesVAT(), and vatType().

## ◆ priceIncVAT()

& eZProduct::priceIncVAT | ( |  | $price = `""` | ) |

Returns the price of the product included VAT ( prive + VAT value ).

If a value is given as argument this value is used for VAT calculation. This is used in carts where you have multiple products and prices on options.

Definition at line 777 of file ezproduct.php.

References $price, $Price, $vat, excludedVAT(), and vatType().

## ◆ priceRange()

& eZProduct::priceRange | ( |  | $id = `false` | ) |

Definition at line 2552 of file ezproduct.php.

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

## ◆ productIDFromForum()

eZProduct::productIDFromForum | ( |  | $ForumID | ) |

Returns the product which a review is connected to.

Definition at line 2930 of file ezproduct.php.

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

## ◆ productName()

eZProduct::productName | ( |  | $id | ) |

Returns the name of the product with the given id.

Definition at line 2390 of file ezproduct.php.

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

## ◆ productNumber()

& eZProduct::productNumber | ( |  | ) |

Returns the product number of the product.

Definition at line 1088 of file ezproduct.php.

## ◆ products()

& eZProduct::products | ( |  | $sortMode = `"time"`,
|  |  | $fetchNonActive = `false`,
|  |  | $offset = `0`,
|  |  | $limit = `50`,
|  |  | $fetchDiscontinued = `false`,
|  |  | $categoryID = `false`
| ) |  |

Returns every product to a category as a array of eZProduct objects.

Definition at line 2709 of file ezproduct.php.

References $categoryID, $db, $groups, $i, $limit, $offset, $OrderBy, $query, $user, eZUser\currentUser(), eZProductCategory\generatePermissionSQL(), and eZDB\globalDatabase().

Referenced by activeProducts().

## ◆ productType()

eZProduct::productType | ( |  | $price = `""` | ) |

Returns the product type.

1 = normal product 2 = voucher

Definition at line 901 of file ezproduct.php.

References $ProductType.

## ◆ remoteID()

& eZProduct::remoteID | ( |  | ) |

Returns the remote ID of the product.

Definition at line 404 of file ezproduct.php.

References $RemoteID.

## ◆ removeFromCategories()

eZProduct::removeFromCategories | ( |  | ) |

Removes every category assignments from the current product.

Definition at line 2182 of file ezproduct.php.

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

## ◆ removeType()

eZProduct::removeType | ( |  | ) |

Removes the products type definition.

Definition at line 2351 of file ezproduct.php.

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

## ◆ setBoxType()

eZProduct::setBoxType | ( |  | $type | ) |

Sets the box type.

Definition at line 2424 of file ezproduct.php.

References $db, $type, BoxTypeID(), and eZDB\globalDatabase().

## ◆ setBrief()

eZProduct::setBrief | ( |  | $value | ) |

Sets the brief description of the product.

Definition at line 1279 of file ezproduct.php.

## ◆ setCatalogNumber()

eZProduct::setCatalogNumber | ( |  | $value | ) |

Sets the catalog product number.

Definition at line 1318 of file ezproduct.php.

## ◆ setCategoryDefinition()

eZProduct::setCategoryDefinition | ( |  | $value | ) |

Set's the products defined category. This is the main category for the product. Additional categories can be added with eZProductCategory::addProduct();

Definition at line 2219 of file ezproduct.php.

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

## ◆ setContents()

eZProduct::setContents | ( |  | $value | ) |

Sets the XML contents of the product.

Definition at line 1294 of file ezproduct.php.

## ◆ setDescription()

eZProduct::setDescription | ( |  | $value | ) |

Sets the product description.

Definition at line 1287 of file ezproduct.php.

## ◆ setDiscontinued()

eZProduct::setDiscontinued | ( |  | $value | ) |

Sets the Discontinued value. This indicates that the product is no longer available. The product is still shown in the store.

Definition at line 1365 of file ezproduct.php.

References setType().

## ◆ setExpiryTime()

eZProduct::setExpiryTime | ( |  | $time | ) |

Sets the expiry time for this product

Definition at line 975 of file ezproduct.php.

References $time.

## ◆ setExternalLink()

eZProduct::setExternalLink | ( |  | $value | ) |

Sets the external link.

Definition at line 1374 of file ezproduct.php.

## ◆ setFlatCombine()

eZProduct::setFlatCombine | ( |  | $value | ) |

Sets bool indicating if the flat-shipped product will combine shipping when purchased with other products.

Definition at line 1422 of file ezproduct.php.

## ◆ setFlatUPS()

eZProduct::setFlatUPS | ( |  | $value | ) |

Sets Flat UPS shipping (price or off)

Definition at line 1406 of file ezproduct.php.

## ◆ setFlatUSPS()

eZProduct::setFlatUSPS | ( |  | $value | ) |

Sets Flat USPS shipping (price or off)

Definition at line 1414 of file ezproduct.php.

## ◆ setIncludesVAT()

eZProduct::setIncludesVAT | ( |  | $inValue = `true` | ) |

Set the "includes vat" status. If true, the price stored in the database includes vat, if false the price stored exlcudes vat.

This value must be checked and the correct values computed based on the state.

Definition at line 2575 of file ezproduct.php.

## ◆ setIsHotDeal()

eZProduct::setIsHotDeal | ( |  | $value | ) |

Set the product to be a hot deal or not. True makes the product a hot deal, false it it just as an ordinary product.

Definition at line 1392 of file ezproduct.php.

## ◆ setKeywords()

eZProduct::setKeywords | ( |  | $value | ) |

Sets the keywords.

Definition at line 1302 of file ezproduct.php.

## ◆ setListPrice()

eZProduct::setListPrice | ( |  | $value | ) |

Sets the product manufacturer's list price'.

Definition at line 1336 of file ezproduct.php.

References setType().

## ◆ setMainImage()

eZProduct::setMainImage | ( |  | $image | ) |

Sets the main image for the product.

The argument must be a eZImage object, or false to unset the main image.

Definition at line 1611 of file ezproduct.php.

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

## ◆ setName()

eZProduct::setName | ( |  | $value | ) |

Sets the product name.

Definition at line 1263 of file ezproduct.php.

References Name.

## ◆ setPrice()

eZProduct::setPrice | ( |  | $value | ) |

Sets the product number.

Definition at line 1326 of file ezproduct.php.

References setType().

## ◆ setProductNumber()

eZProduct::setProductNumber | ( |  | $value | ) |

Sets the product number.

Definition at line 1310 of file ezproduct.php.

## ◆ setProductType()

eZProduct::setProductType | ( |  | $type = `1` | ) |

Sets the product type.

1 = normal product 2 = voucher

Definition at line 928 of file ezproduct.php.

References $type.

## ◆ setRemoteID()

eZProduct::setRemoteID | ( |  | $remoteID | ) |

Sets the remote ID.

Definition at line 1271 of file ezproduct.php.

## ◆ setShippingGroup()

eZProduct::setShippingGroup | ( |  | $group | ) |

Sets the shipping group

Definition at line 2523 of file ezproduct.php.

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

## ◆ setShowPrice()

eZProduct::setShowPrice | ( |  | $value | ) |

Sets the ShowPrice value.

Definition at line 1346 of file ezproduct.php.

References setType().

## ◆ setShowProduct()

eZProduct::setShowProduct | ( |  | $value | ) |

Sets the ShowProduct value.

Definition at line 1355 of file ezproduct.php.

## ◆ setStockDate()

eZProduct::setStockDate | ( |  | $time | ) |

Sets the expiry time for this product

Definition at line 983 of file ezproduct.php.

References $time.

## ◆ setThumbnailImage()

eZProduct::setThumbnailImage | ( |  | $image | ) |

Sets the thumbnail image for the product.

The argument must be a eZImage object, or false to unset the thumbnail image.

Definition at line 1668 of file ezproduct.php.

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

## ◆ setTotalQuantity()

eZProduct::setTotalQuantity | ( |  | $quantity | ) |

Sets the total quantity of the product.

Definition at line 936 of file ezproduct.php.

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

## ◆ setType()

eZProduct::setType | ( |  | $type | ) |

Sets the products type.

Definition at line 2287 of file ezproduct.php.

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

Referenced by setDiscontinued(), setListPrice(), setPrice(), and setShowPrice().

## ◆ setVATType()

eZProduct::setVATType | ( |  | $type | ) |

Sets the VAT type.

Definition at line 2411 of file ezproduct.php.

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

## ◆ setWeight()

eZProduct::setWeight | ( |  | $value | ) |

Sets the product weight.

Definition at line 1382 of file ezproduct.php.

## ◆ shippingGroup()

& eZProduct::shippingGroup | ( |  | ) |

Returns the shipping group as a eZShippingGroup object.

False if no type is not assigned.

Definition at line 2539 of file ezproduct.php.

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

## ◆ showPrice()

eZProduct::showPrice | ( |  | ) |

Returns the ShowPrice value. The Price should not be shown if this value is false.

Definition at line 1200 of file ezproduct.php.

References $ShowPrice.

## ◆ showProduct()

eZProduct::showProduct | ( |  | ) |

Returns true if the product should be shown. False if not.

Definition at line 1209 of file ezproduct.php.

References $ShowProduct.

## ◆ stockDate()

eZProduct::stockDate | ( |  | ) |

Returns the products expected stock date

Definition at line 917 of file ezproduct.php.

References $StockDate.

## ◆ store()

eZProduct::store | ( |  | ) |

Stores a product to the database.

Definition at line 102 of file ezproduct.php.

References $contents, $db, $name, $price, $query, $res, eZDB\globalDatabase(), and Name.

## ◆ thumbnailImage()

eZProduct::thumbnailImage | ( |  | ) |

Returns the thumbnail image of the product as a eZImage object.

Definition at line 1751 of file ezproduct.php.

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

## ◆ totalQuantity()

eZProduct::totalQuantity | ( |  | $id = `false` | ) |
| static

Returns the total quantity of this product.

Definition at line 992 of file ezproduct.php.

References $db, $id, $ID, $row, and eZDB\globalDatabase().

Referenced by hasQuantity().

## ◆ type()

eZProduct::type | ( |  | ) |

Returns the product's type.

Definition at line 2330 of file ezproduct.php.

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

## ◆ vat()

& eZProduct::vat | ( |  | $price = `""` | ) |

Obsolete. Use addVAT() or extractVAT() instead.

Definition at line 830 of file ezproduct.php.

References $price, and extractVAT().

## ◆ vatPercentage()

eZProduct::vatPercentage | ( |  | ) |

Returns the VAT percentage of this product

Definition at line 820 of file ezproduct.php.

References vatType().

Referenced by correctPriceRange().

## ◆ vatType()

eZProduct::vatType | ( |  | ) |

Returns the VAT type.

False if no type is assigned.

Definition at line 2460 of file ezproduct.php.

References $country, $ini, $mainAddress, $region, $ret, $user, and eZUser\currentUser().

Referenced by addVAT(), correctPrice(), correctSavings(), extractVAT(), priceExVAT(), priceIncVAT(), and vatPercentage().

## ◆ voucher()

eZProduct::voucher | ( |  | ) |

Returns the voucher if this product is a voucher.

Definition at line 2793 of file ezproduct.php.

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

## ◆ voucherInformation()

eZProduct::voucherInformation | ( |  | ) |

Returns the voucher information if this product is a voucher.

Definition at line 2818 of file ezproduct.php.

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

## ◆ weight()

eZProduct::weight | ( |  | ) |

Returns the weight the product.

Definition at line 1236 of file ezproduct.php.

References $ini, and $Weight.

## Member Data Documentation

## ◆ $BoxTypeID

eZProduct::$BoxTypeID

Definition at line 3042 of file ezproduct.php.

Referenced by BoxTypeID().

## ◆ $Brief

eZProduct::$Brief

Definition at line 3029 of file ezproduct.php.

## ◆ $CatalogNumber

eZProduct::$CatalogNumber

Definition at line 3033 of file ezproduct.php.

## ◆ $Contents

eZProduct::$Contents

Definition at line 3028 of file ezproduct.php.

## ◆ $Description

eZProduct::$Description

Definition at line 3030 of file ezproduct.php.

## ◆ $Discontinued

eZProduct::$Discontinued

Definition at line 3036 of file ezproduct.php.

Referenced by discontinued().

## ◆ $ExpiryTime

eZProduct::$ExpiryTime

Definition at line 3047 of file ezproduct.php.

Referenced by expiryTime().

## ◆ $ExternalLink

eZProduct::$ExternalLink

Definition at line 3037 of file ezproduct.php.

## ◆ $FlatCombine

eZProduct::$FlatCombine

Definition at line 3053 of file ezproduct.php.

Referenced by flatCombine().

## ◆ $FlatDHL

eZProduct::$FlatDHL

Definition at line 3052 of file ezproduct.php.

## ◆ $FlatUPS

eZProduct::$FlatUPS

Definition at line 3050 of file ezproduct.php.

Referenced by flatUps().

## ◆ $FlatUSPS

eZProduct::$FlatUSPS

Definition at line 3051 of file ezproduct.php.

Referenced by flatUsps().

## ◆ $ID

eZProduct::$ID

Definition at line 3024 of file ezproduct.php.

Referenced by __construct(), addForm(), delete(), deleteForms(), forms(), hasQuantity(), id(), priceRange(), setTotalQuantity(), totalQuantity(), voucher(), and voucherInformation().

## ◆ $IncludesVAT

eZProduct::$IncludesVAT

Definition at line 3049 of file ezproduct.php.

## ◆ $IsHotDeal

eZProduct::$IsHotDeal

Definition at line 3038 of file ezproduct.php.

## ◆ $Keywords

eZProduct::$Keywords

Definition at line 3031 of file ezproduct.php.

## ◆ $ListPrice

eZProduct::$ListPrice

Definition at line 3046 of file ezproduct.php.

Referenced by listPrice().

## ◆ $Name

eZProduct::$Name

Definition at line 3025 of file ezproduct.php.

## ◆ $Price

eZProduct::$Price

Definition at line 3045 of file ezproduct.php.

Referenced by addVAT(), correctPrice(), correctSavings(), extractVAT(), price(), priceExVAT(), and priceIncVAT().

## ◆ $ProductNumber

eZProduct::$ProductNumber

Definition at line 3032 of file ezproduct.php.

## ◆ $ProductType

eZProduct::$ProductType

Definition at line 3044 of file ezproduct.php.

Referenced by productType().

## ◆ $RemoteID

eZProduct::$RemoteID

Definition at line 3040 of file ezproduct.php.

Referenced by remoteID().

## ◆ $ShippingGroupID

eZProduct::$ShippingGroupID

Definition at line 3043 of file ezproduct.php.

## ◆ $ShowPrice

eZProduct::$ShowPrice

Definition at line 3034 of file ezproduct.php.

Referenced by showPrice().

## ◆ $ShowProduct

eZProduct::$ShowProduct

Definition at line 3035 of file ezproduct.php.

Referenced by showProduct().

## ◆ $StockDate

eZProduct::$StockDate

Definition at line 3048 of file ezproduct.php.

Referenced by stockDate().

## ◆ $VATTypeID

eZProduct::$VATTypeID

Definition at line 3041 of file ezproduct.php.

## ◆ $Weight

eZProduct::$Weight

Definition at line 3039 of file ezproduct.php.

Referenced by weight().

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

- ezproduct.php

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