Hello Everyone,
Can somebody help me? I want to get the products of a specific category using a catalog function, something like: fn_get_category_products. Which function I've got to use?
Where can I found the api documentation?
Another question:
Is possible to display a block calling some function in a tpl file?
Another one, I have seen the js/tabs.js Does anyone have any example of how to use this javascript?
Thank you for your help!
function cat_products($cat_id) {
return db_get_fields("SELECT product_id FROM ?:products_categories WHERE category_id=?i", $cat_id);
}
There is NO api documentation. There really is NO api. It can change on a whim from version to version. Most general functions in the core directory are fairly stable though. New functionality is usually added as new parameters with default values or via a $params argument…
You can call PHP functions from tpl files but it is really NOT a correct way of doing things (other than for like counts, string coversion, etc.). See the Smarty documentation on variable modifiers.
Is there a easy way?
In the products_category table there is only the product id, there aren't the options, the values for the options, etc.
There is no a simple way to get all the product data?
@jdivins
After you get the product ids as suggested by tbirnseth, you need to run the following function to get the product details :
function fn_get_product_data($product_id,$auth) // without auth param nothing is returned
Thank you shikhar!
Can i get only the selected features to simplify the data collection?
Now i get for each product all the available features and a field selected that mark the feature selected.
Thanks for all your help
No you cannot, you can either turn off the feature values with $features = false or get all of them.
function fn_get_product_data($product_id, &$auth, $lang_code = CART_LANGUAGE, $field_list = '', $get_add_pairs = true, $get_main_pair = true, $get_taxes = true, $get_qty_discounts = false, $preview = false, $features = true)
Ok!
Thank you very much shikhar!
Out of topic…
Somebody know if there is a simple method to display the product buy page into a light box pop-up?
Thank you!
[quote name='jdivins' timestamp='1325162527' post='128625']
Out of topic…
Somebody know if there is a simple method to display the product buy page into a light box pop-up?
Thank you!
[/quote]
something like product quick view ?
Mmmmm…
Yes, something like that…
Actually when you click buy article appears a lightbox div, but inside there is only a ok button to confirm add to a cart.
The products I use need to select a final option before put on cart, and this is why I need this interaction