Search Knowledge Base by Keyword

Is it possible to remove or leave product description field blank?

Can you remove or leave the product description field blank when using the WooCommerce FedEx Shipping Plugin with Print Label? Check out here to know more.

Customer:

Is it possible to remove or leave the product description field blank?


PluginHive Support:

We have observed that your product name and description are in Hindi.
Please note that FedEx doesn’t support the Hindi language for their API. Moreover, you will not be able to create labels from FedEx website if the input language is in Hindi.

But as a workaround solution for you, we have created a code snippet which will help you change the values for $product_name and $product_description to the desired value (currently set as ‘Book’). You have to paste this snippet to your theme’s functions.php or anywhere relevant.

add_filter(‘wf_fedex_request’,’wf_fedex_label_custom_product_name_request_callback’, 10, 2 );
function wf_fedex_label_custom_product_name_request_callback($request, $order){
$product_name = ‘Book’; //Type here a product name  it’ll come as name of all products, Don’t leave this blank or white space
$product_description = ‘Book’; //Description, This will come for all products, Don’t leave this blank or white space

$commodities = isset( $request[‘RequestedShipment’][‘CustomsClearanceDetail’][‘Commodities’] ) ? $request[‘RequestedShipment’][‘CustomsClearanceDetail’][‘Commodities’] : ”;

if($commodities != ” ){
foreach ($commodities as $key => $commodity) {
$request[‘RequestedShipment’][‘CustomsClearanceDetail’][‘Commodities’][$key][‘Name’] = sanitize_title( $product_name );
$request[‘RequestedShipment’][‘CustomsClearanceDetail’][‘Commodities’][$key][‘Description’] = sanitize_title( $product_description );
}
}

return $request;
}

Last Updated On September 20, 2018