• Print Invoice & Delivery Notes for WooCommerce(プラグイン)とこちらのプラグインを併用していますが配達希望日時が納品書に記載されません。
    配達希望日時を納品書に記載する方法はありますか?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author shohei.tanaka

    (@shoheitanaka)

    @takumisan0620 さん

    すいません。こちらはプラグインごとの個別対応なので、個別に対応してもらえたらと思います。
    多分、納品書プラグインの方にフィルターがあると思うので、そちらで対応することになるかと思うのですが。
    もしくは、PRO版にメジャーなプラグインの対応を同梱しようかと思って、今検討中です。

    他のプラグインの管理って結構手間のかかる作業なので無償提供は難しいことご理解頂ければ嬉しいです。

    Thread Starter takumisan0620

    (@takumisan0620)

    ありがとうございます。

    Print Invoice & Delivery Notes for WooCommerceの方から下記のメッセージをいただいたのですが、具体的にどうすればいいのか分かりません、アドバイスお願いできますでしょうか?

    ______________

    Yes, you can include the additional fields in the Invoice. We do have a function that you can use to add your fields using the meta keys for those fields. Please refer to this example function and you can replace the meta keys for your arrival date and time fields in the function to add those fields:

    /**
     * Add this code snippet in functions.php file of your currently active theme.
     * An example that adds a 'VAT' and 'Customer Number' field to the end of the list. 
     */
    function example_custom_order_fields( $fields, $order ) {
        $new_fields = array();
            
        if( get_post_meta( $order->id, 'your_meta_field_name', true ) ) {
            $new_fields['your_meta_field_name'] = array( 
                'label' => 'VAT',
                'value' => get_post_meta( $order->id, 'your_meta_field_name', true )
            );
        }
        
        if( get_post_meta( $order->id, 'your_meta_field_name', true ) ) {
            $new_fields['your_meta_field_name'] = array( 
                'label' => 'Customer Number',
                'value' => get_post_meta( $order->id, 'your_meta_field_name', true )
            );
        }
        
        return array_merge( $fields, $new_fields );
    }
    add_filter( 'wcdn_order_info_fields', 'example_custom_order_fields', 10, 2 );
    Plugin Author shohei.tanaka

    (@shoheitanaka)

    @takumisan0620

    wc4jp-delivery-date と wc4jp-delivery-time-zone の post meta を取得して表示するようにしたら大丈夫かと思います。
    WooCommerce の WP_Order の指定関数の get_meta 関数を利用して取得することをオススメします。
    また、未選択の場合は wc4jp-unspecified-date と wc4jp-unspecified-time を get_option で取得出来ますので、利用頂ければと思います。

    また、こちらのフィルターの表示場所は私には分かりませんので、その点はご利用のプラグインのソースコードを確認して頂ければ出来るかと思います。

    具体的には以上です。

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘納品書へ配達希望日を記載したい’ is closed to new replies.