This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('wf_fedex_request','custom_label_orientation', 10, 2 ); | |
function custom_label_orientation($request, $order){ | |
$fedex_settings = get_option( 'woocommerce_wf_fedex_woocommerce_shipping_settings', null ); | |
$selected_service = $request['RequestedShipment']['ServiceType']; | |
$custom_services = $fedex_settings['services']; | |
$shipping_charge = $order->get_total_shipping(); | |
$handling = $shipping_charge; | |
// Cost adjustment % |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('wf_fedex_calculate_shipping_request', 'modify_fedex_request', 10, 2); | |
function modify_fedex_request($fedex_requests, $fedex_packages){ | |
$insurance_amount = 100; // New Insurance amount | |
foreach ($fedex_requests as $req_no => &$request) { | |
if( isset($request['RequestedShipment']['TotalInsuredValue']['Amount']) ) { | |
$count = 0; | |
foreach( $request['RequestedShipment']['RequestedPackageLineItems'] as $key => $item ) { | |
$request['RequestedShipment']['RequestedPackageLineItems'][$key]['InsuredValue']['Amount'] = $insurance_amount; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('xa_canadapost_rate_request', 'sanitize_postal_code_for_rate_req', 10, 2); | |
function sanitize_postal_code_for_rate_req($xmlRequest, $package){ | |
$xml_obj = new SimpleXMLElement($xmlRequest); | |
if( isset($xml_obj->{'destination'}->{'domestic'}->{'postal-code'}) ){ | |
$xml_obj->{'destination'}->{'domestic'}->{'postal-code'} = str_replace("-","",$xml_obj->{'destination'}->{'domestic'}->{'postal-code'} ); | |
} | |
$doc = new DOMDocument(); | |
$doc->formatOutput = TRUE; | |
$doc->loadXML($xml_obj->asXML()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('ph_ups_label_shipping_method', 'ph_ups_label_shipping_method', 10, 2); | |
function ph_ups_label_shipping_method( $shippingmethod, $order ){ | |
//Config this array | |
$shipping_method_map = array( | |
'free_shipping' => '03', | |
'flat_rate' => '12', | |
); |
OlderNewer