1. batetim
  2. RO CSVI
  3. Tuesday, 15 September 2015
  4.  Subscribe via email
Hi Roland

Using 5.21.1 and working my way through tutorial http://www.csvimproved.com/en/support/export/930-advanced-order-xml-export

I think the available export fields with Virtuemart have changed since this was written and i am struggling how to pull both shipment and invoice address fields in the xml. I read one of the other articles and address-type was mentioned, but not sure how this relates.

ideally i want something like

<customer>
<name>Shipping name</name>
<contactperson>Shipping name</contactperson>
<address>Shipping address</address>
<zip>Shipping zip</zip>
<city>Shipping city</city>
<billtoname>Bill to name</billtoname>
<billtoaddress>Bill to address></billtoaddress>
<billtozip>Bill to zip</billtozip>
<billtocity>Bill to city</billtocity>
</customer>

Just like in this tutorial example - has virtuemart tables changed since? Any advice would be greatly welcomed!
Kind regards

Tim
Accepted Answer Pending Moderation
Hello Tim,

The fields should still be the same, which fields are you missing? The fieldnames to include in the export are the names between the brackets.
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
Hi Roland

Below is order element of the layout i have used on csvi:

<ConsumerAddress>
<Name>[full_name]</Name>
<FirmName>[company]</FirmName>
<AddressLine1>[address_1]</AddressLine1>
<AddressLine2>[address_2]</AddressLine2>
<AddressLine3>[city]</AddressLine3>
<AddressLine4>[country_2_code]</AddressLine4>
<AddressLine5></AddressLine5>
<PostCode>[zip]</PostCode>
</ConsumerAddress>
<InvoiceAddress>
<InvoiceAddress1>[full_name]</InvoiceAddress1>
<InvoiceAddress2>[address_1]></InvoiceAddress2>
<InvoiceAddress3>[address_2]></InvoiceAddress3>
<InvoiceAddress4>[city]></InvoiceAddress4>
<InvoiceAddress5>[country_2_code]></InvoiceAddress5>
<InvoicePostCode>[zip]</InvoicePostCode>
</InvoiceAddress>

Which for one of our test orders (which has a different delivery and invoice address) has created this xml output:

<ConsumerAddress>
<Name><![CDATA[Isaac Broom]]></Name>
<FirmName><![CDATA[Office Needs Direct]]></FirmName>
<AddressLine1><![CDATA[Office Needs Direct]]></AddressLine1>
<AddressLine2><![CDATA[Stimson Ind Estate]]></AddressLine2>
<AddressLine3><![CDATA[The Street, Hepworth]]></AddressLine3>
<AddressLine4><![CDATA[GB]]></AddressLine4>
<AddressLine5></AddressLine5>
<PostCode><![CDATA[IP22 2PS]]></PostCode>
</ConsumerAddress>
<InvoiceAddress>
<InvoiceAddress1><![CDATA[Isaac Broom]]></InvoiceAddress1>
<InvoiceAddress2><![CDATA[Office Needs Direct]]>></InvoiceAddress2>
<InvoiceAddress3><![CDATA[Stimson Ind Estate]]>></InvoiceAddress3>
<InvoiceAddress4><![CDATA[The Street, Hepworth]]>></InvoiceAddress4>
<InvoiceAddress5><![CDATA[GB]]>></InvoiceAddress5>
<InvoicePostCode><![CDATA[IP22 2PS]]></InvoicePostCode>
</InvoiceAddress>

By using the fields [full_name] [address_1] [address_2] [city] [country_2_code] [zip] for both delivery and invoice fields it has just pulled the invoice address details for both.

I was expecting there to be delivery related fields that could be chosen, for example [delivery_full_name] [delivery_address_1] [delivery_address_2] [delivery_city] [delivery_country_2_code] [delivery_zip].

However on checking the database i can see both invoice and delivery address details are held in the same table virtuemart_order_userinfos with the same column headers [address_1] [address_2] [city] [zip]

How can you pull the delivery address fields seperately?

Kind regards

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

However on checking the database i can see both invoice and delivery address details are held in the same table
Correct and it gets more interesting. A billing address is always stored as BT but a shipping address is only stored if it is different from the billing address and this is then stored as ST. So per order you can have either 1 or 2 rows in the database.

How can you pull the delivery address fields seperately?
See above, it is based on the BT or ST setting. This is in turn controlled by the option in the template Order address type. You can set this to Billing or Shipping address. The Help button will explain what the differences are.

Your XML layout is wrong as you are not using the shipping_ fieldnames. It is normal, if you use the same fieldnames, you get the same output. Make sure you use the shipping_ fieldnames as shown in the tutorial.
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. # 3
Accepted Answer Pending Moderation
thanks Roland.

Have used the shipping_ field names as advised and set order address type as "billing or shipping" under the template options.

this part of the template layout now looks like:


<ConsumerAddress>
<Name>[shipping_full_name]</Name>
<FirmName>[shipping_company]</FirmName>
<AddressLine1>[shipping_address_1]</AddressLine1>
<AddressLine2>[shipping_address_2]</AddressLine2>
<AddressLine3>[shipping_city]</AddressLine3>
<AddressLine4>[shipping_country_2_code]</AddressLine4>
<AddressLine5></AddressLine5>
<PostCode>[shipping_zip]</PostCode>
<phone>[shipping_phone_1]</phone>
<mobilephone>[shipping_phone_2]</mobilephone>
</ConsumerAddress>
<InvoiceAddress>
<InvoiceAddress1>[full_name]</InvoiceAddress1>
<InvoiceAddress2>[address_1]></InvoiceAddress2>
<InvoiceAddress3>[address_2]></InvoiceAddress3>
<InvoiceAddress4>[city]></InvoiceAddress4>
<InvoiceAddress5>[country_2_code]></InvoiceAddress5>
<InvoicePostCode>[zip]</InvoicePostCode>
<InvoiceCountryCode>[country_2_code]<InvoiceCountryCode>
<phone>[phone_1]</phone>
<mobilephone>[phone_2]</mobilephone>
<email>[email]</email>
</InvoiceAddress>


which now generates xml info:


<ConsumerAddress>
<Name>[shipping_full_name]</Name>
<FirmName>[shipping_company]</FirmName>
<AddressLine1>[shipping_address_1]</AddressLine1>
<AddressLine2>[shipping_address_2]</AddressLine2>
<AddressLine3>[shipping_city]</AddressLine3>
<AddressLine4>[shipping_country_2_code]</AddressLine4>
<AddressLine5></AddressLine5>
<PostCode>[shipping_zip]</PostCode>
<phone>[shipping_phone_1]</phone>
<mobilephone>[shipping_phone_2]</mobilephone>
</ConsumerAddress>
<InvoiceAddress>
<InvoiceAddress1><![CDATA[Isaac Broom]]></InvoiceAddress1>
<InvoiceAddress2><![CDATA[Prospect House]]>></InvoiceAddress2>
<InvoiceAddress3><![CDATA[The Street, Rickinghall]]>></InvoiceAddress3>
<InvoiceAddress4><![CDATA[Diss, Norfolk]]>></InvoiceAddress4>
<InvoiceAddress5><![CDATA[GB]]>></InvoiceAddress5>
<InvoicePostCode><![CDATA[IP22 1DY]]></InvoicePostCode>
<InvoiceCountryCode><![CDATA[GB]]><InvoiceCountryCode>
<phone><![CDATA[01379 898860]]></phone>
<mobilephone><![CDATA[07851142115]]></mobilephone>
<email><![CDATA[isaacbroom@hotmail.com]]></email>
</InvoiceAddress>

As you can see it is not returning the shipment address details even though in this example one exists.

As [shipping_full_name] [shipping_company] [shipping_address_1] etc. dont exist as table columns in the database or selectable fields to add in the csvi template how does it look this up?

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello Tim,

Looking further into this I noticed that the shipping_ fields are only available in the Snelstart export and it isn't pulling the data as expected, so I need a little more time to dive into this. I will get back to you on this.

As [shipping_full_name] [shipping_company] [shipping_address_1] etc. dont exist as table columns in the database or selectable fields to add in the csvi template how does it look this up?
If you are interested in how it works exactly, take a look at the snelstart.php file that contains the code.
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. # 5
Accepted Answer Pending Moderation
Thanks Roland, that would be much appreciated!

Kind regards

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

Well this was quite some challenge but I believe the solution is here. You can apply the attached patch file to your system, you can unzip the file to the root of your website and all the folders should be in the correct place or you can manually put the files in the correct location. The files are already in the correct folder structure in the zipfile.

Here is what needs to be done. Go to Maintenance -> Tasks and click Reset and confirm. After that you need to create a new template of the operation Snelstart. This export contains the shipping_ fields you want to use. You need to fill the layout fields as well like you did before.

Now you should be able to export the fields with the data as needed.

Let me know how it goes.
Attachments (1)
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
ok thanks Roland, i'll have a look at this now and let you know how it goes

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hi Roland

Just manually dropping these in, can i just check something.

There is already a folder called \administrator\components\com_csvi\helpers

do we also want a seperate folder called \administrator\components\com_csvi\helper or did you just miss the "s" off :) ??

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hello Tim,

In CSVI 6 the folder is called helper without the S. There is no helpers folder in CSVI 6. So I am guessing now you are not using CSVI 6?
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. # 10
Accepted Answer Pending Moderation
Hi Roland

No, using 5.21.1

Will that work in this version?

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 11
Accepted Answer Pending Moderation
Hello Tim,

So that doesn't help if you talk about CSVI 5 and I am talking about CSVI 6. Anyways, you still need to select the Snelstart option for export to get the shipping_ fields. Did you choose that?
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. # 12
Accepted Answer Pending Moderation
Hi Roland

No i had been using advanced order export.

I'll have a go using Snelstart Order Export, but i am on csvi 5.21.2

Is that ok or do i need to upgrade to csvi 6 for this to work?

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 13
Accepted Answer Pending Moderation
Hello Tim,

This will also work on 5.21.2 because the Snelstart is in there as well.
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. # 14
Accepted Answer Pending Moderation
great, i'll have a go and let you know

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 15
  • Page :
  • 1


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