• panigale

    (@panigale)


    Hello,

    You’re plugin is really amazing! But I have one little problem. In my XML I need date range for my export. I export orders for yesterday (every day) and I need something like that in the beggining of XML: <OrdersForPeriod from=”{date_From}” to=”{date_to}”/>

    I was trying to write few functions but everytime I’m getting error. Is possible to achive something like that?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author algol.plus

    (@algolplus)

    Hello

    Could you share sample full XML ? You can submit it as new ticket to https://algolplus.freshdesk.com/

    Plugin Author algol.plus

    (@algolplus)

    Open section XML and set empty “Root tag”

    Add following code to section “Misc Settings”

    add_filter( "woe_xml_output_after_root_tag", function($s, $formater){
    	$settings = WC_Order_Export_Engine::$current_job_settings;
    	return "<OrdersForPeriod from=\"{$settings[from_date]}\" to=\"{$settings[to_date]}\"/>\n";
    }, 10,2 );
    
    add_filter( "woe_xml_output_before_closing_root_tag", function($s, $formater){
    	return '</OrdersForPeriod>';
    }, 10,2 );
    Thread Starter panigale

    (@panigale)

    Hi,

    Wow, that was so quick response! If I insert this function to PHP code I get an error 🙁

    There has been a critical error on this website.

    Learn more about troubleshooting WordPress.

    Thread Starter panigale

    (@panigale)

    And this is my final structure which I need to build

    <data> 
    <OrdersForPeriod from="2023-05-01" to="2023-05-20"/>
     <post> 
     Billing & Shipping Info		
      <OrderItems>
       <Item> 
       Product Info
       </Item> 
      </OrderItems>
     </post>
    </data> 
    Plugin Author algol.plus

    (@algolplus)

    Hello

    Did you add code to “Misc Settings” ?

    Please, submit your settings as new ticket to https://algolplus.freshdesk.com/

    Visit tab “Tools” to get these settings

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Add date range to XML’ is closed to new replies.