• Resolved dotcircle

    (@dotcircle)


    Hi Ewout,

    Since you are the developer of the MyParcel plugin too, I hope this is a question with a simple answer.. ??
    For one of the webshops I developed my customers wants the delivery date of the MyParcel plugin to display on the packing slip. Is that possible?

    Question #2: is it possible to display the number of times that a customer has ordered something in the webshop on the packing slip? This way they can send a little present if the customer ordered 5 times for instance..

    Thanks for your time,

    Marcel

    • This topic was modified 7 years, 1 month ago by dotcircle.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hello Marcel,
    The easiest way to add the MyParcel delivery date is with the Premium Templates extension. If you own a copy, you can add the delivery date using any of the following placeholders in a custom block:

    • {{myparcel_delivery_date}}
    • {{myparcel_tracktrace}}
    • {{myparcel_tracktrace_link}}
    • {{myparcel_delivery_options}}

    Alternatively, in a custom template you can use:

    
    <?php
    if ($delivery_date = WooCommerce_MyParcel()->export->get_delivery_date( $this->order ) ) {
    	$formatted_date = date_i18n( apply_filters( 'wcmyparcel_delivery_date_format', wc_date_format() ), strtotime( $delivery_date ) );
    	echo $formatted_date;
    }
    ?>
    

    Displaying the number of times that a customer has ordered something is definitely possible, although this requires more custom coding than I can provide as part of free support here… You could use the wc_customer_bought_product() function to check: https://github.com/woocommerce/woocommerce/blob/3.2.1/includes/wc-user-functions.php#L197

    Hope that helps!
    Ewout

    Thread Starter dotcircle

    (@dotcircle)

    Hi Ewout,

    Thanks so much! Will definitely look into the premium templates when my client wants more options to customize. In the meantime I will use the custom template.

    Marcel

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display date from MyParcel plugin & total orders’ is closed to new replies.