Support » Plugin: WC Pickup Store » Add info to Emails and PDFs

  • Hi Keylor,

    I’ve taken a look at the forum posts and can see you’ve referenced https://gist.github.com/KeylorCR/18cefd93ea1a350aaf1485148779036e for adding info to emails – But I cant seem to get it working. Can you advise if these snippets still work?

    Im trying to display the stores name/title

    Heres what I’ve added to the functions.php

    function custom_reordering_order_item_totals($total_rows, $order, $tax_display) {
    $order_id = $order->get_id();
    $store_name = get_post_meta($order_id, ‘_shipping_pickup_stores’, true); // Get store title for this order
    $store = get_page_by_title($store_name, OBJECT, ‘store’);
    $store_name = get_post_meta($store->ID, ‘title’, true);

    if($order->has_shipping_method(‘wc_pickup_store’) && !empty($store_name)) {
    foreach ($total_rows as $key => $row) {
    $new_rows[$key] = $row;
    if($key == ‘shipping’) {
    $new_rows[‘store_data’] = array(
    ‘label’ => __(‘title’, ‘text_domain’),
    ‘value’ => $store_name
    );
    }
    }
    $total_rows = $new_rows;
    }
    return $total_rows;
    }
    add_filter(‘woocommerce_get_order_item_totals’, ‘custom_reordering_order_item_totals’, 10, 3);

    Please help!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.