Print Invoice, Packing Slip, Delivery Note & Label – Add Tracking Number and Ship Date to Labels

WooCommerce Print Invoice, Packing Slip, Delivery Note & Label Plugin helps you to generate and print Invoices, Packing List, Delivery Note and Shipping/Address labels in PDF format within WooCommerce Order page. The invoice and packing slip will be automatically generated at the time of order completion. Code Snippet to add Tracking Number and Ship Date. Below code snippet will let you add tracking number and ship date to Shipping/Address Labels. You have to customise the below code according to the third [...]

Export Additional Order Meta Data from WooCommerce.

For exporting additional meta data for the orders using Order Export Import Plugin for WooCommerce below code snippet can be used in the child theme's functions.php Please refer this updated article if you have Order Export Import Plugin version greater than 1.1.0. Below article is only relevant for prior versions. In this example we are adding 3 extra fields shown below with export CSV as shown in the code snippet. 'pdf_invoice_num' => '_invoice_number_display', 'Payer PayPal address' => 'Payer PayPal address', 'PayPal Transaction [...]

Customize / Edit / Manage WooCommerce Checkout Fields using Actions and Filters

WooCommerce gets billing and shipping fields from the countries class class-wc-countries.php and get_address_fields function. This gives flexibility enable/disable fields based on the user’s location. With minimal development effort, these fields are highly customizable using actions and filters. If you are looking for a plugin to do this job, this article should help. Filter Hooks to add and update checkout fields includes Billing and Shipping Address Fields These actions and filters (refer the function get_address_fields ) give you complete control over checkout [...]

Change or Disable WooCommerce Cart / Checkout Options based on User Role and Country

Given below is the code snippet to Disable Checkout Options based on User Roles and Country. We can check the user role based on the unique capabilities it has. Below snippet will enable the Payment Option "CC Avenue" only if the customer country is "IN" (India). Also, the snippet will enable PayPal as Payment Option if the customer is from any other countries. Check out this WordPress article for More information on Roles and Capabilities.

WooCommerce – Filter shipping methods based on state

Below code snippet helps to filter shipping methods based on States. In this particular example, the USPS rates will show up only when the user enters state from AK, HI, PR, GU, AS, VI, or UM ( convert it to appropriate state names please ) on cart/checkout page. Also, please note that below code is written for the product WooForce USPS Shipping Plugin for WooCommerce. You can change the elements of the array eligible_services_for_states_list to the appropriate one to make it [...]

WooCommerce – Hide shipping methods if items of specific Shipping Class is NOT in cart

Below snippet will hide shipping methods if none of the items in the cart belongs to the specific Shipping Class. Use the array variable $shipping_classes to define the shipping classes. Define the services to hide using the array variable $shipping_services_to_hide. If you are looking for a plugin to do this job, visit ELEX Hide Shipping Methods Plugin. Using this plugin, You can easily hide shipping methods based on various conditions. If you want to hide all the shipping methods, you can refer [...]

WooCommerce 2.6 – Hide shipping methods when FREE SHIPPING is available

WooCommerce 2.6 brings major changes in the shipping module including the introduction of Shipping Zone. These changes break the number of existing snippets including the snippet to Hide shipping methods when FREE SHIPPING is available. This is because of minor changes in the way $rates array is formed for the shipping method "Free Shipping". Prior to WooCommerce 2.6, the details of shipping method "Free Shipping" is stored under array element $rates['free_shipping']. Now it is stored as $rates['free_shipping:shipping_zone_instance_id'] where shipping_zone_instance_id is the [...]