1. Comenaranjas
  2. RO CSVI
  3. Friday, 06 January 2017
  4.  Subscribe via email
Hello

1 -I'm setting up an export HTML following your sample template for VM rating and all good but we are ordering by "created_on" and it works but shows the old ones first.

Any option to show the newest one's first?



2 - Also in the template options "From record" "To record" not sure how to use that.

Can we limit by date there or how? Idea is to show latest 100 lets say or from a certain date.

Regards
Accepted Answer Pending Moderation
Hello,
1 -I'm setting up an export HTML following your sample template for VM rating and all good but we are ordering by "created_on" and it works but shows the old ones first.

Any option to show the newest one's first?

By default sort by fields are ordered by ascending order, one way is you can create an override file for the export and add code to order created_on field in descending order. In your override file for rating export look for line $query->order($sortby); around line number 176 and replace it with below code. That should fix your issue.
foreach($sortby as $sort)
{
$query->order($sort . ' DESC');
}

2 - Also in the template options "From record" "To record" not sure how to use that.

Can we limit by date there or how? Idea is to show latest 100 lets say or from a certain date.

You can set From record to 1 and To record to 100 and then try the export. This would get you the first 100 records from your export. Once you add your above override file these record limit will get you latest 100 records. Let me know if it helps.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi Tharuna

I must be doing something wrong cause I get error 500 on export.

This is what I did.

I located:

/administrator/components/com_csvi/addon/com_virtuemart/model/export/rating.php

Download it and edit it with the code you mention:

$query->order($sortby)

I see it in line 351 of rating.php and then I change it to:

foreach ($sortby as $sort)
{
$query->order($sort . ' DESC');
}

Which leaves it this way:


// Sort set fields

$sortby = array_unique($sortby);



if (!empty($sortby))

{

foreach($sortby as $sort)
{
$query->order($sort . ' DESC');
}

}



Then I copy it to

/administrator/templates/isis/html/com_csvi/com_virtuemart/model/rating.php

In template I selected the override rating.php
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Tharuna

This ended up being more simple than I though for our needs.

I used "from record 463" to record "1000"

I noticed that ordering by date the record 463 shows the first review date that I wanted to show and all the newer ones.

Not a problem that this appear from oldest to newest, main thing was to hide the really old reviews from the frontend html display.

Regards
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hello,
Glad to know that you have figured out a solution. Regarding the override you have placed it in wrong path, the file should have been in /administrator/templates/isis/html/com_csvi/com_virtuemart/model/export/rating.php. Note that export folder missing in your path. This is explained in our Override import/export document.

We have also added the option of ascending or descending fields in export to our list of future developments.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!