• Resolved gromifi

    (@gromifi)


    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>
    • This topic was modified 2 years, 8 months ago by Jan Dembowski. Reason: Topic title changed to something useful
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author algol.plus

    (@algolplus)

    hi

    2. please, open section XML and you can rename some tags.

    1,3,4. I think you should use another way , it requires a bit of programming.
    Please, visit https://docs.algolplus.com/algol_order_export/sample-addons/
    Download and install XML plugin (via >Plugins>Add New>Upload)
    Go back to export – you should mark checkbox at bottom (just above buttons)
    Use FileZilla to edit file /wp-content/plugins/woe-custom-xml/woe-custom-xml.php

    Thread Starter gromifi

    (@gromifi)

    Once activated, I get error:
    Fatal error: Uncaught Error: Call to a member function get_sku() on bool in /home/xqlsqsag/public_html/wp-content/plugins/woe-custom-xml/woe-custom-xml.php:87 Stack trace: #0 /home/xqlsqsag/public_html/wp-includes/class-wp-hook.php(309): Woe_Custom_XML->woe_xml_make_order(Object(SimpleXMLElement), Array) #1 /home/xqlsqsag/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters('<Order><Id>3535...', Array) #2 /home/xqlsqsag/public_html/wp-content/plugins/woocommerce-order-export/classes/formats/class-woe-formatter-xml.php(112): apply_filters('woe_xml_output_...', '<Order><Id>3535...', Array, Object(WOE_Formatter_Xml)) #3 /home/xqlsqsag/public_html/wp-content/plugins/woocommerce-order-export/classes/core/class-wc-order-export-engine.php(599): WOE_Formatter_Xml->output(Array) #4 /home/xqlsqsag/public_html/wp-content/plugins/woocommerce-order-export/classes/admin/tabs/ajax/trait-wc-order-export-admin-tab-abstract-ajax-export.php(106): WC_Order_Export_Engine::build_file_full(Array) #5 /home/xqlsqsag/public_html/wp-cont in /home/xqlsqsag/public_html/wp-content/plugins/woe-custom-xml/woe-custom-xml.php on line 87

    how do I solve it?

    2. What you mean by XML Section?

    • This reply was modified 2 years, 8 months ago by gromifi.
    Plugin Author algol.plus

    (@algolplus)

    1. it seems you try to export deleted products.
    just remove/comment line

    $itemXML->addChild(“Id”,$product->get_sku() );

    2. see screenshot https://imgur.com/B69IMP3

    • This reply was modified 2 years, 8 months ago by algol.plus.
    Thread Starter gromifi

    (@gromifi)

    One more question: How do I add specific value by php to existing custom fields? (in Admin panel)

    Thread Starter gromifi

    (@gromifi)

    Or how can i translate <CustomerNote></CustomerNote>
    to <CustomerNote></CustomerNote>?

    Plugin Author algol.plus

    (@algolplus)

    if you use woe-custom-xml/woe-custom-xml.php — you must edit PHP code.

    use $order->get_meta(“key_here”) to read custom field

    Thread Starter gromifi

    (@gromifi)

    And if i use misc php editor?

    Thread Starter gromifi

    (@gromifi)

    I cant prepend items to document to do 3.

    Plugin Author algol.plus

    (@algolplus)

    I’m sorry, I can’t help you more.

    you should just hire PHP/WooCommerce programmer.

    Thread Starter gromifi

    (@gromifi)

    Then I will remember about your poor customer service. Thank you for making more problems for your own clients.

    Plugin Author algol.plus

    (@algolplus)

    We support our plugin, but we don’t have time to code custom XML for each user.

    • This reply was modified 2 years, 8 months ago by algol.plus.
    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    *Reads. That’s wrong.*

    NOTE: I have nothing to do with thus plugin, the plugin developer or any plugin or theme. I’m one of the forum moderators and your reply had hit a queue.

    This reply.

    Then I will remember about your poor customer service. Thank you for making more problems for your own clients.

    You are not a customer. You never have been and if you think you are, you are completely wrong.

    At best, you are an opensource collaborator explaining your problem with their free, opensource plugin that they are not paid in anyway support you or anyone.

    You may want to check your incorrect attitude about working with a volunteer developer who does not owe you anything. They, like all of us here is a volunteer trying to help you out of the goodness of their hearts.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘XML import problem’ is closed to new replies.