ZMObject
|
+--ZMProducts
public class ZMProducts
extends ZMObject
| Constructor Summary | |
|---|---|
Create new instance. |
|
| Method Summary | |
|---|---|
| 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. |
| 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, int languageId) Get list of all active product ids for a given category. |
| boolean | getProductTypeSetting(int productId, string field, mixed keyPprefix, string keySuffix, string fieldPrefix, string fieldSuffix, string keyPrefix) Test if a given product type option is enabled for a given product. |
| array | getProducts(boolean active, int languageId) Get all products. |
| array | getProductsForCategoryId(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, mixed active, mixed languageId) |
| array | getProductsForSQL(string sql, int languageId) Execute the given SQL and return the resulting product. |
| 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.ZMObject | |
|---|---|
| backtrace, create, log, singleton | |
public ZMProducts()
Create new instance. /
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 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, 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.null for session language.public boolean getProductTypeSetting(int productId, string field, mixed 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 getProducts(boolean active, int languageId)
Get all products.
true return only active products; default is true.null for session language.ZMProduct instances.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.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, mixed 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 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 not all properties are supported!
public void updateViewCount(int productId, int languageId)
Update the view count for a product.
null for session language.
Product access.