- Posts: 46
- Thank you received: 2
next/previous feature and product ordering,
- saturnales
-
Topic Author
- Offline
Less
More
10 years 11 months ago - 10 years 11 months ago #218998
by saturnales
next/previous feature and product ordering, was created by saturnales
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
I tried to hide the out of stock products via the content-menu options, and it works quite fine on the products listing page.
But it seems that on the product page , when i use the "next product" or the "previous product" link, it still browse out of stock products...
In the same way, i have some trouble with he procucts order on the next/previous feature : On the content menu options i put the product orering to "product_created". Again it works fine on the products listing view but it is not supported by the next/previous ordering which still take the product_ID ordering
Any solution ?
Thanks
(please tranfer this message to the "product display" forum, i made a mistake)
-- Joomla version -- : 3.4.3
I tried to hide the out of stock products via the content-menu options, and it works quite fine on the products listing page.
But it seems that on the product page , when i use the "next product" or the "previous product" link, it still browse out of stock products...
In the same way, i have some trouble with he procucts order on the next/previous feature : On the content menu options i put the product orering to "product_created". Again it works fine on the products listing view but it is not supported by the next/previous ordering which still take the product_ID ordering
Any solution ?
Thanks
(please tranfer this message to the "product display" forum, i made a mistake)
Last edit: 10 years 11 months ago by saturnales.
Please Log in or Create an account to join the conversation.
10 years 11 months ago #219042
by nicolas
Replied by nicolas on topic next/previous feature and product ordering,
Hi,
1. You need to turn off the "show out of stock products" setting of the Hikashop configuration too as the product page next/previous buttons base themselves on it.
2. There is no option to change that.
You would have to change the line:
$query='SELECT DISTINCT a.product_id FROM '.hikashop_table('product_category').' AS a LEFT JOIN '.hikashop_table('product').' AS b ON a.product_id=b.product_id WHERE '.implode(' AND ',$filters).' GROUP BY a.product_id ORDER BY a.ordering ASC';
to:
$query='SELECT DISTINCT a.product_id FROM '.hikashop_table('product_category').' AS a LEFT JOIN '.hikashop_table('product').' AS b ON a.product_id=b.product_id WHERE '.implode(' AND ',$filters).' GROUP BY a.product_id ORDER BY b.product_created ASC';
in the file components/com_hikashop/views/product/view.html.php
1. You need to turn off the "show out of stock products" setting of the Hikashop configuration too as the product page next/previous buttons base themselves on it.
2. There is no option to change that.
You would have to change the line:
$query='SELECT DISTINCT a.product_id FROM '.hikashop_table('product_category').' AS a LEFT JOIN '.hikashop_table('product').' AS b ON a.product_id=b.product_id WHERE '.implode(' AND ',$filters).' GROUP BY a.product_id ORDER BY a.ordering ASC';
to:
$query='SELECT DISTINCT a.product_id FROM '.hikashop_table('product_category').' AS a LEFT JOIN '.hikashop_table('product').' AS b ON a.product_id=b.product_id WHERE '.implode(' AND ',$filters).' GROUP BY a.product_id ORDER BY b.product_created ASC';
in the file components/com_hikashop/views/product/view.html.php
The following user(s) said Thank You: saturnales
Please Log in or Create an account to join the conversation.
- saturnales
-
Topic Author
- Offline
Less
More
- Posts: 46
- Thank you received: 2
10 years 11 months ago #219418
by saturnales
Replied by saturnales on topic next/previous feature and product ordering,
Thanks
Changing the SQL request sems to be a good solution if its not possible on the BO
Concerning your first answer, its not possible on my website : I have 2 pages, accessible from differents urls ( and with differents templates). The first one has to show out of stocks products while the second has to hide it. (on the product listing page AND on the dedicated products pages) If i turn off the "show out of stock products" setting, I suppose it will hide out of stock products on the 2 websites even if the menu parameter says to show it
Changing the SQL request sems to be a good solution if its not possible on the BO
Concerning your first answer, its not possible on my website : I have 2 pages, accessible from differents urls ( and with differents templates). The first one has to show out of stocks products while the second has to hide it. (on the product listing page AND on the dedicated products pages) If i turn off the "show out of stock products" setting, I suppose it will hide out of stock products on the 2 websites even if the menu parameter says to show it
Please Log in or Create an account to join the conversation.
10 years 10 months ago #219427
by nicolas
Replied by nicolas on topic next/previous feature and product ordering,
Hi,
No, the menu item parameter actually overrides the configuration setting on the listing.
For the next/previous buttons, however, it's indeed based on the setting of the configuration all the time.
You'll have to change the code:
to:
where XX and YY are the ids of the menu items where you don't want to display out of stock products for the next/previous buttons.
No, the menu item parameter actually overrides the configuration setting on the listing.
For the next/previous buttons, however, it's indeed based on the setting of the configuration all the time.
You'll have to change the code:
Code:
if($this->params->get('show_out_of_stock') != '1'){
$filters[]='b.product_quantity!=0';
}
Code:
if(in_array($Itemid,array(XX,YY))){
$filters[]='b.product_quantity!=0';
}
The following user(s) said Thank You: saturnales
Please Log in or Create an account to join the conversation.
- saturnales
-
Topic Author
- Offline
Less
More
- Posts: 46
- Thank you received: 2
10 years 10 months ago #219538
by saturnales
Replied by saturnales on topic next/previous feature and product ordering,
Thanks a lot.
Again, i can see that the staff is fast and effective.
Again, i can see that the staff is fast and effective.
Please Log in or Create an account to join the conversation.
Time to create page: 0.143 seconds