Custom checkout field value in vendor dashboard order page

WCMp Advanced Frontend Manager

Custom checkout field value in vendor dashboard order page Open

Viewing 1 reply thread
  • Author
    Posts
    • #110333
      Vivek Sharma
      Participant

      Hi, I added code below to add a custom checkout field and the value is rendered in admin portal. I need the same value to be rendered in Shipping Details box in order detail page in vendor dashboard. Could you please provide me the code snippet for doing so. Also, how can I add a image upload field in checkout field and render in order detail page below Customer Note.

      Thank you.

      add_action( 'woocommerce_admin_order_data_after_shipping_address', 'edit_woocommerce_checkout_page', 10, 1 );
      function edit_woocommerce_checkout_page($order){
          global $post_id;
          $order = new WC_Order( $post_id );
          echo '<p><strong>'.__('Shipping Phone number').':</strong> ' . get_post_meta($order->get_id(), '_shipping_phone', true ) . '</p>';
      }
      Copy
    • #110417
      abhirup
      Moderator

      Hi,
      Please override templates/vendor-dashboard/vendor-orders/views/html-order-info.php template by copying it to yourtheme/dc-product-vendor/vendor-dashboard/vendor-orders/views/html-order-info.php.

      add your code to show the shipping phone no

      To add image in order detail page below Customer Note.
      Override templates/vendor-dashboard/vendor-orders/views/html-order-notes.php template by copying it to yourtheme/dc-product-vendor/vendor-dashboard/vendor-orders/views/html-order-notes.php.

      Please check out the link as a reference for adding custom field on checkout page – https://www.businessbloomer.com/woocommerce-add-custom-checkout-field-php/

      Regards,

Viewing 1 reply thread

Please LOGIN to reply to this topic

Buy all Marketplace addons together, check out our Bundle

Buy at Slashed Price