• Resolved Simone

    (@seo-freelance)


    Dear Algol,

    I’d like to merge the fieds:

    – Address1 with Address2
    – Full Name (name and surname) with Company Name

    Is it possible? 🙂

    Many thanks for the help!
    BR
    Simone

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

    (@algolplus)

    hi Simone

    Yes, here is code.
    You can replace “shipping” with “billing”

    add_filter('woe_get_order_fields', 'woe_add_order_fields', 10, 1);
    function woe_add_order_fields($fields) {
    	$fields['shipping_address_full'] = array('label'=>'Shipping Address','checked' => 1, 'segment'=>'shipping','colname'=>'Shipping Address','default'=>0);
    	$fields['shipping_fullname_and_company'] = array('label'=>'Shipping Full Name and Company','checked' => 1, 'segment'=>'shipping','colname'=>'Shipping Full Name and Company','default'=>0);
    	return $fields;
    }
    add_filter('woe_get_order_value_shipping_address_full','woe_get_shipping_address_full', 10, 2);
    function woe_get_shipping_address_full($value,$order) {
    	return $order->shipping_address_1 . " " . $order->shipping_address_2;
    }
    add_filter('woe_get_order_value_shipping_fullname_and_company','woe_get_shipping_fullname_and_company', 10, 2);
    function woe_get_shipping_fullname_and_company($value,$order) {
    	return $order->shipping_first_name. " " . $order->shipping_last_name. " ". $order->shipping_company;
    }
    
Viewing 1 replies (of 1 total)

The topic ‘How to Merge Fields’ is closed to new replies.