!data field not returning any info

Project:EDI Order Import/Export
Component:Code
Category:
Priority:normal
Assigned:Unassigned
Status:active
Description
Project: 
1515

I have a problem that the !data field that I put in the ''Order product export pattern" is not returning any info.

I put the following in the ''Order product export pattern":
!batch_id, !order_id, !nid, !model(20), !title(255), !data, !qty, !price

!data is the only product field not showing any info in the exported file.

The !date field is very importent because all the user (buyer) generated info is put in this field.

Can anyone help.
Thanks in advance.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: !data field not returning any info

The problem is that data is an array and not just a value. The EDI module skips over elements that are arrays or objects when building the tokens b/c there's no way for it to know what to do with them. You'd need to modify the module in the function uc_edi_order_product_values() to add something like this:

<?php
 
// Insert this:
 
$values['!data'] = serialize($order->data);
 
// Insert above this line...
 
$values['!batch_id'] = variable_get('uc_edi_order_next_batch_id', 1000);
?>

I can't test this, so toy with it to make it work. Also, disregard the fact that it's named $order... it should all be named $product for that function, but I forgot to rename the argument/variable after copy/pasting.

Jorisvt's picture
Offline
Joined: 10/07/2007
Juice: 11
Thanks for pointing me in the right direction, but...
Assigned to:Ryan» Jorisvt

I added the line but I did not get any different results. It's difficult for me to toy with it because I am not a programmer.
Could you help me a little bit futher.

xtfer's picture
Offline
Joined: 12/08/2007
Juice: 5
No CCK integration then?
Assigned to:Jorisvt» xtfer

Im assuming this means any CCK fields have to be manually patched in, as they are all arrays... Or have i got this completely wrong.