• Resolved Frankzappafication

    (@frankzappafication)


    Sorry me again… I am using the latest version of WooCommerce in conjunction with the plugin Table Rates and I have tried to use this snippet below, as I need a column in my CVS export which simply says “Ship by Weight” instead of eg “table_rate:7:6” or “table_rate:7:7” etc as well as “local_pickup:10” to say “Factory Collection”

    
    //remap shipping method titles
    add_filter('woe_get_order_value_shipping_method_title','woe_rename_shipping_method_title', 10, 4);
    function woe_rename_shipping_method_title($value, $order, $item, $product) {
     if($value == 'UK Standard Shipping') // copy these 2 lines for other mappings
            return 'STANDARD';            // copy these 2 lines for other mappings
     return $value;
    }
    
    

    The Shipping Method Title = Ship by Weight in the back end as well as the label… mmmm … I have tried every possible shipping method field that the export options give me however none give me the actual titles or labels on export per customer.

    Clearly I am doing something wrong but having fiddled with the above in various guises and options it simply won’t work… I feel bad for asking but has anyone found a solution to this?

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author algol.plus

    (@algolplus)

    hi

    Could you submit new ticket here and attach wrong file ?

    thanks, Alex

    Thread Starter Frankzappafication

    (@frankzappafication)

    Done Alex just submitted – thank you.

    Plugin Author algol.plus

    (@algolplus)

    I duplicate my reply here.

    Hi
    shipping_method and shipping_method_title are different columns ??
    please, try following code

    //remap shipping method
    add_filter('woe_get_order_value_shipping_method', function ($value, $order, $field) {
     if( strpos($value,'table_rate') !== false ) //seek for text 
            return 'Ship by Weight'; 
     if($value == 'local_pickup:10') // exact match
            return 'Factory Collection';  
     return $value;
    }, 10, 3);
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘//remap shipping method titles’ is closed to new replies.