ZenMagick 0.9.10


zenmagick.store.shared.model.catalog\ZMProduct
model\catalog\ZMProduct.php at line 33

Class ZMProduct

ZMObject
└─ZMProduct

public class ZMProduct
extends ZMObject

A product.

Author:
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_
Method Summary
void

__construct(int id, string name, string description)

Create new product.

array

getAdditionalImages()

Get additional product images.

array

getAttributes()

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(int languageId)

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.

int

getLanguageId()

Get the language id.

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(string 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

setLanguageId(int id)

Set the language id.

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
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Field Detail

model\catalog\ZMProduct.php at line 68

attributes_

public mixed $attributes_

model\catalog\ZMProduct.php at line 41

dateAdded_

public mixed $dateAdded_

model\catalog\ZMProduct.php at line 40

dateAvailable_

public mixed $dateAvailable_

model\catalog\ZMProduct.php at line 35

description_

public mixed $description_

model\catalog\ZMProduct.php at line 56

discountTypeFrom_

public mixed $discountTypeFrom_

model\catalog\ZMProduct.php at line 55

discountType_

public mixed $discountType_

model\catalog\ZMProduct.php at line 38

image_

public mixed $image_

model\catalog\ZMProduct.php at line 51

isAlwaysFreeShipping_

public mixed $isAlwaysFreeShipping_

model\catalog\ZMProduct.php at line 52

isCall_

public mixed $isCall_

model\catalog\ZMProduct.php at line 50

isFree_

public mixed $isFree_

model\catalog\ZMProduct.php at line 45

isQtyMixed_

public mixed $isQtyMixed_

model\catalog\ZMProduct.php at line 53

isVirtual_

public mixed $isVirtual_

model\catalog\ZMProduct.php at line 42

manufacturerId_

public mixed $manufacturerId_

model\catalog\ZMProduct.php at line 59

masterCategoryId_

public mixed $masterCategoryId_

model\catalog\ZMProduct.php at line 37

model_

public mixed $model_

model\catalog\ZMProduct.php at line 34

name_

public mixed $name_ = null

model\catalog\ZMProduct.php at line 69

offers_

public mixed $offers_

model\catalog\ZMProduct.php at line 57

priceSorter_

public mixed $priceSorter_

model\catalog\ZMProduct.php at line 58

pricedByAttributes_

public mixed $pricedByAttributes_

model\catalog\ZMProduct.php at line 64

productPrice_

public mixed $productPrice_

model\catalog\ZMProduct.php at line 46

qtyBoxStatus_

public mixed $qtyBoxStatus_

model\catalog\ZMProduct.php at line 48

qtyOrderMax_

public mixed $qtyOrderMax_

model\catalog\ZMProduct.php at line 47

qtyOrderMin_

public mixed $qtyOrderMin_

model\catalog\ZMProduct.php at line 49

qtyOrderUnits_

public mixed $qtyOrderUnits_

model\catalog\ZMProduct.php at line 44

quantity_

public mixed $quantity_

model\catalog\ZMProduct.php at line 60

sortOrder_

public mixed $sortOrder_

model\catalog\ZMProduct.php at line 65

specialPrice_

public mixed $specialPrice_

model\catalog\ZMProduct.php at line 36

status_

public mixed $status_

model\catalog\ZMProduct.php at line 54

taxClassId_

public mixed $taxClassId_

model\catalog\ZMProduct.php at line 39

url_

public mixed $url_

model\catalog\ZMProduct.php at line 43

weight_

public mixed $weight_

Method Detail

model\catalog\ZMProduct.php at line 79

__construct

public void __construct(int id, string name, string description)

Create new product.

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

model\catalog\ZMProduct.php at line 538

getAdditionalImages

public array getAdditionalImages()

Get additional product images.

Returns:
List of optional ZMImageInfo instances.

model\catalog\ZMProduct.php at line 504

getAttributes

public array getAttributes()

Get the product attributes.

Returns:
A list of {@link org.zenmagick.model.catalog.ZMAttribute ZMAttribute} instances.

model\catalog\ZMProduct.php at line 603

getAverageRating

public float getAverageRating()

Get the average rating.

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

Returns:
The average rating.

model\catalog\ZMProduct.php at line 214

getDateAdded

public string getDateAdded()

Get the date the product was added.

Returns:
The product added date.

model\catalog\ZMProduct.php at line 207

getDateAvailable

public string getDateAvailable()

Get the available date.

Returns:
The available date.

model\catalog\ZMProduct.php at line 589

getDefaultCategory

public ZMCategory getDefaultCategory(int languageId)

Get the default category.

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

Parameters:
languageId - The languageId; default is null for session setting.
Returns:
The default category.

model\catalog\ZMProduct.php at line 178

getDefaultImage

public string getDefaultImage()

Get the product default image.

Returns:
The default image.

model\catalog\ZMProduct.php at line 136

getDescription

public string getDescription()

Get the description.

Returns:
The product description.

model\catalog\ZMProduct.php at line 398

getDiscountType

public int getDiscountType()

Get the discount type.

Legal values:

Returns:
The discount type.

model\catalog\ZMProduct.php at line 411

getDiscountTypeFrom

public int getDiscountTypeFrom()

Get the discount type from.

Legal values:

Returns:
The discount type from.

model\catalog\ZMProduct.php at line 108

getId

public int getId()

Get the product id.

Returns:
The product id.

model\catalog\ZMProduct.php at line 531

getImage

public image getImage()

Get the product image.

Returns:
The product image.

model\catalog\ZMProduct.php at line 517

getImageInfo

public ZMImageInfo getImageInfo()

Get the product image info.

Returns:
The product image info.

model\catalog\ZMProduct.php at line 654

getLanguageId

public int getLanguageId()

Get the language id.

Returns:
The language id.

model\catalog\ZMProduct.php at line 235

getManufacturer

public ZMManufacturer getManufacturer()

Get the manufacturer.

Returns:
The manufacturer.

model\catalog\ZMProduct.php at line 221

getManufacturerId

public int getManufacturerId()

Get the manufacturer id.

Returns:
The manufacturer id.

model\catalog\ZMProduct.php at line 432

getMasterCategoryId

public int getMasterCategoryId()

Get the master category id.

Returns:
The master category id.

model\catalog\ZMProduct.php at line 293

getMaxOrderQty

public int getMaxOrderQty()

Get the max quantity per order.

Returns:
The max quantity per order.

model\catalog\ZMProduct.php at line 686

getMetaTagDetails

public ZMMetaTagDetails getMetaTagDetails(int languageId)

Get meta tag details if available.

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

model\catalog\ZMProduct.php at line 300

getMinOrderQty

public int getMinOrderQty()

Get the min quantity per order.

Returns:
The min quantity per order.

model\catalog\ZMProduct.php at line 164

getModel

public string getModel()

Get the model.

Returns:
The model.

model\catalog\ZMProduct.php at line 122

getName

public string getName()

Get the product name.

Returns:
The product name.

model\catalog\ZMProduct.php at line 484

getOffers

public ZMOffers getOffers()

Get the product offers.

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

model\catalog\ZMProduct.php at line 449

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.

model\catalog\ZMProduct.php at line 425

getPriceSorter

public float getPriceSorter()

Get the product price sorter.

Returns:
The price sorter.

model\catalog\ZMProduct.php at line 671

getProductAssociationsForType

public array getProductAssociationsForType(string 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 an empty array.
all - Optional flag to load all configured products, regardless of start/end date, etc; default is false.
Returns:
A list of ZMProductAssociation instances.

model\catalog\ZMProduct.php at line 456

getProductPrice

public float getProductPrice()

Get the product price.

Returns:
The product price.

model\catalog\ZMProduct.php at line 286

getQtyBoxStatus

public int getQtyBoxStatus()

Get the quantity box status.

Returns:
The quantity box status.

model\catalog\ZMProduct.php at line 307

getQtyOrderUnits

public float getQtyOrderUnits()

Get the quantity units.

Returns:
The quantity units.

model\catalog\ZMProduct.php at line 258

getQuantity

public int getQuantity()

Get the quantity.

Returns:
The quantity.

model\catalog\ZMProduct.php at line 564

getReviewCount

public int getReviewCount()

Get the number of reviews for this product.

Returns:
The number of reviews.

model\catalog\ZMProduct.php at line 612

getSortOrder

public int getSortOrder()

Get the srt order.

Returns:
The sort order.

model\catalog\ZMProduct.php at line 470

getSpecialPrice

public float getSpecialPrice()

Get the product special price.

Returns:
The product special price.

model\catalog\ZMProduct.php at line 150

getStatus

public boolean getStatus()

Get the product status.

Returns:
The product status.

model\catalog\ZMProduct.php at line 376

getTaxClassId

public int getTaxClassId()

Get the tax class id.

Returns:
The tax class id.

model\catalog\ZMProduct.php at line 418

getTaxRate

public ZMTaxRate getTaxRate()

Get the tax rate.

Returns:
The tax rate.

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.

model\catalog\ZMProduct.php at line 194

getUrl

public string getUrl()

Get the product url.

Returns:
The product url.

model\catalog\ZMProduct.php at line 244

getWeight

public float getWeight()

Get the product weight.

Returns:
The weight.

model\catalog\ZMProduct.php at line 497

hasAttributes

public boolean hasAttributes()

Check if this product has attributes or not.

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

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.

model\catalog\ZMProduct.php at line 349

isAlwaysFreeShipping

public boolean isAlwaysFreeShipping()

Checks if the product is always free shipping

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

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

model\catalog\ZMProduct.php at line 363

isCall

public boolean isCall()

Checks if the user needs to call for this product.

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

model\catalog\ZMProduct.php at line 321

isFree

public boolean isFree()

Checks if the product is free.

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

model\catalog\ZMProduct.php at line 633

isPricedByAttributes

public boolean isPricedByAttributes()

Check if the product is priced by attributes.

Returns:
true if priced by attributes.

model\catalog\ZMProduct.php at line 272

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.

model\catalog\ZMProduct.php at line 279

isSoldOut

public boolean isSoldOut()

Checks if the product is sold out.

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

model\catalog\ZMProduct.php at line 335

isVirtual

public boolean isVirtual()

Checks if the product is virtual.

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

model\catalog\ZMProduct.php at line 356

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.

model\catalog\ZMProduct.php at line 370

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.

model\catalog\ZMProduct.php at line 187

setDefaultImage

public void setDefaultImage(string image)

Set the product default image.

Parameters:
image - The default image.

model\catalog\ZMProduct.php at line 143

setDescription

public void setDescription(string description)

Set the description.

Parameters:
description - The product description.

model\catalog\ZMProduct.php at line 640

setDiscountType

public void setDiscountType(int type)

Set the discount type.

Parameters:
type - The discount type.

model\catalog\ZMProduct.php at line 647

setDiscountTypeFrom

public void setDiscountTypeFrom(mixed typeFrom, int The)

Set the discount type from.

Parameters:
The - discount type from.

model\catalog\ZMProduct.php at line 328

setFree

public void setFree(boolean value)

Set the product is free flag.

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

model\catalog\ZMProduct.php at line 115

setId

public void setId(int id)

Set the product id.

Parameters:
id - The product id.

model\catalog\ZMProduct.php at line 524

setImage

public void setImage(string image)

Set the product image.

Parameters:
image - The product image.

model\catalog\ZMProduct.php at line 661

setLanguageId

public void setLanguageId(int id)

Set the language id.

Parameters:
id - The language id.

model\catalog\ZMProduct.php at line 228

setManufacturerId

public void setManufacturerId(int manufacturerId)

Set the manufacturer id.

Parameters:
manufacturerId - The manufacturer id.

model\catalog\ZMProduct.php at line 439

setMasterCategoryId

public void setMasterCategoryId(int categoryId)

Set the master category id.

Parameters:
categoryId - The master category id.

model\catalog\ZMProduct.php at line 171

setModel

public void setModel(string model)

Set the model.

Parameters:
model - The model.

model\catalog\ZMProduct.php at line 129

setName

public void setName(string name)

Set the product name.

Parameters:
name - The product name.

model\catalog\ZMProduct.php at line 626

setPricedByAttributes

public void setPricedByAttributes(boolean value)

Set the priced by attributes flag.

Parameters:
value - The new value.

model\catalog\ZMProduct.php at line 463

setProductPrice

public void setProductPrice(float productPrice)

Set the product price.

Parameters:
productPrice - The product price.

model\catalog\ZMProduct.php at line 314

setQtyOrderUnits

public void setQtyOrderUnits(float value)

Set the quantity units.

Parameters:
value - The quantity units value.

model\catalog\ZMProduct.php at line 265

setQuantity

public void setQuantity(int quantity)

Set the quantity.

Parameters:
quantity - The quantity.

model\catalog\ZMProduct.php at line 619

setSortOrder

public void setSortOrder(int sortOrder)

Set the sort order.

Parameters:
sortOrder - The sort order.

model\catalog\ZMProduct.php at line 477

setSpecialPrice

public void setSpecialPrice(float specialPrice)

Set the product special price.

Parameters:
specialPrice - The product special price.

model\catalog\ZMProduct.php at line 157

setStatus

public void setStatus(boolean status)

Set the product status.

Parameters:
status - The product status.

model\catalog\ZMProduct.php at line 383

setTaxClassId

public void setTaxClassId(int taxClassId)

Set the tax class id.

Parameters:
taxClassId - The tax class id.

model\catalog\ZMProduct.php at line 201

setUrl

public void setUrl(string url)

Set the product url.

Parameters:
url - The product url.

model\catalog\ZMProduct.php at line 342

setVirtual

public void setVirtual(boolean value)

Set the product is virtual flag.

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

model\catalog\ZMProduct.php at line 251

setWeight

public void setWeight(float weight)

Set the product weight.

Parameters:
weight - The weight.

ZenMagick 0.9.10