jdo38 Posted February 3, 2019 Share Posted February 3, 2019 (edited) hello all, This is my first post here : I hope I post on the appropriate forum, I hope I'll make my questions clear and thank you for your kindness ! Here is my problem (with PS 1.7.4) : In a .tpl, I need to retrieve a list of products based on a product’s « Feature » (and not on a product’s category, nor brand). In the administration, I have set up a feature called « collection », with various possible values, e.g. « Levis », etc. each product is tied to a collection’s value. Then, how could I get the list of all the product with a certain « collection » value (e.g. all the products that are in the Levi’s collection) ? In fact, I need something like the « ps_featuredproduct » module... but that does not use product’s category, but product’s "feature", to select the products. My questions are : Do you know a static method (that I could call from a smarty’s .tpl) that retrieves the list of products having a given « feature » set to a given feature’s value ? or do you know a (free or paid) module that would fullfil this need ? And finally : If I develop my own module, by hacking for example into ps_featured product, how could I write in the module's PHP the appropriate database query, to select all the product having a given « feature » set to a given value ? I hope my question is clear, and thank you A LOT in advance for your help, Jérémy Edited February 3, 2019 by jdo38 Tipo (see edit history) Link to comment Share on other sites More sharing options...
Presta Bucket Posted February 9, 2019 Share Posted February 9, 2019 Hello, For the last question, I think the query wanted is for example: $sql = "SELECT * from ps_featured_product WHERE `feature` LIKE '%feature%'". That you can execute with Db::getInstance()->executeS($sql); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now