1. docetmedia
  2. RO CSVI
  3. Friday, 30 September 2016
  4.  Subscribe via email
Hi,

I see that export filename can be customized with date information but can I include the order number ?

Thanks,
Olivier
Accepted Answer Pending Moderation
Hey Marko,

While testing the filename export I stumbled upon an issue in the front-end export. So we are fixing that to make sure the given filename is used for export. This is not related to your request but was uncovered because of it.

No changes on your end need to be made for this.

The one thing you will need to do is alter the HikaShop CSVI export plugin we provide. You will need to add this line to your version
$uri->setVar('form_export_filename', $order->order_id . '.csv');
and change it so you get the filename you like. In this example it is only exporting the order ID as filename and I am not sure that is enough. So this example, if you export order ID 5, you get the 5.csv file. Adjust it to your needs. Make a backup as well because it will be overwritten if you update CSVI, so you need to reapply the change.
Kind regards,

RolandD

=========================
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
Hello Olivier,
There is no way to add order number to export filename. You may need to hack/custom code this in CSVI core file if you need it. If you want to do so, you can change it in administrator/components/com_csvi/models/exports.php file and look for function exportFilename. Remember you need to take care of CSVI core future updates in case if you write your custom code.
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. # 2
Accepted Answer Pending Moderation
Thanks for your answer Tharuna, I will try to modify the code.
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
This might be the part to edit :



private function formatExportFilename($exportFilename)
{
// Do some customizing
// Replace year
$exportFilename = str_replace('[Y]', date('Y', time()), $exportFilename);
$exportFilename = str_replace('[y]', date('y', time()), $exportFilename);

// Replace month
$exportFilename = str_replace('[M]', date('M', time()), $exportFilename);
$exportFilename = str_replace('[m]', date('m', time()), $exportFilename);
$exportFilename = str_replace('[F]', date('F', time()), $exportFilename);
$exportFilename = str_replace('[n]', date('n', time()), $exportFilename);

// Replace day
$exportFilename = str_replace('[d]', date('d', time()), $exportFilename);
$exportFilename = str_replace('[D]', date('D', time()), $exportFilename);
$exportFilename = str_replace('[j]', date('j', time()), $exportFilename);
$exportFilename = str_replace('[l]', date('l', time()), $exportFilename);

// Replace hour
$exportFilename = str_replace('[g]', date('g', time()), $exportFilename);
$exportFilename = str_replace('[G]', date('G', time()), $exportFilename);
$exportFilename = str_replace('[h]', date('h', time()), $exportFilename);
$exportFilename = str_replace('[H]', date('H', time()), $exportFilename);

// Replace minute
$exportFilename = str_replace('[i]', date('i', time()), $exportFilename);

// Replace seconds
$exportFilename = str_replace('[s]', date('s', time()), $exportFilename);

// Replace ordernumber
$exportFilename = str_replace('[O]', order-number, $exportFilename);

return $exportFilename;
}




Could someone help me to figure how to get the order-number added here ?
Thanks !
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello,
As said already you need to modify exportFilename function as the formatExportFilename method you pasted is called in the exportFilename function. Since this is your custom coding we are limited to help you here, you may need some developer's help to add order-number in the code.
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. # 5
Accepted Answer Pending Moderation
Hi,are there any News to this Topic.

I need to include the virtuemart_order_id in the Filename.

This thread is 2 years old, maybe there is a possibility today?

Thank you.
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello,

There is no change in this as the order ID isn't passed anywhere. The code is the same as posted above and if you need the order ID the solution is also the same as above, it requires custom coding.
Kind regards,

RolandD

=========================
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. # 7
Accepted Answer Pending Moderation
Hi,

sorry, but i can´t custom code.

I have another Question:

Is there a way, that the Filename only consists of numbers like 1.xml 2xml ... and counts up automatically?
And is there a way to include the Filename in the XML-File?

I want to explain my Problem:

The Wholesaler wants an XML-File with an Filename which consists only of numbers (max. 6/counts up on every order) and this Number must be also in the xml-File.

For example: 123.xml

<?xml version="1.0"?>
<Order_Data>
<Transaction_No>123</Transaction_No>
...

And if this is not possible, is there a way, that csvi asks on every export for the Filename to create?

Thank you,
Marko
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello Marko,

Unfortunately I don't see this work in CSVI either because there is simply no such functionality present. I can't think of anything workable in the current setup, simply because none of these values are available when creating the filename.

And if this is not possible, is there a way, that csvi asks on every export for the Filename to create?
You can specify the filename in the export template. If you run the export via cron/CLI you can specify the filename by using the --export_filename=123.xml, if you export a specific number this could be used. You would then also add the --orderlist=123 to export order ID 123.
Kind regards,

RolandD

=========================
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. # 9
Accepted Answer Pending Moderation
Hi,

ok, i need to export the Orders manually.

The Wholesaler needs 1 XML-File per Order. And the File shout be saved on his FTP-Server.
I have a workaround. In the Template,i will specify an explicit Status. So we can easyly select the Order wich should be exportet.

But when there is no way, that CSVI asks for the Name by Export. So wee need to edit the Tempate on every export. Because the filename is alsway an other Filename.
Like 1.xml 2.xml 3.xml. The Filenames must be unique an upcounting.

The easiest way is,when CSVI asks on Eport, so we can put in the right Name and coult automaticly save the File on the FTP-Server.
Is it possible?
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Hello Marko,

But when there is no way, that CSVI asks for the Name by Export. So wee need to edit the Tempate on every export.
Are you exporting every order manually?

CSVI does not ask for the filename, everything related to an export is stored in the template. As I said, you can specify the filename if you run the export from the command line as explained in my previous comment. Is that not an option?

Saving the file on the FTP server is not a problem, you can configure the FTP server in the template settings.
Kind regards,

RolandD

=========================
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. # 11
Accepted Answer Pending Moderation
Hello Rolandd,

Are you exporting every order manually?


What else should I do if csvi can not export the orders individually.
So 1 xml file per order.

This website with shop is for a customer.
And everything should be as simple as possible.

I do not think the export via command is a simple solution for the customer.

Maybe I have to look for another tool?

Thank you,
Marko
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hello Marko,

What else should I do if csvi can not export the orders individually.
There is nothing else you can do other than perhaps ask the VirtueMart team to include a trigger every time an order is completed. Just the way HikaShop does. On this trigger you could trigger the CSVI export.

I do not think the export via command is a simple solution for the customer.
This is definitely not a simple solution for the customer but that is why you are building the solution so they don't have to set it up.

Ideally you want this automated. One way is the trigger from the shopping extension. VirtueMart does not have this, so the trigger is not an option. Basically what is left is a CLI script that sets the filename and sets the order ID that needs to be exported. That is a custom solution.

The requirements you have part of it is not standard in CSVI, so you will not be able to do this without making changes somewhere.

Something else that just came to mind, you could make an HTML form that the customer fills in with the order ID and this triggers the front-end export and should produce the export file as you want. This is also custom work to some point.
Kind regards,

RolandD

=========================
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. # 13
Accepted Answer Pending Moderation
Thank you for your help.

Maybe I can realize something like that.

A last question.

When I use Hikashop, I have the trigger.
But actually, I also need a solution that the file name of the XML file must consist of numbers, ascending with each order. And these numbers must also be found somewhere in the xml file.

You wrote in an other post:

I can't think of anything workable in the current setup, simply because none of these values are available when creating the filename.


I can insert the order id into the XML file via Fileds. This consists only of numbers and is ascending with each order. So this Number is available.
Would it be possible somehow to create the file name from it? Maybe also by an additional function that you can insert which I can pay extra?

Many Thanks
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
Hello Marko,

If you are going to use HikaShop, you can use the order trigger plugin we provide. The only change you may need to do is to set the filename in the URL with the order number. This would mean a 1 line change, so that would be easy to do.

Let me know if you are going to use HikaShop and I can take a look if the plugin can create the filename you want.
Kind regards,

RolandD

=========================
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. # 15
Accepted Answer Pending Moderation
Hello Rolandd,

that sounds great.
I will try Hika shop.

Please take a look if the Plugin can create the Filename.

Thank you very very much.
  1. more than a month ago
  2. RO CSVI
  3. # 16
Accepted Answer Pending Moderation
Hello Marko,

I have done some testing and I can confirm that the plugin can create the filename using the order ID from HikaShop. We do have to make some changes to CSVI but that shouldn't be a big problem.
Kind regards,

RolandD

=========================
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. # 17
Accepted Answer Pending Moderation
Hello Rolandd,

thousand thanks.

What changes do we have to make?
  1. more than a month ago
  2. RO CSVI
  3. # 18
Accepted Answer Pending Moderation
Hello Roland,
many thanks. I will try it the next days and I will write here if it works.

Kind regards,
Marko
  1. more than a month ago
  2. RO CSVI
  3. # 19
Accepted Answer Pending Moderation
Hello Rolandd,

where exactly is the file that I need to change, and what is the name of this file.

Thank you.
  1. more than a month ago
  2. RO CSVI
  3. # 20
  • Page :
  • 1
  • 2


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