• Resolved gunlok123

    (@gunlok123)


    Hi,
    I’m using your plugin which is very good. Recently I started to use WC Autoship and the scheduled payment always failed. I find out that this is because this error
    The error returned is
    “Delivery Date is a required field”
    This is a custom field that is not part of WC Autoship. This field must be added to WC Autoship with custom scripting

    <?php
    /**
    * @param array $order_data
    * @param int $customer_id
    * @param string $shipping_method
    * @param string $payment_gateway_id
    * @param string $payment_token_id
    * @return array 
    */
    function wc_autoship_checkout_order_data_example( $order_data, $customer_id, $shipping_method, $payment_gateway_id, $payment_token_id ) {
      // Add a custom field to order_data
      $order_data['my_custom_field'] = 'my_custom_value';
      return $order_data;
    }
    add_filter( 'wc_autoship_checkout_order_data', 'wc_autoship_checkout_order_data_example', 10, 5 );

    Can you please help what I should put in my_custom_field and my_custom_value

    Regards,
    Michal

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi Michal,

    I have checked your site and I have observed that you are using the Pro version of our plugin.

    Thank you for liking our plugin, providing us the URL of your site and for sharing the custom code.

    my_custom_field: Here the field name should be used which is ‘Delivery Date’ which is the default value.

    If the Date field label is changed in the Appearance link then you can fetch the id of the field as get_option( ‘orddd_delivery_date_field_label’ );

    my_custom_value: The selected delivery date for the order can be fetch using the $_POST variable.

    In order to fetch the selected delivery date, please use the $_POST[ ‘e_deliverydate’ ];

    Please let me know whether the provided information helped you to achieve the requirement on your site.

    For any queries related to Pro version, please contact us through our forum or through our site.

    We will surely answer your queries regarding Pro version there.

    I am attaching links for your convenience: https://www.tychesoftwares.com/forums/forum/order-delivery-date-pro-for-woocommerce/ , https://www.tychesoftwares.com/store/premium-plugins/order-delivery-date-for-woocommerce-pro-21/

    Regards,
    Komal Maru

Viewing 1 replies (of 1 total)

The topic ‘Delivery Date is a required field’ is closed to new replies.