Jump to content

[MODULE] Export Orders Module


Falgener
 Share

Recommended Posts

Hi, 

 

Need a little help with this:

 

It should export (new) orders with "Payment accepted" status, into a txt-file (or html etc).

 

I have tried to set it up, but it put all the order lines in the same line in the file..

 

Anyone that can help with this one  :)  ;)

 

 

I need something like for every order line:

OrderID, Product Reference, Product Quantity, Product Name

 

In a second file (or as the best solution after the order lines) Customer data:

Invoice Company

Invoice FirstName, Invoice Lastname

Invoice Address1

Invoice Address2

Invoice Postcode

Invoice City

 

Delivery Company

Delivery FirstName, Delivery Lastname

Delivery Address1

Delivery Address2

Delivery Postcode

Delivery City

 

 

 

/Dan

Share this post


Link to post
Share on other sites

Hi, 

 

Need a little help with this:

 

It should export (new) orders with "Payment accepted" status, into a txt-file (or html etc).

 

I have tried to set it up, but it put all the order lines in the same line in the file..

 

Anyone that can help with this one  :)  ;)

 

 

I need something like for every order line:

OrderID, Product Reference, Product Quantity, Product Name

 

In a second file (or as the best solution after the order lines) Customer data:

Invoice Company

Invoice FirstName, Invoice Lastname

Invoice Address1

Invoice Address2

Invoice Postcode

Invoice City

 

Delivery Company

Delivery FirstName, Delivery Lastname

Delivery Address1

Delivery Address2

Delivery Postcode

Delivery City

 

 

 

/Dan

Hi,

If You have all order lines in one row, You have something in "Group by" in FILTERS.

Select empty value for this filter. See image http://prnt.sc/c6kmlw

 

Or another way - contact me from my website, I can send You settings file, support is included :) .

Thanks

Share this post


Link to post
Share on other sites

  • 2 months later...

Hi

 

I just came across your module and we are looking for a similar module to export latest orders as XML.  Do you have any demo page to see how it works?

 

Thanks & Regards

Sujith

 

Hello,

 

access to demo site sent as personal message.

Share this post


Link to post
Share on other sites

Hello,

I have several customer Group Name to export, how shall I do that, please ?

You tool only adds the first Customer Group but it doesn't take into account the others when exported.

Thank you for your help.

 

Yours sincerely

David

Share this post


Link to post
Share on other sites

Hello,

I have several customer Group Name to export, how shall I do that, please ?

You tool only adds the first Customer Group but it doesn't take into account the others when exported.

Thank you for your help.

 

Yours sincerely

David

 

Hello,

exported name is group name, assigned by default to this customer.

 

If I understand well - You need export all group names, where is this customer?

(I think this will be possible with small module modification)

Thanks

Share this post


Link to post
Share on other sites

  • 4 weeks later...

Hi there,

 

we love the module and use it almost daily. But we have a lot of different types of logistics and it would need a bit more settings (more than the 6)? Is that complicated to customize or possible maybe in the next version?

 

Thank you very much! 

Share this post


Link to post
Share on other sites

Hi there,

 

we love the module and use it almost daily. But we have a lot of different types of logistics and it would need a bit more settings (more than the 6)? Is that complicated to customize or possible maybe in the next version?

 

Thank you very much! 

 

Hello,

it is not too much complicated to add, only time-consuming :) . I can add into next version. 10 settings will be sufficient?

Thanks.

Share this post


Link to post
Share on other sites

  • 1 month later...

Hello,

How could we add the taxes total amount ?

 

Example

Taxe total amount ---> export ! - ambiguities - ! or 16.500000|#|1.316667

 

I need 16.500000 + 1.316667 = 17.81

 

Yours sincerely

 

David Enrique

 

 

Share this post


Link to post
Share on other sites

Hello,

How could we add the taxes total amount ?

 

Example

Taxe total amount ---> export ! - ambiguities - ! or 16.500000|#|1.316667

 

I need 16.500000 + 1.316667 = 17.81

 

Yours sincerely

 

David Enrique

 

Hello,

it is possible with latest version 2.6.9 (with this version You can sum any field)

- Download latest version from Your account, see how to here: http://www.praotec.com/nvn-modules-update/

- setup FILTERS / Group by   see here: http://prnt.sc/du674e

 

Thanks

Share this post


Link to post
Share on other sites

Hi!

 

I'm using the latest version (2.6.9) of your great module, but while exporting to CSV, I have a little problem.

 

- Texts fields with spaces (like name, address, city, ...) are between quotes

- Number fields (like phone numbers or zip codes) are between quotes and start with = (like ="02630")

 

This despiste my app while importing, because it just import it as is. So it fails while checking the imported data.

 

There's no way to disable this and instruct the module to export all data as is without quotes ?

 

Thanks!!!

Share this post


Link to post
Share on other sites

Hi!

 

I'm using the latest version (2.6.9) of your great module, but while exporting to CSV, I have a little problem.

 

- Texts fields with spaces (like name, address, city, ...) are between quotes

- Number fields (like phone numbers or zip codes) are between quotes and start with = (like ="02630")

 

This despiste my app while importing, because it just import it as is. So it fails while checking the imported data.

 

There's no way to disable this and instruct the module to export all data as is without quotes ?

 

Thanks!!!

 

Hi,

 

- Number fields (like phone numbers or zip codes) are between quotes and start with = (like ="02630")

this is useful only for csv for MS Excel, disable this option - see image: http://prnt.sc/dutt73

 

- Texts fields with spaces (like name, address, city, ...) are between quotes

yes, this is csv specification see: https://en.wikipedia.org/wiki/Comma-separated_values

but you are not alone with this question, so tomorrow or in two days will be released update with export in plain txt format (without quotes etc...)  :)

Share this post


Link to post
Share on other sites

  • 1 month later...

With this module I would like to export the actual vouchers available and total value they still represent. Would this be possible?

Or maybe I need some other solution?

 

Hello,

unfortunately not. Can be exported only voucher name and value assigned to order.

Share this post


Link to post
Share on other sites

Would it be interesting to add such a function? Maybe in a next version or for a small fee?

 

I sent access to demo site in personal message.

 

As You can see, with export order module You can export only vouchers, used in orders.

I think, in this case will be better add this function into module specialized  for vouchers management.

Share this post


Link to post
Share on other sites

Hi

 

great module

 

I am wondering if it can be configured in this way

 

At the moment the export is like this

 

post-246958-0-43890500-1488463530_thumb.png

 

You can see one order (number 10243 - Ferris) has more than one product so it shows on two lines

 

Can it be configured more like this?

 

So the information about the buyer is only shown once, but each product they purchase is in a separate line?

post-246958-0-91976800-1488463673_thumb.png

Share this post


Link to post
Share on other sites

Hi

 

great module

 

I am wondering if it can be configured in this way

 

At the moment the export is like this

 

attachicon.gifexport from NVN.png

 

You can see one order (number 10243 - Ferris) has more than one product so it shows on two lines

 

Can it be configured more like this?

 

So the information about the buyer is only shown once, but each product they purchase is in a separate line?

 

Hi,

yes, of course it is possible.

There are two ways:

1/ using xslt transformation - see here: http://www.praotec.com/nvn-export-orders-simple-xslt-transformation-sample-2-step-by-step/

2/ with module extension, simple, but I still don't have example, but I can prepare :-)

Share this post


Link to post
Share on other sites

Hi Falgener,

 

Could you consider making this module to export vouchers and all their information?

 

Hi,

this module export informations about vouchers used in orders.

But if I understand well, you search for module to export informations about all vouchers in shop?

In my opinion this should be in other module.

Share this post


Link to post
Share on other sites

Hi,

yes, of course it is possible.

There are two ways:

1/ using xslt transformation - see here: http://www.praotec.com/nvn-export-orders-simple-xslt-transformation-sample-2-step-by-step/

2/ with module extension, simple, but I still don't have example, but I can prepare :-)

 

That is brilliant - almost

 

Just one small issue that would make this work for us.

 

The first line of products has to be on the same line as the order details: like this. can it be done? I have tried but it just causes an error

 

post-246958-0-38298300-1488493109_thumb.png

Share this post


Link to post
Share on other sites

That is brilliant - almost

 

Just one small issue that would make this work for us.

 

The first line of products has to be on the same line as the order details: like this. can it be done? I have tried but it just causes an error

 

attachicon.gif02-03-2017 22-17-57.png

 

I hate xslt  ;)

But you are right.

Copy/paste repaired xslt from sample page to resolve this issue.

Share this post


Link to post
Share on other sites

You got me right and I totaly agree to you that it should be a different module.... :) Should not be to difficult with your skills.

 

Yes, and can be interesting work. There is only one problem - time :-)

Share this post


Link to post
Share on other sites

Is there a setting (or a code change) I can use so that the export file is created even when there are no new data?

 

When there is no data i get:

Sorry, but there are NO NEW orders to export with this filters and options setting.

But it would be really useful just to create the file with the column headings

Share this post


Link to post
Share on other sites

Is there a setting (or a code change) I can use so that the export file is created even when there are no new data?

 

When there is no data i get:

Sorry, but there are NO NEW orders to export with this filters and options setting.

But it would be really useful just to create the file with the column headings

 

Hi,

yes, it is possible and simple with small code change. Wait a moment, I need test it and will send instruction "how to"

  • Like 1

Share this post


Link to post
Share on other sites

Maybe will be useful also for other, so I added into OPTIONS: "Export empty file even when there are no new Orders".

Download latest version from Your Your account / orders detail - http://www.praotec.com/nvn-modules-update/

Thanks

It seems to export ALL orders when there are no new ones.

 

We do still get this message:

 

Sorry, but there are NO NEW orders to export with this filters and options setting.
 
But the file is not empty it contains all orders
Edited by haylau (see edit history)

Share this post


Link to post
Share on other sites

 

It seems to export ALL orders when there are no new ones.

 

We do still get this message:

 

Sorry, but there are NO NEW orders to export with this filters and options setting.
 
But rhe file is not empty it contains all orders
 
I did just install over the top. Should I have uninstalled first perhaps?

 

 

No, don't uninstall, only overwrite old version and save new settings.

I must check it, I tested with FILTERS "Last Exported Order ID" and empty file is exported (only columns names ).

Yes, message is still  generated.

Share this post


Link to post
Share on other sites

 

It seems to export ALL orders when there are no new ones.

 

We do still get this message:

 

Sorry, but there are NO NEW orders to export with this filters and options setting.
 
But the file is not empty it contains all orders

 

 

You are right, this is my bug :( .  Will be fixed, wait a moment.

Share this post


Link to post
Share on other sites

Hello there, We want to buy your order export plugin. We need to esport orders in XML format to import them into the S3 money system after that. Before we buy your plugin, we wanted to ask you if is possible modificate xml export by this file https://drive.google.com/open?id=0B1EiX486ALM0QkdXb2lIRFFOTms . thats right format example how it should be.

 

So is it possible?

 

In case we will need help and assist with something to reach that format, can we contact you directly?

 

Thanks 

 

Michal.

Share this post


Link to post
Share on other sites

 

Hello there, We want to buy your order export plugin. We need to esport orders in XML format to import them into the S3 money system after that. Before we buy your plugin, we wanted to ask you if is possible modificate xml export by this file https://drive.google.com/open?id=0B1EiX486ALM0QkdXb2lIRFFOTms . thats right format example how it should be.
 
So is it possible?
 
In case we will need help and assist with something to reach that format, can we contact you directly?
 
Thanks 
 
Michal.

 

 

Hello,

yes, it is possible, but I must prepare module extension for this specific XML.

Share this post


Link to post
Share on other sites

  • 1 month later...

Hi,

 

I have 2 questions :

1) How can i add the number of order_detail lines in the XML output ?

2) For each <order_detail>, i would like to increment a value : 1, then 2, then 3, is it possible ?

 

Many thanks

Share this post


Link to post
Share on other sites

Hi,

 

I have 2 questions :

1) How can i add the number of order_detail lines in the XML output ?

2) For each <order_detail>, i would like to increment a value : 1, then 2, then 3, is it possible ?

 

Many thanks

 

Hi,

1/ Add field "Order Detail ID" into exported fields.

In user defined xml will be something like <id_order_detail>#id_order_detail#</id_order_detail>

In xslt <id_order_detail><xsl:value-of select="id_order_detail" /></id_order_detail>

 

 

2/In xslt?

use position() inside for-each

for example:

<xsl:for-each select="key('groups',order_id)"><!--ITEM CYCLE-->
                  <!--ROWS ITEMS HERE-->
                  <CC_LIGNE>
                            <DEPOSANT>XXX</DEPOSANT>
                            <SHOP>YYY</SHOP>
                            <SITE>0</SITE>
                            <ROW><xsl:value-of select="position()"/></ROW>
                          .....
                          .....
                  </CC_LIGNE>
                  </xsl:for-each><!--ITEM CYCLE END-->
Edited by Falgener (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Thank you !
About question 1, the goal is to count the number of order_detail lines. Is it possible ?

 

And similarly, i would like to summarize the total weight of order, i have tried to play with groups and calculated field but i did not succeed.

 

 

About question 2, your solution should work well :)

 

One more thing, is it possible to include the customer message about the delivery in the XML output ?

 

Many thanks

Share this post


Link to post
Share on other sites

1/

 

Thank you !
About question 1, the goal is to count the number of order_detail lines. Is it possible ?

 

And similarly, i would like to summarize the total weight of order, i have tried to play with groups and calculated field but i did not succeed.

 

 

About question 2, your solution should work well :)

 

One more thing, is it possible to include the customer message about the delivery in the XML output ?

 

Many thanks

 

1/

add into xslt lines: 7 (var "set"), 8(var"count"), row 12 is <TOTAL_ITEMS>

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="no" indent="yes" method="xml" version="1.0" encoding="UTF-8" />
<xsl:key use="order_id" match="/nvn_export_orders/order" name="groups"/>
<xsl:template match="/"><xsl:apply-templates select="/nvn_export_orders" /></xsl:template>
<xsl:template match="/nvn_export_orders">
<xsl:variable name="set" select="/nvn_export_orders/order" />
<xsl:variable name="count" select="count($set)" />

<!-- FIRST ROW AND WRAPPER-->
<commandes xmlns:od="http://www.w3.org/2001/XMLSchema-instance">
<TOTAL_ITEMS><xsl:value-of select="$count" /></TOTAL_ITEMS>
      <xsl:for-each select="order[generate-id(.)=generate-id(key('groups',order_id))]"><!--ORDER CYCLE-->
      <CC_ENTETE>
         <!--COMMON VALUES HERE-->
          .....
          .....

2/ it is not possible with "Group by", because whole order is summarized into one row. This is possible with module extension.

 

3/ add field "Customer message" into  exported fields and into xslt for example

<CUST_MESSAGE><xsl:value-of select="message" /></CUST_MESSAGE>

Edited by Falgener (see edit history)

Share this post


Link to post
Share on other sites

  • 4 weeks later...

Hi Falgener

 

Firstly, I have been using your module for a long time  and it is really great!

 

Currently, I have it configured via a Cron Task to automatically run at preset times and this works well..I also "manually" trigger the Cron task to run it on demand.

 

I am looking for a way to eliminate the automatic Cron task and would like to know if there is a way to "trigger" the export to happen whenever a shopping cart is finalised?

 

Thanks again for a great module....

 

Cheers

Greg

Share this post


Link to post
Share on other sites

Hi Falgener

 

Firstly, I have been using your module for a long time  and it is really great!

 

Currently, I have it configured via a Cron Task to automatically run at preset times and this works well..I also "manually" trigger the Cron task to run it on demand.

 

I am looking for a way to eliminate the automatic Cron task and would like to know if there is a way to "trigger" the export to happen whenever a shopping cart is finalised?

 

Thanks again for a great module....

 

Cheers

Greg

 

Hi,

and thanks.

Yes, this is possible with "Live export". See image:   https://prnt.sc/fdafgu    SETTING: Live export.

But remember that this setting  works only for currently active setting.

Share this post


Link to post
Share on other sites

Hi Falgener,

 

Thanks for the quick reply!

 

Currently, I have Export Order configured to export ALL orders via the Cron task.....if I activate (turn on) the "Live Export" option will it also export ALL orders each time a new Order is created and create the file exactly like it does via the Cron Task????

 

Thanks

Greg

Edited by lateral (see edit history)

Share this post


Link to post
Share on other sites

Hi Falgener,

 

Thanks for the quick reply!

 

Currently, I have Export Order configured to export ALL orders via the Cron task.....if I activate (turn on) the "Live Export" option will it also export ALL orders each time a new Order is created and create the file exactly like it does via the Cron Task????

 

Thanks

Greg

 

Yes, "Live export" use all setting, filters etc... like "normal" export. Only switch to any setting,  select live export and save. Module must remain  switched on this setting.

Share this post


Link to post
Share on other sites

Hi again,

 

I am having trouble getting the Live Export to work...

 

Can you please answer the following questions?:

 

1. is any Prestashop code changed/modified? If so, what and how?

2. what part of the Checkout process actually triggers the export?

 

Thanks

Greg

Share this post


Link to post
Share on other sites

Hi again,

 

I am having trouble getting the Live Export to work...

 

Can you please answer the following questions?:

 

1. is any Prestashop code changed/modified? If so, what and how?

2. what part of the Checkout process actually triggers the export?

 

Thanks

Greg

 

Hi,

no Prestashop code modified.

Live export is solved in this two functions:

function hookNewOrder($params)

function hookFooter($params)

Note: setting for "Iive export" must be active setting.

Share this post


Link to post
Share on other sites

Hi

 

Are those 2 functions your functions or standard Prestashop functions?

 

 

My shopping cart functionality has been modified slightly so i am interested to know at what point eg: when the payment button is clicked, does your code/function kick in?

 

Cheers

Greg

Share this post


Link to post
Share on other sites

Hi

 

Are those 2 functions your functions or standard Prestashop functions?

 

 

My shopping cart functionality has been modified slightly so i am interested to know at what point eg: when the payment button is clicked, does your code/function kick in?

 

Cheers

Greg

Hi,

this are my functions, but similar are used in prestashop for example for sending notification about new order.

 

But what can be problem: module need register two hook.

This is activated in installation process.

So if You used old version before, You need export settings, uninstall old and then install new version and import settings. ( http://www.praotec.com/nvn-export-orders-update/ )

Share this post


Link to post
Share on other sites

Thanks

 

I will try the update process (Export settings etc) and let you know if it fixes the issue.

 

I assume that I first delete the module and then install it completely and then import the settings?

 

Cheers

Greg

Share this post


Link to post
Share on other sites

Thanks

 

I will try the update process (Export settings etc) and let you know if it fixes the issue.

 

I assume that I first delete the module and then install it completely and then import the settings?

 

Cheers

Greg

 

yes (delete is not required, because all files are overwritten when upload new version), but uninstall / install is required.

Share this post


Link to post
Share on other sites

  • 1 month later...

Hi

 

Module: 2.7.4

 

We are using  "XML transformation - XSLT stylesheet"

 

In prestashop we have some long product references so I have modified the field lengths in the tables and some PHP files

 

Max field length is normally 32 characters for product reference, we have increased to 64 charachters

 

When we export the orders, it seems the module is still only 32 characters, so this code: "CLAMP/T304/38-40*6-36-100-20-12-3" is exported as "CLAMP/T304/38-40*6-36-100-20-12-"

 

Is there somewhere in the module files that limit this to 32 characters? Can you point me to where so I can increase it?

Edited by haylau (see edit history)

Share this post


Link to post
Share on other sites

Hi

 

Module: 2.7.4

 

We are using  "XML transformation - XSLT stylesheet"

 

In prestashop we have some long product references so I have modified the field lengths in the tables and some PHP files

 

Max field length is normally 32 characters for product reference, we have increased to 64 charachters

 

When we export the orders, it seems the module is still only 32 characters, so this code: "CLAMP/T304/38-40*6-36-100-20-12-3" is exported as "CLAMP/T304/38-40*6-36-100-20-12-"

 

Is there somewhere in the module files that limit this to 32 characters? Can you point me to where so I can increase it?

 

 

Hi,

no, module don't check fields length, used same length as in database.

But maybe your modification use different (new) field...

 

Note that module use product reference field from ps_order_detail table.

You can try use product reference field from ps_product table.

At the end of module are defined fields.

Try change this:

 

array('od.product_reference AS product_reference',                     $this->l('Product Reference'),          51,1,0,3,0),

 

to

 

array('pr.reference AS product_reference',                     $this->l('Product Reference'),          51,1,0,3,0),

Edited by Falgener (see edit history)

Share this post


Link to post
Share on other sites

Hi,

no, module don't check fields length, used same length as in database.

But maybe your modification use different (new) field...

 

Note that module use product reference field from ps_order_detail table.

You can try use product reference field from ps_product table.

At the end of module are defined fields.

Try change this:

 

array('od.product_reference AS product_reference',                     $this->l('Product Reference'),          51,1,0,3,0),

 

to

 

array('pr.reference AS product_reference',                     $this->l('Product Reference'),          51,1,0,3,0),

 

Thanks - silly me. I thought that being a database the order table would jsut be indexed numbers, not the actual data. 

 

I will try changing the field length in the table first. Then i will try your fix if that does not work

Share this post


Link to post
Share on other sites

  • 4 weeks later...
  • 2 months later...
  • 4 months later...
  • 3 months later...

Capture.thumb.PNG.79742c6b1db0f14355cc585ae83f448b.PNGCapture.thumb.PNG.79742c6b1db0f14355cc585ae83f448b.PNGHello,
I buy your module today but i have a problem.
I have to export a customized xml so I go to "use defined xml" in the module.
When i Export the xml (i need to have each order in one file), i have not a dynamic field in the xml tags.

I always have #name_of_the_field#.

And i would like to add the field "private notes " for customers. What is the name f this field?

THanks for your help

<orders>
<order id="#order_id#" reference="#order_reference#" current_state="#order_state_id#" payment="#payment#" marketplace="" total_paid="#total_paid#" total_paid_tax_incl="#total_paid_tax_incl#" total_paid_tax_excl="#total_paid_tax_excl#" total_paid_real="#total_real_paid#" total_products="#total_products#" total_products_wt="#total_price_tax_excl#" total_shipping="#total_shipping#" total_shipping_tax_incl="#total_shipping_tax_incl#" total_shipping_tax_excl="#total_shipping_tax_excl#" total_wrapping="#total_wrapping#" total_wrapping_tax_excl="#total_wrapping_tax_excl#" date_add="#date_add#" date_upd="#date_upd#" />
<carrier name="#carrier_name#" />
<customer id="#id_customer#" id_gender="#gender_name#" firstname="#first_name#" lastname="#last_name#" email="#email#" />
<address_delivery company="#delivery_company#" firstname="#delivery_firstname#" lastname="#delivery_lastname#" address1="#delivery_address1#" address2="#delivery_address2#" postcode="#delivery_postcode#" city="#delivery_city#" country="#delivery_country#" other="##" phone="#delievry_phone#" phone_mobile="#delivery_mobilephone#" />
<address_invoice company="#invoice_company#" firstname="#invoice_firstname#" lastname="#invoice_lastname#" address1="#invoice_address1#" address2="#invoice_address2#" postcode="#invoice_postcode#" city="#invoice_city#" country="#invoice_country" other="" phone="#invoice_phone#" phone_mobile="#invoice_mobilephone#" />
<messages>
<![CDATA[#message#]]>
</messages>
<products>
<product product_id="#product_id#" product_reference="#product_reference#" product_supplier_reference="#supplier_reference#" product_name="#product_name#" product_quantity="#product_quantity#" original_product_price="#product_price#" product_price="#product_price#" ecotax="#ecotax#" tax_rate="#tax_rate#"></product>
</products>
<cart_rules>
</cart_rules>
</order>
</orders>

 

Share this post


Link to post
Share on other sites

I think that i have found my problem.
I have put dynamic fields in the header of the html.

I would like to repeat automatically only the products. (not the address delivery and invoice).

<!-- HEAD OF THE XML -->

<ORDERS>
<ORDER ID="" />
<CUSTOMER ID="" />
<DELIVERY ID="" />
<INVOICE ID="" />
<DISCOUNT ID="" />

<!-- HEAD OF THE XML -->

<PRODUCTS>
<PRODUCT ID="BLA">
<PRODUCT ID="BL0">
</PRODUCTS>
</ORDERS>

Is it possible?

 

Edited by LIONEL (see edit history)

Share this post


Link to post
Share on other sites

Hi,
yes, it is possible, but not as user defined xml, but with xslt transform. Switch to export as xml and define xslt.
see this article:
 
for example:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output omit-xml-declaration="yes" indent="yes" method="xml" version="1.0" />
    <xsl:key use="order_id" match="/nvn_export_orders/order" name="groups"/>
  <xsl:template match="/">
    <xsl:apply-templates select="/nvn_export_orders" />
  </xsl:template>
  <xsl:template match="/nvn_export_orders">
    <OrdersOut>
      <xsl:for-each select="order[generate-id(.)=generate-id(key('groups',order_id))]">
        <OrderSummary>
          <OrderId>
            <xsl:value-of select="order_id/text()" />
          </OrderId>
          <Orderdate>
            <xsl:value-of select="date_add/text()" />
          </Orderdate>
          <Items>
              <xsl:for-each select="key('groups',order_id)">
                <ItemName>
                  <xsl:value-of select="product_name/text()" />
                </ItemName>
                <ItemQuantity>
                  <xsl:value-of select="product_quantity/text()" />
                </ItemQuantity>            
              </xsl:for-each>      
          </Items>
        </OrderSummary>
      </xsl:for-each>
    </OrdersOut>
  </xsl:template>
</xsl:stylesheet>
 
 
 
 
 

Share this post


Link to post
Share on other sites

7 hours ago, LIONEL said:

Hi,

 

OK It works. Thanks.

Just a last question, i would like to add the private note for the customer in my export.
I don't find this field. How do i add this field?

Regards,

Lionel

 

Hi,
I have added this field yesterday, because seems to be useful for other users.
So download latest version from your account - orders history /  detail -  see http://www.praotec.com/nvn-modules-update/
Thanks

Share this post


Link to post
Share on other sites

  • 2 weeks later...

Hello
I have another questions.
I want to export the vouchers so i have implement the code below in the xslt

		<cart_rules>	
            <xsl:for-each select="key('groups',order_id)">
			  <cart_rule>
			  <voucher_name><xsl:value-of select="voucher_name/text()" /> </voucher_name>
			  <value_tax_excl><xsl:value-of select="voucher_value_tax_excl" /></value_tax_excl>
			  <value><xsl:value-of select="voucher_value" /></value>
			  </cart_rule>
			</xsl:for-each>
		</cart_rules>  

In the output, i have this

<cart_rule><voucher_name>Kit prêt à démarrer # Frais de préparation # SPM-RP10-SO4I</voucher_name><value_tax_excl>15.00 # 8.33 # 8.33</value_tax_excl><value>18.00 # 10.00 # 10.00</value></cart_rule>

But i want this result  - How can i do that with xslt?

<cart_rules> 
<cart_rule>
<name>EDGA - Extension de garantie 3 ans complémentaire sur les débroussailleuses HONDA</name>
< value_tax_excl>0.83</ value_tax_excl>
<value>1.00</value>
</cart_rule>
<cart_rule>
<name> NMTC - 5% de remise sur votre commande</name>
< value_tax_excl>23.26</ value_tax_excl>
<value>27.91</value>
</cart_rule>
</cart_rules> 

 

Regards

Lionel

Edited by LIONEL (see edit history)

Share this post


Link to post
Share on other sites

  • 2 weeks later...

Find below the solution if someone want to do the same thing.

<xsl:variable name="vv" select="voucher_value"/>

<xsl:variable name="vvte" select="voucher_value_tax_excl"/>

<cart_rules>

                <xsl:for-each select="str:tokenize(voucher_name, '#')">

                               <xsl:variable name="pos" select="position()"/>

                               <cart_rule>

                                             <name><xsl:value-of select="normalize-space(.)"/></name>

                                               <value><xsl:value-of select="normalize-space(str:tokenize($vv, '#')[position()=$pos])"/></value>

                                               <value_tax_excl><xsl:value-of select="normalize-space(str:tokenize($vvte, '#')[position()=$pos])"/></value_tax_excl>

                               </cart_rule>

                </xsl:for-each>

</cart_rules>

 

Share this post


Link to post
Share on other sites

  • 3 months later...

To  Falgener

Using ver. 2.8.6
- BUG  - Invoice country code .... it wrongly export the delivery country code. Invoice Country and Delivery Country work fine...but I'd like to export ISO-2
- FEATURE REQUEST : In filters there is "automatic date from now" setting which is great. I propose improvement - New field with two values "AUTOMATIC No. DAYS BEGINING" ...value ..."ENDING"...value .... FROM NOW. I hope you understand me ...Usage example : cancel all unpaid orders with "wire payment" method, older than XX days. Since it will be done periodically it make sense to set 2x parameters here, so filter only search from e.g. 40 till 90 days time, not trough whole history.

Thank you in forward for your reply

Share this post


Link to post
Share on other sites

  • 1 year later...