- Posts: 7
- Thank you received: 0
Change comments order
- ballonsportclub
-
Topic Author
- Offline
Less
More
12 years 5 months ago #150378
by ballonsportclub
Change comments order was created by ballonsportclub
-- url of the page with the problem -- : not public atm
-- HikaShop version -- : Business 2.3.0
-- Joomla version -- : 3.2.3
-- PHP version -- : 5.3.21
Comments in product details page are sorted from oldest (top) to newest (bottom).
Is it possible to change the order of the comments and bring the newest to the top?
The only option in configuration i've found, is to bring the "useful" comments to the top.
I've tried to use
at line 58 right before
in vote/listing.php
The comments are sorted in the wanted order but one comment is not shown (e.g. after setting sort($elt); only 3 of 4 comments are visible)
Could you please give me a advice to change the order?
THX
Michael
-- HikaShop version -- : Business 2.3.0
-- Joomla version -- : 3.2.3
-- PHP version -- : 5.3.21
Comments in product details page are sorted from oldest (top) to newest (bottom).
Is it possible to change the order of the comments and bring the newest to the top?
The only option in configuration i've found, is to bring the "useful" comments to the top.
I've tried to use
Code:
sort($elt);
Code:
for ($i = 1; $i <= count($elt); $i++) {
if (!empty ($elt[$i]->vote_comment)) {
The comments are sorted in the wanted order but one comment is not shown (e.g. after setting sort($elt); only 3 of 4 comments are visible)
Could you please give me a advice to change the order?
THX
Michael
Please Log in or Create an account to join the conversation.
12 years 5 months ago #150419
by Xavier
Replied by Xavier on topic Change comments order
Hi,
You will have to edit the file "components/com_hikashop/views/vote/view.html.php" and in the function "listing()" replace the "ASC" by "DSC" in the MySQL requests.
You will have to edit the file "components/com_hikashop/views/vote/view.html.php" and in the function "listing()" replace the "ASC" by "DSC" in the MySQL requests.
Please Log in or Create an account to join the conversation.
- ballonsportclub
-
Topic Author
- Offline
Less
More
- Posts: 7
- Thank you received: 0
12 years 5 months ago #150512
by ballonsportclub
Replied by ballonsportclub on topic Change comments order
Thanks Xavier,
I had hoped for a less invasive way (I guess i have to change it again after installing an update).
Or is it possible, to include this option in the next version? In my opinion, the changes are not so big.
Here is what I did:
added new line in administrator/components/com_hikashop/views/config/tmpl/features.php after line 157:
added to language/en-GB/en-GB.com_hikashop.ini (and other language-files):
changed line 89 in components/com_hikashop/views/vote/view.html.php from
to
Did I miss anything?
(beside the fact that my code change will not work in combination with the option to sort comments by visitors. For this, additional changes would be necessary but i don't use this option.)
THX
Michael
I had hoped for a less invasive way (I guess i have to change it again after installing an update).
Or is it possible, to include this option in the next version? In my opinion, the changes are not so big.
Here is what I did:
added new line in administrator/components/com_hikashop/views/config/tmpl/features.php after line 157:
Code:
JHTML::_('select.option', 'date_desc', JText::_('DATE_DESC') )
Code:
DATE_DESC="Date - reverse order"
Code:
}
Code:
} else if($vote_comment_sort == "date_desc"){
$order = ' ORDER BY `vote_date` DESC';
}
Did I miss anything?
(beside the fact that my code change will not work in combination with the option to sort comments by visitors. For this, additional changes would be necessary but i don't use this option.)
THX
Michael
Please Log in or Create an account to join the conversation.
12 years 5 months ago #150546
by Xavier
Replied by Xavier on topic Change comments order
Hi,
I have added these modifications on our end, by this way it will be available by default in the next package.
Thanks to have shared your solution
I have added these modifications on our end, by this way it will be available by default in the next package.
Thanks to have shared your solution
The following user(s) said Thank You: ballonsportclub
Please Log in or Create an account to join the conversation.
Time to create page: 0.171 seconds