ZenMagick 0.9.8


org.zenmagick.store.model.catalog.ZMProduct
\store\model\catalog\ZMProduct.php at line 34

Class ZMProduct

ZMObject
└─ZMProduct

public class ZMProduct
extends ZMObject

A product.

Author:
DerManoMann
Version:
$Id: ZMProduct.php 2777 2009-12-23 22:04:20Z dermanomann $

Field Summary
mixed

$attributes_

mixed

$dateAdded_

mixed

$dateAvailable_

mixed

$description_

mixed

$discountTypeFrom_

mixed

$discountType_

mixed

$image_

mixed

$isAlwaysFreeShipping_

mixed

$isCall_

mixed

$isFree_

mixed

$isQtyMixed_

mixed

$isVirtual_

mixed

$manufacturerId_

mixed

$masterCategoryId_

mixed

$model_

mixed

$name_

mixed

$offers_

mixed

$priceSorter_

mixed

$pricedByAttributes_

mixed

$productPrice_

mixed

$qtyBoxStatus_

mixed

$qtyOrderMax_

mixed

$qtyOrderMin_

mixed

$qtyOrderUnits_

mixed

$quantity_

mixed

$sortOrder_

mixed

$specialPrice_

mixed

$status_

mixed

$taxClassId_

mixed

$url_

mixed

$weight_

Fields inherited from org.zenmagick.core.ZMObject
properties_
Constructor Summary

ZMProduct(int id, string name, string description)

Create new product.

Method Summary
array

getAdditionalImages()

Get additional product images.

array

getAttributes(int languageId)

Get the product attributes.

float

getAverageRating()

Get the average rating.

string

getDateAdded()

Get the date the product was added.

string

getDateAvailable()

Get the available date.

ZMCategory

getDefaultCategory()

Get the default category.

string

getDefaultImage()

Get the product default image.

string

getDescription()

Get the description.

int

getDiscountType()

Get the discount type.

int

getDiscountTypeFrom()

Get the discount type from.

int

getId()

Get the product id.

image

getImage()

Get the product image.

ZMImageInfo

getImageInfo()

Get the product image info.

ZMManufacturer

getManufacturer()

Get the manufacturer.

int

getManufacturerId()

Get the manufacturer id.

int

getMasterCategoryId()

Get the master category id.

int

getMaxOrderQty()

Get the max quantity per order.

ZMMetaTagDetails

getMetaTagDetails(int languageId)

Get meta tag details if available.

int

getMinOrderQty()

Get the min quantity per order.

string

getModel()

Get the model.

string

getName()

Get the product name.

ZMOffers

getOffers()

Get the product offers.

float

getPrice()

Get the calculated product price.

float

getPriceSorter()

Get the product price sorter.

array

getProductAssociationsForType(int type, array args, boolean all)

Get product associations for the given type and parameter.

float

getProductPrice()

Get the product price.

int

getQtyBoxStatus()

Get the quantity box status.

float

getQtyOrderUnits()

Get the quantity units.

int

getQuantity()

Get the quantity.

int

getReviewCount()

Get the number of reviews for this product.

int

getSortOrder()

Get the srt order.

float

getSpecialPrice()

Get the product special price.

boolean

getStatus()

Get the product status.

int

getTaxClassId()

Get the tax class id.

ZMTaxRate

getTaxRate()

Get the tax rate.

mixed

getTypeSetting(string field)

Get the product type config values for this product.

string

getUrl()

Get the product url.

float

getWeight()

Get the product weight.

boolean

hasAttributes()

Check if this product has attributes or not.

boolean

hasReviews()

Checks if reviews exist for this product.

boolean

isAlwaysFreeShipping()

Checks if the product is always free shipping

boolean

isAttributePrice()

Checks if the price is affected by attribute prices.

boolean

isCall()

Checks if the user needs to call for this product.

boolean

isFree()

Checks if the product is free.

boolean

isPricedByAttributes()

Check if the product is priced by attributes.

boolean

isQtyMixed()

Checks if the product quantity is calculated across product variations or not.

boolean

isSoldOut()

Checks if the product is sold out.

boolean

isVirtual()

Checks if the product is virtual.

void

setAlwaysFreeShipping(boolean b)

Configure if the product is always free shipping

void

setCall(boolean value)

Sets the flag to indicate that the user needs to call for this product.

void

setDefaultImage(string image)

Set the product default image.

void

setDescription(string description)

Set the description.

void

setDiscountType(int type)

Set the discount type.

void

setDiscountTypeFrom(mixed typeFrom, int The)

Set the discount type from.

void

setFree(boolean value)

Set the product is free flag.

void

setId(int id)

Set the product id.

void

setImage(string image)

Set the product image.

void

setManufacturerId(int manufacturerId)

Set the manufacturer id.

void

setMasterCategoryId(int categoryId)

Set the master category id.

void

setModel(string model)

Set the model.

void

setName(string name)

Set the product name.

void

setPricedByAttributes(boolean value)

Set the priced by attributes flag.

void

setProductPrice(float productPrice)

Set the product price.

void

setQtyOrderUnits(float value)

Set the quantity units.

void

setQuantity(int quantity)

Set the quantity.

void

setSortOrder(int sortOrder)

Set the sort order.

void

setSpecialPrice(float specialPrice)

Set the product special price.

void

setStatus(boolean status)

Set the product status.

void

setTaxClassId(int taxClassId)

Set the tax class id.

void

setUrl(string url)

Set the product url.

void

setVirtual(boolean value)

Set the product is virtual flag.

void

setWeight(float weight)

Set the product weight.

Methods inherited from org.zenmagick.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Field Detail

\store\model\catalog\ZMProduct.php at line 68

attributes_

public mixed $attributes_

\store\model\catalog\ZMProduct.php at line 42

dateAdded_

public mixed $dateAdded_

\store\model\catalog\ZMProduct.php at line 41

dateAvailable_

public mixed $dateAvailable_

\store\model\catalog\ZMProduct.php at line 36

description_

public mixed $description_

\store\model\catalog\ZMProduct.php at line 57

discountTypeFrom_

public mixed $discountTypeFrom_

\store\model\catalog\ZMProduct.php at line 56

discountType_

public mixed $discountType_

\store\model\catalog\ZMProduct.php at line 39

image_

public mixed $image_

\store\model\catalog\ZMProduct.php at line 52

isAlwaysFreeShipping_

public mixed $isAlwaysFreeShipping_

\store\model\catalog\ZMProduct.php at line 53

isCall_

public mixed $isCall_

\store\model\catalog\ZMProduct.php at line 51

isFree_

public mixed $isFree_

\store\model\catalog\ZMProduct.php at line 46

isQtyMixed_

public mixed $isQtyMixed_

\store\model\catalog\ZMProduct.php at line 54

isVirtual_

public mixed $isVirtual_

\store\model\catalog\ZMProduct.php at line 43

manufacturerId_

public mixed $manufacturerId_

\store\model\catalog\ZMProduct.php at line 60

masterCategoryId_

public mixed $masterCategoryId_

\store\model\catalog\ZMProduct.php at line 38

model_

public mixed $model_

\store\model\catalog\ZMProduct.php at line 35

name_

public mixed $name_

\store\model\catalog\ZMProduct.php at line 69

offers_

public mixed $offers_

\store\model\catalog\ZMProduct.php at line 58

priceSorter_

public mixed $priceSorter_

\store\model\catalog\ZMProduct.php at line 59

pricedByAttributes_

public mixed $pricedByAttributes_

\store\model\catalog\ZMProduct.php at line 64

productPrice_

public mixed $productPrice_

\store\model\catalog\ZMProduct.php at line 47

qtyBoxStatus_

public mixed $qtyBoxStatus_

\store\model\catalog\ZMProduct.php at line 49

qtyOrderMax_

public mixed $qtyOrderMax_

\store\model\catalog\ZMProduct.php at line 48

qtyOrderMin_

public mixed $qtyOrderMin_

\store\model\catalog\ZMProduct.php at line 50

qtyOrderUnits_

public mixed $qtyOrderUnits_

\store\model\catalog\ZMProduct.php at line 45

quantity_

public mixed $quantity_

\store\model\catalog\ZMProduct.php at line 61

sortOrder_

public mixed $sortOrder_

\store\model\catalog\ZMProduct.php at line 65

specialPrice_

public mixed $specialPrice_

\store\model\catalog\ZMProduct.php at line 37

status_

public mixed $status_

\store\model\catalog\ZMProduct.php at line 55

taxClassId_

public mixed $taxClassId_

\store\model\catalog\ZMProduct.php at line 40

url_

public mixed $url_

\store\model\catalog\ZMProduct.php at line 44

weight_

public mixed $weight_

Constructor Detail

\store\model\catalog\ZMProduct.php at line 79

ZMProduct

public ZMProduct(int id, string name, string description)

Create new product.

Parameters:
id - The product id.
name - The product name.
description - The product description.

Method Detail

\store\model\catalog\ZMProduct.php at line 538

getAdditionalImages

public array getAdditionalImages()

Get additional product images.

Returns:
List of optional ZMImageInfo instances.

\store\model\catalog\ZMProduct.php at line 504

getAttributes

public array getAttributes(int languageId)

Get the product attributes.

Parameters:
languageId - The languageId; default is null for session language.
Returns:
A list of {@link org.zenmagick.model.catalog.ZMAttribute ZMAttribute} instances.

\store\model\catalog\ZMProduct.php at line 600

getAverageRating

public float getAverageRating()

Get the average rating.

Convenience method for ZMReviews::instance()->getAverageRatingForProductId($product->getId()).

Returns:
The average rating.

\store\model\catalog\ZMProduct.php at line 213

getDateAdded

public string getDateAdded()

Get the date the product was added.

Returns:
The product added date.

\store\model\catalog\ZMProduct.php at line 206

getDateAvailable

public string getDateAvailable()

Get the available date.

Returns:
The available date.

\store\model\catalog\ZMProduct.php at line 588

getDefaultCategory

public ZMCategory getDefaultCategory()

Get the default category.

This will return either the master category or the first mapped category for this product.

Returns:
The default category.

\store\model\catalog\ZMProduct.php at line 177

getDefaultImage

public string getDefaultImage()

Get the product default image.

Returns:
The default image.

\store\model\catalog\ZMProduct.php at line 135

getDescription

public string getDescription()

Get the description.

Returns:
The product description.

\store\model\catalog\ZMProduct.php at line 397

getDiscountType

public int getDiscountType()

Get the discount type.

Legal values:

Returns:
The discount type.

\store\model\catalog\ZMProduct.php at line 410

getDiscountTypeFrom

public int getDiscountTypeFrom()

Get the discount type from.

Legal values:

Returns:
The discount type from.

\store\model\catalog\ZMProduct.php at line 107

getId

public int getId()

Get the product id.

Returns:
The product id.

\store\model\catalog\ZMProduct.php at line 531

getImage

public image getImage()

Get the product image.

Returns:
The product image.

\store\model\catalog\ZMProduct.php at line 517

getImageInfo

public ZMImageInfo getImageInfo()

Get the product image info.

Returns:
The product image info.

\store\model\catalog\ZMProduct.php at line 234

getManufacturer

public ZMManufacturer getManufacturer()

Get the manufacturer.

Returns:
The manufacturer.

\store\model\catalog\ZMProduct.php at line 220

getManufacturerId

public int getManufacturerId()

Get the manufacturer id.

Returns:
The manufacturer id.

\store\model\catalog\ZMProduct.php at line 431

getMasterCategoryId

public int getMasterCategoryId()

Get the master category id.

Returns:
The master category id.

\store\model\catalog\ZMProduct.php at line 292

getMaxOrderQty

public int getMaxOrderQty()

Get the max quantity per order.

Returns:
The max quantity per order.

\store\model\catalog\ZMProduct.php at line 665

getMetaTagDetails

public ZMMetaTagDetails getMetaTagDetails(int languageId)

Get meta tag details if available.

Parameters:
languageId - The language id.
Returns:
The details or null.

\store\model\catalog\ZMProduct.php at line 299

getMinOrderQty

public int getMinOrderQty()

Get the min quantity per order.

Returns:
The min quantity per order.

\store\model\catalog\ZMProduct.php at line 163

getModel

public string getModel()

Get the model.

Returns:
The model.

\store\model\catalog\ZMProduct.php at line 121

getName

public string getName()

Get the product name.

Returns:
The product name.

\store\model\catalog\ZMProduct.php at line 483

getOffers

public ZMOffers getOffers()

Get the product offers.

Returns:
The offers (if any), for this product.

\store\model\catalog\ZMProduct.php at line 448

getPrice

public float getPrice()

Get the calculated product price.

This is the same as getOffers->getCalculatedPrice(). This also means this method will always include TAX.

Returns:
The product price.

\store\model\catalog\ZMProduct.php at line 424

getPriceSorter

public float getPriceSorter()

Get the product price sorter.

Returns:
The price sorter.

\store\model\catalog\ZMProduct.php at line 654

getProductAssociationsForType

public array getProductAssociationsForType(int type, array args, boolean all)

Get product associations for the given type and parameter.

Parameters:
type - The association type.
args - Optional parameter that might be required by the used type; default is null for none.
all - Optional flag to load all configured products, regardless of start/end date, etc; default is false.
Returns:
A list of ZMProductAssociation instances.

\store\model\catalog\ZMProduct.php at line 455

getProductPrice

public float getProductPrice()

Get the product price.

Returns:
The product price.

\store\model\catalog\ZMProduct.php at line 285

getQtyBoxStatus

public int getQtyBoxStatus()

Get the quantity box status.

Returns:
The quantity box status.

\store\model\catalog\ZMProduct.php at line 306

getQtyOrderUnits

public float getQtyOrderUnits()

Get the quantity units.

Returns:
The quantity units.

\store\model\catalog\ZMProduct.php at line 257

getQuantity

public int getQuantity()

Get the quantity.

Returns:
The quantity.

\store\model\catalog\ZMProduct.php at line 564

getReviewCount

public int getReviewCount()

Get the number of reviews for this product.

Returns:
The number of reviews.

\store\model\catalog\ZMProduct.php at line 609

getSortOrder

public int getSortOrder()

Get the srt order.

Returns:
The sort order.

\store\model\catalog\ZMProduct.php at line 469

getSpecialPrice

public float getSpecialPrice()

Get the product special price.

Returns:
The product special price.

\store\model\catalog\ZMProduct.php at line 149

getStatus

public boolean getStatus()

Get the product status.

Returns:
The product status.

\store\model\catalog\ZMProduct.php at line 375

getTaxClassId

public int getTaxClassId()

Get the tax class id.

Returns:
The tax class id.

\store\model\catalog\ZMProduct.php at line 417

getTaxRate

public ZMTaxRate getTaxRate()

Get the tax rate.

Returns:
The tax rate.

\store\model\catalog\ZMProduct.php at line 576

getTypeSetting

public mixed getTypeSetting(string field)

Get the product type config values for this product.

This corresponds to the 'Catalog' -> 'Product Type' settings in the admin interface.

Parameters:
field - The field name.
Returns:
The setting value.

\store\model\catalog\ZMProduct.php at line 193

getUrl

public string getUrl()

Get the product url.

Returns:
The product url.

\store\model\catalog\ZMProduct.php at line 243

getWeight

public float getWeight()

Get the product weight.

Returns:
The weight.

\store\model\catalog\ZMProduct.php at line 496

hasAttributes

public boolean hasAttributes()

Check if this product has attributes or not.

Returns:
true if there are attributes (values) available, false if not.

\store\model\catalog\ZMProduct.php at line 555

hasReviews

public boolean hasReviews()

Checks if reviews exist for this product.

Returns:
true if reviews exist, false if not.

\store\model\catalog\ZMProduct.php at line 348

isAlwaysFreeShipping

public boolean isAlwaysFreeShipping()

Checks if the product is always free shipping

Returns:
true if the product is free shipping, false if not.

\store\model\catalog\ZMProduct.php at line 547

isAttributePrice

public boolean isAttributePrice()

Checks if the price is affected by attribute prices.

Returns:
true if the price is affected by attributes, false if not.
Deprecated:
use ZMOffers::isAttributePrice() instead

\store\model\catalog\ZMProduct.php at line 362

isCall

public boolean isCall()

Checks if the user needs to call for this product.

Returns:
true if the user must call, false if not.

\store\model\catalog\ZMProduct.php at line 320

isFree

public boolean isFree()

Checks if the product is free.

Returns:
true if the product is free, false if not.

\store\model\catalog\ZMProduct.php at line 630

isPricedByAttributes

public boolean isPricedByAttributes()

Check if the product is priced by attributes.

Returns:
true if priced by attributes.

\store\model\catalog\ZMProduct.php at line 271

isQtyMixed

public boolean isQtyMixed()

Checks if the product quantity is calculated across product variations or not.

Returns:
true if the quantity is calculated across variations, false if not.

\store\model\catalog\ZMProduct.php at line 278

isSoldOut

public boolean isSoldOut()

Checks if the product is sold out.

Returns:
true if the product is sold out, false if not.

\store\model\catalog\ZMProduct.php at line 334

isVirtual

public boolean isVirtual()

Checks if the product is virtual.

Returns:
true if the product is virtual, false if not.

\store\model\catalog\ZMProduct.php at line 355

setAlwaysFreeShipping

public void setAlwaysFreeShipping(boolean b)

Configure if the product is always free shipping

Parameters:
b - true if the product is free shipping, false if not.

\store\model\catalog\ZMProduct.php at line 369

setCall

public void setCall(boolean value)

Sets the flag to indicate that the user needs to call for this product.

Parameters:
value - true if the user must call, false if not.

\store\model\catalog\ZMProduct.php at line 186

setDefaultImage

public void setDefaultImage(string image)

Set the product default image.

Parameters:
image - The default image.

\store\model\catalog\ZMProduct.php at line 142

setDescription

public void setDescription(string description)

Set the description.

Parameters:
description - The product description.

\store\model\catalog\ZMProduct.php at line 637

setDiscountType

public void setDiscountType(int type)

Set the discount type.

Parameters:
type - The discount type.

\store\model\catalog\ZMProduct.php at line 644

setDiscountTypeFrom

public void setDiscountTypeFrom(mixed typeFrom, int The)

Set the discount type from.

Parameters:
The - discount type from.

\store\model\catalog\ZMProduct.php at line 327

setFree

public void setFree(boolean value)

Set the product is free flag.

Parameters:
value - true if the product is free, false if not.

\store\model\catalog\ZMProduct.php at line 114

setId

public void setId(int id)

Set the product id.

Parameters:
id - The product id.

\store\model\catalog\ZMProduct.php at line 524

setImage

public void setImage(string image)

Set the product image.

Parameters:
image - The product image.

\store\model\catalog\ZMProduct.php at line 227

setManufacturerId

public void setManufacturerId(int manufacturerId)

Set the manufacturer id.

Parameters:
manufacturerId - The manufacturer id.

\store\model\catalog\ZMProduct.php at line 438

setMasterCategoryId

public void setMasterCategoryId(int categoryId)

Set the master category id.

Parameters:
categoryId - The master category id.

\store\model\catalog\ZMProduct.php at line 170

setModel

public void setModel(string model)

Set the model.

Parameters:
model - The model.

\store\model\catalog\ZMProduct.php at line 128

setName

public void setName(string name)

Set the product name.

Parameters:
name - The product name.

\store\model\catalog\ZMProduct.php at line 623

setPricedByAttributes

public void setPricedByAttributes(boolean value)

Set the priced by attributes flag.

Parameters:
value - The new value.

\store\model\catalog\ZMProduct.php at line 462

setProductPrice

public void setProductPrice(float productPrice)

Set the product price.

Parameters:
productPrice - The product price.

\store\model\catalog\ZMProduct.php at line 313

setQtyOrderUnits

public void setQtyOrderUnits(float value)

Set the quantity units.

Parameters:
value - The quantity units value.

\store\model\catalog\ZMProduct.php at line 264

setQuantity

public void setQuantity(int quantity)

Set the quantity.

Parameters:
quantity - The quantity.

\store\model\catalog\ZMProduct.php at line 616

setSortOrder

public void setSortOrder(int sortOrder)

Set the sort order.

Parameters:
sortOrder - The sort order.

\store\model\catalog\ZMProduct.php at line 476

setSpecialPrice

public void setSpecialPrice(float specialPrice)

Set the product special price.

Parameters:
specialPrice - The product special price.

\store\model\catalog\ZMProduct.php at line 156

setStatus

public void setStatus(boolean status)

Set the product status.

Parameters:
status - The product status.

\store\model\catalog\ZMProduct.php at line 382

setTaxClassId

public void setTaxClassId(int taxClassId)

Set the tax class id.

Parameters:
taxClassId - The tax class id.

\store\model\catalog\ZMProduct.php at line 200

setUrl

public void setUrl(string url)

Set the product url.

Parameters:
url - The product url.

\store\model\catalog\ZMProduct.php at line 341

setVirtual

public void setVirtual(boolean value)

Set the product is virtual flag.

Parameters:
value - true if the product is virtual, false if not.

\store\model\catalog\ZMProduct.php at line 250

setWeight

public void setWeight(float weight)

Set the product weight.

Parameters:
weight - The weight.

ZenMagick 0.9.8