Skip to content

Instantly share code, notes, and snippets.

Avatar

Shadi Manna shadimanna

View GitHub Profile
View gist:a7bc62eb3dc50145fcd331023c022cf5
add_filter('pr_shipping_dhl_label_args', 'remove_email_number', 10, 2);
function remove_email_number($args, $order_id) {
if(isset($args['shipping_address']['email'])){
unset($args['shipping_address']['email']);
}
return $args;
}
View gist:6751305c06a852b972247af0e595d145
add_filter('pr_shipping_dhl_order_weight', 'custom_add_weight', 10, 2);
function custom_add_weight($total_weight, $order_id) {
$total_weight += 1; // Add any weight needed, units of measure will be whatever is set in WooCommerce
return $total_weight;
}
@shadimanna
shadimanna / gist:d1c32e93dad8008dddd9151b69e0994c
Last active Aug 19, 2020
Do not pass phone number to DHL API
View gist:d1c32e93dad8008dddd9151b69e0994c
add_filter('pr_shipping_dhl_label_args', 'remove_phone_number', 10, 2);
function remove_phone_number($args, $order_id) {
if(isset($args['shipping_address']['phone'])){
unset($args['shipping_address']['phone']);
}
return $args;
}
View Download File
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
// $file = sanitize_file_name( $_GET['path'] );
// sanitize path
$file = realpath( $_GET['path'] );
// echo $file;
if ( current_user_can( 'edit_shop_orders' ) && check_admin_referer( 'download-dhl-label' ) ) {