- Posts: 28
- Thank you received: 0
Add ordering field in product class object
- ruchikanagarkar
-
Topic Author
- Offline
Less
More
10 years 3 months ago #242663
by ruchikanagarkar
Add ordering field in product class object was created by ruchikanagarkar
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.5
Hi,
I want to fetch all the products from a selected category and display through my custom code. For this I referred here:
hikashop.com/support/documentation/62-hi...umentation.html#code
$productClass = hikashop_get('class.product');
$product=$productClass->get($product_id);
I want to know how can I add an ordering parameter here ? for example I want to display products from selected category. So, here I am passing the product id of all the fetched products but want to order them by product_name, product_id etc. or do I need to write the whole sql query for this?
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.5
Hi,
I want to fetch all the products from a selected category and display through my custom code. For this I referred here:
hikashop.com/support/documentation/62-hi...umentation.html#code
$productClass = hikashop_get('class.product');
$product=$productClass->get($product_id);
I want to know how can I add an ordering parameter here ? for example I want to display products from selected category. So, here I am passing the product id of all the fetched products but want to order them by product_name, product_id etc. or do I need to write the whole sql query for this?
Please Log in or Create an account to join the conversation.
10 years 3 months ago #242689
by nicolas
Replied by nicolas on topic Add ordering field in product class object
Hi,
There is a function to load the ids of all the products of a category but you can't tweak it to change the ordering.
The best is to write your own MySQL query.
There is a function to load the ids of all the products of a category but you can't tweak it to change the ordering.
The best is to write your own MySQL query.
Please Log in or Create an account to join the conversation.
Time to create page: 0.250 seconds