ZMObject
└─ZMProducts
public class ZMProducts
extends ZMObject
| Constant Summary | |
|---|---|
| final static str | |
| final static str | |
| final static str | |
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| void | Create new instance. |
| array | getAllProducts(boolean active, int languageId) Get all products. |
| protected ZMQueryDetails | getAllProductsQueryDetails(boolean active, int languageId) Get all products. |
| array | getBestSellers(int categoryId, int max, int languageId) Get best seller products. |
| array | getFeaturedProducts(int categoryId, int max, boolean includeChildren, int languageId) Get random featured products. |
| ZMMetaTagDetails | getMetaTagDetailsForId(int productId, int languageId) Get meta tag details for the given id and language. |
| array | getNewProducts(int categoryId, int max, int timeLimit, int languageId) Get random new products. |
| ZMProduct | getProductForId(int productId, int languageId) Get a product for the given product id. |
| ZMProduct | getProductForModel(string model, int languageId) Get a product for the given model name. |
| array | getProductIdsForCategoryId(int categoryId, boolean active, boolean includeChildren, int languageId) Get list of all active product ids for a given category. |
| boolean | getProductTypeSetting(int productId, string field, str keyPprefix, string keySuffix, string fieldPrefix, string fieldSuffix, string keyPrefix) Test if a given product type option is enabled for a given product. |
| array | getProductsForCategoryId(int categoryId, boolean active, int languageId) Get all (active) products for the given category id. |
| protected array | getProductsForCategoryIdQueryDetails(int categoryId, boolean active, int languageId) Get all (active) products for the given category id. |
| ZMProduct | getProductsForIds(array productIds, boolean preserveOrder, int languageId) Load a list of products. |
| void | getProductsForManufacturerId(mixed manufacturerId, bool active, mixed languageId) |
| array | getProductsForSQL(string sql, int languageId) Execute the given SQL and return the resulting product. |
| void | getQueryDetails(mixed method, mixed args) {@inheritDoc} |
| array | getSpecials(int max, int languageId) Get random products marked as specials. |
| static void | instance() Get instance. |
| boolean | isQuantityAvailable(int productId, int quantity) Check if a certain quantity of a given product is available. |
| ZMProduct | updateProduct(ZMProduct product) Update an existing product. |
| void | updateViewCount(int productId, int languageId) Update the view count for a product. |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public final static str IMAGE_LARGE = 'large'
public final static str IMAGE_MEDIUM = 'medium'
public final static str IMAGE_SMALL = 'small'
public void __construct()
Create new instance.
public array getAllProducts(boolean active, int languageId)
Get all products.
true return only active products; default is true.ZMProduct instances.protected ZMQueryDetails getAllProductsQueryDetails(boolean active, int languageId)
Get all products.
true return only active products; default is true.public array getBestSellers(int categoryId, int max, int languageId)
Get best seller products.
null for all.null to use the setting maxBestSellers.null for session language.ZMProduct instances.public array getFeaturedProducts(int categoryId, int max, boolean includeChildren, int languageId)
Get random featured products.
null for all.0 for all.false.null for session language.ZMProduct instances.public ZMMetaTagDetails getMetaTagDetailsForId(int productId, int languageId)
Get meta tag details for the given id and language.
null.public array getNewProducts(int categoryId, int max, int timeLimit, int languageId)
Get random new products.
null for all.0 for all.null for session language.ZMProduct instances.public ZMProduct getProductForId(int productId, int languageId)
Get a product for the given product id.
null for session language.null.public ZMProduct getProductForModel(string model, int languageId)
Get a product for the given model name.
null for session language.null.public array getProductIdsForCategoryId(int categoryId, boolean active, boolean includeChildren, int languageId)
Get list of all active product ids for a given category.
This is a faster version of getProductsForCategoryId(int). In addition,
this will ignore language preferences.
true return only active products; default is true.false.null for session language.public boolean getProductTypeSetting(int productId, string field, str keyPprefix, string keySuffix, string fieldPrefix, string fieldSuffix, string keyPrefix)
Test if a given product type option is enabled for a given product.
true if the specified type option is enabled, false if not.public array getProductsForCategoryId(int categoryId, boolean active, int languageId)
Get all (active) products for the given category id.
true return only active products; default is true.null for session language.ZMProduct instances.protected array getProductsForCategoryIdQueryDetails(int categoryId, boolean active, int languageId)
Get all (active) products for the given category id.
true return only active products; default is true.ZMProduct instances.public ZMProduct getProductsForIds(array productIds, boolean preserveOrder, int languageId)
Load a list of products.
false.null for session language.null.public void getProductsForManufacturerId(mixed manufacturerId, bool active, mixed languageId)
public array getProductsForSQL(string sql, int languageId)
Execute the given SQL and return the resulting product.
null for session language.ZMProduct instances.public void getQueryDetails(mixed method, mixed args)
public array getSpecials(int max, int languageId)
Get random products marked as specials.
null to use the setting maxSpecialProducts.null for session language.ZMProduct instances.public static void instance()
Get instance.
public boolean isQuantityAvailable(int productId, int quantity)
Check if a certain quantity of a given product is available.
true if the requested quantity is available, false if not.public ZMProduct updateProduct(ZMProduct product)
Update an existing product.
NOTE: Currently only the products table is updated!
public void updateViewCount(int productId, int languageId)
Update the view count for a product.
null for session language.
Product access.