Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter faisalzaabi

    (@faisalzaabi)

    Dear Zorem

    thanks, for the replay. I do have clear the cash and the same problem accrue again I have activated the debug log and below was showing.

    [23-Aug-2021 08:53:31 UTC] PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /home/threerimi/public_html/wp-content/plugins/woo-advanced-shipment-tracking/includes/class-wc-advanced-shipment-tracking-install.php:141
    Stack trace:
    #0 /home/threerimi/public_html/wp-content/plugins/woo-advanced-shipment-tracking/includes/class-wc-advanced-shipment-tracking-install.php(128): WC_Advanced_Shipment_Tracking_Install->check_all_column_exist()
    #1 /home/threerimi/public_html/wp-content/plugins/woo-advanced-shipment-tracking/includes/class-wc-advanced-shipment-tracking-install.php(79): WC_Advanced_Shipment_Tracking_Install->create_shippment_tracking_table()
    #2 /home/threerimi/public_html/wp-includes/class-wp-hook.php(303): WC_Advanced_Shipment_Tracking_Install->woo_shippment_tracking_install()
    #3 /home/threerimi/public_html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #4 /home/threerimi/public_html/wp-includes/plugin.php(470): WP_Hook->do_action()
    #5 /home/threerimi/public_html/wp-admin/includes/plugin.php(698): do_action()
    #6 /home/threerimi/public_html/wp-admin/plugins.php(58): activate_plugin()
    #7 {main}
      thrown in /home/threerimi/public_html/wp-content/plugins/woo-advanced-shipment-tracking/includes/class-wc-advanced-shipment-tracking-install.php on line 141
    Thread Starter faisalzaabi

    (@faisalzaabi)

    Thanks @pomegranate

    I have updated but it didn’t retrieve any. the code

    add_action( ‘wpo_wcpdf_after_order_data’, ‘wpo_wcpdf_shipping_tracking’, 10, 2 );
    function wpo_wcpdf_shipping_tracking($template_type, $order) {
    if ($template_type == ‘invoice’) {
    $order_id = $order->get_id();
    $tracking_items = get_post_meta( $order_id, ‘_wc_shipment_tracking_items’, true );

    echo ‘<tr class=”tracking”>’;
    echo ‘<th>Tracking:</th>’;
    foreach( $tracking_items as $tracking_item ) {
    echo ‘<td>’.esc_html( $tracking_item[‘_awb-no’] ).'</td>’;
    echo ‘<td>’.esc_html( $tracking_item[‘_awb_no’] ).'</td>’;
    }
    echo ‘</tr>’;
    }
    }

    Thread Starter faisalzaabi

    (@faisalzaabi)

    Dear @kluver

    Thanks for rechout I have tried the below code but it didn’t work `add_action( ‘wpo_wcpdf_after_order_data’, ‘wpo_wcpdf_order_data’, 10, 2 );
    function wpo_wcpdf_shipping_tracking($template_type, $order) {
    if ($template_type == ‘invoice’) {
    if ( $tracking_items = $order->get_meta(‘_awb_no’) ) {
    ?>
    <tr class=”tracking-item”>
    <th>Tracking:</th>
    <td>
    <?php
    foreach( $tracking_items as $tracking_item ) {
    echo esc_html( $tracking_item[‘_awb_no’] ).”<br>”;
    echo esc_html( $tracking_item[‘_awb_no’] );
    }
    ?>
    </td>
    </tr>
    <?php
    }
    }
    }`

    The metadata string to retrieve is “_awb_no”

Viewing 3 replies - 1 through 3 (of 3 total)