Quantcast
Channel: Topic Tag: xml | WordPress.org
Viewing all articles
Browse latest Browse all 3201

XML import problem

$
0
0

i need urgent help with several questions regarding XML import:
1. I have this code in misc but it is not working.

// add order field "Order Time"
add_filter('woe_get_order_fields', function ($fields) {
	$fields['order_time'] = array( 'label' => 'ArrivalTime', 'colname' => 'ArrivalTime', 'checked' => 1 );
	return $fields;
});
// calculate new field
add_filter('woe_get_order_value_order_time', function ($value,$order, $field) {
	return $order->get_date_created()->date("H:i:s");
}, 10, 3);

The value is wrong, it does not give seconds. I need separate fields for date and time in XML import output goes like this now: <ArrivalDate>2022-03-30 14:06</ArrivalDate><ArrivalTime>2022-03-30 14:06</ArrivalTime>. it does listen only to Format in settings.

2. How to rename tags?
<Orders> to <SalesOrders>
<Order> to <SalesOrder>
<product> to <OrderRow>

3. How do i add fields at the start of the xml document? I need to put two fields like this

<?xml version="1.0" encoding="UTF-8"?>
<LoocosShopXML>
    <LSSite></LSSite>
    <LSTimeStamp>2021-01-07</LSTimeStamp>
    <SalesOrders>
        <!-- BEGIN LOOP -->

4. How do i create new order groups?

I need to create new order groups in xml output which looks like this:
<CustomerNotes>
<CustomerNote></CustomerNote>
</CustomerNotes>

and

<PaymentStatus>
                <Amount>59</Amount>
                <PaidDate>2021-01-07</PaidDate>
                <BankID></BankID>
                <Info>blah blah blah</Info>
            </PaymentStatus>

Viewing all articles
Browse latest Browse all 3201

Trending Articles