Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author WP Scripts

    (@wpscripts)

    Hello,

    WooCommerce does not provide the API to send custom information to the application. But as you suggested we can send those information with some default fields like Notes.

    You can take help of developers to achieve this or can contact us at [email protected] for paid support.

    Thanks & Regards,
    Team WP Scripts

    Hello. I need please the same solution for my site. Have you been able to find a solution to this problem? thanks!

    Plugin Author WP Scripts

    (@wpscripts)

    Hello @javicon

    WooCommerce does not provide any API to add custom meta to WooCOmmerce App. So as long as that is not available we won’t be add anything to the App.

    Regards,
    Team WP Scripts

    Yes, I know that. But if you could develop that this information was copied as a note in the order, this information would appear in the information of the app. This would be a great solution. Thanks

    Hi,

    I’ve finally got it!. Adding code in the class-wfs-services.php file.
    Now in the woocommerce app I can see the information below “Order notes”.

    Thread Starter hieudo

    (@hieudo)

    @javicon would you mind sharing your solution?

    Yes.

    In the file incudes/class-wfs-services.php
    I added on the line 339 this code:

    $order = wc_get_order( $order_id );
    $nota_orden = “Type: “.$wfs_service_type.” – Date: “.$wfs_service_date .” – Time: “.$wfs_service_time;
    $note = __($nota_orden);
    $order->add_order_note( $note );

    Works great, Thanks for sharing.

    Now if only we could also get any Special notes for each product to also display in WP app somehow

    Plugin Author WP Scripts

    (@wpscripts)

    Hello,

    I would recommend you to use the following code which is a modified version of your code on you theme functions.php. Because as you have added the code on the plugin file itself, it will be erased on next version update immediately.

    function save_services_meta_custom( $order_id ) {
    
    	// Save Service Type
        $wfs_service_type = ! empty( $_POST['wfs_service_type'] ) ? sanitize_text_field( $_POST['wfs_service_type'] ) : $_COOKIE['service_type'];
    
        // Save Service Date
        $wfs_service_date = ! empty( $_POST['wfs_service_date'] ) ? sanitize_text_field( $_POST['wfs_service_date'] ) : $_COOKIE['service_date'];
    
        // Save Service Time
        $wfs_service_time = ! empty( $_POST['wfs_service_time'] ) ? sanitize_text_field( $_POST['wfs_service_time'] ) : $_COOKIE['service_time'];
    
        $order = wc_get_order( $order_id );
    	$nota_orden = "Type: " . $wfs_service_type . " – Date: ". $wfs_service_date . " – Time: " . $wfs_service_time;
    	$note = __($nota_orden);
    	$order->add_order_note( $note );
    }
    add_action( 'woocommerce_checkout_update_order_meta', 'save_services_meta_custom', 10 );

    Note: This is not tested by us. This is just modified from above code to make it a persistence solution. Hope WC will add the custom meta API to app soon.

    Regards,
    Team WP Scripts

    @javicon
    Hi,
    How did you generate that code for the mobile app? Did you code it yourself?
    If yes, can you do the same with woocommerce product addons so that the addons show in the mobile app?
    Thanks.

    Thanks @wpscripts for the version of the code to functions.php.

    Hi @mikdad. Sorry, but I know the basics of php development. It has taken me a long time to develop those lines of code.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Suggestion: add Pickup/Delivery Date and Time to WooCommerce App’ is closed to new replies.