Looking for help?
< All Topics
Print

how to set default shipping information

use this snippet code to add default shipping address on your pos

add_filter('op_new_order_data',function($order_data){
    $add_shipping = isset($order_data['add_shipping']) ? $order_data['add_shipping'] : false;
    if(!$add_shipping)
    {
        $order_data['add_shipping'] = true;
        $order_data['shipping_method'] = 'store_pickup'; // use this code if you want change default shipping method

        $order_data['shipping_information'] = array(
            'name' => 'john doe',
            'address' => '123 abc street',
            'address_2' => '',
            'city' => 'Melbourne',
            'state' => 'Victoria',
            'postcode' => '3000',
            'country' => 'AU',
            'phone' => '123456789',
        );
    }
    return $order_data;
 },10,1);
Table of Contents