Skip to content

Instantly share code, notes, and snippets.

View varun-pluginhive's full-sized avatar

varun-pluginhive

View GitHub Profile
@varun-pluginhive
varun-pluginhive / functions.php
Created September 19, 2018 13:41
Snippet to start label generation if status changed to processing from Admin. WOOCOMMERCE UPS SHIPPING PLUGIN WITH PRINT LABEL - https://www.pluginhive.com/product/woocommerce-ups-shipping-plugin-with-print-label/
/**
* Snippet to start label generation if status changed to processing from Admin.
* Created at : 19 Sep 2018
* Updated at : 19 Sep 2018
* PluginHive Plugins : https://www.pluginhive.com/plugins/
* Gist Link : https://gist.github.com/varun-pluginhive/134e7cf7743da10b7fd3fe51121275eb
*/
if( ! function_exists('trigger_ups_label_generation') ) {
function trigger_label_generation_externally( $order_id ) {
@varun-pluginhive
varun-pluginhive / functions.php
Created September 17, 2018 14:08
Snippet to change Estimated delivery text based on stock quantity. ESTIMATED DELIVERY DATE PLUGIN FOR WOOCOMMERCE - https://www.pluginhive.com/product/estimated-delivery-date-plugin-woocommerce/
/**
* Snippet to change Estimated delivery text based on stock quantity.
* Created at : 17 Sep 2018
* Updated at : 17 Sep 2018
* PluginHive Plugins : https://www.pluginhive.com/plugins/
* Gist Link : https://gist.github.com/varun-pluginhive/1bdeb6c3b18a126cdae99ab92b451892
*/
if( ! function_exists('change_estimated_delivery_text_on_product_page') ) {
function change_estimated_delivery_text_on_product_page( $stock_arr, $item ) {
@varun-pluginhive
varun-pluginhive / functions.php
Created September 17, 2018 13:02
Snippet to add WooCommerce shipping Pro rates to UPS and USPS rates. WOOCOMMERCE TABLE RATE SHIPPING PRO PLUGIN - https://www.pluginhive.com/product/woocommerce-table-rate-shipping-pro-plugin/
/**
* Snippet to add WooCommerce shipping Pro rates to UPS and USPS rates.
* Created at : 17 Sep 2018
* Updated at : 17 Sep 2018
* PluginHive Plugins : https://www.pluginhive.com/plugins/
* Gist Link : https://gist.github.com/varun-pluginhive/9005d87294abf046243b3ef816185948
*/
if( ! function_exists('ph_add_shipping_pro_rate_to_up_or_usps_rates') ) {
function ph_add_shipping_pro_rate_to_up_or_usps_rates( $shipping_rates ) {
@varun-pluginhive
varun-pluginhive / functions.php
Created September 14, 2018 07:45
Snippet to map WooCommerce Shipping Method name to another name (Shipping Meta). PluginHive Plugins -https://www.pluginhive.com/
/**
* Snippet to map woocommerce shipping method name to another name.
* Created at : 14 Sep 2018
* Updated at : 14 Sep 2018
* PluginHive Plugins : https://www.pluginhive.com/plugins/
* Gist Link : https://gist.github.com/varun-pluginhive/14fd167b4fb127a6a4b8af2513fc4fae
*/
if( ! function_exists('ph_map_wc_shipping_method_name') ) {
function ph_map_wc_shipping_method_name( $shipping_rates ) {
$shipping_method_name_map_arr = array(
@varun-pluginhive
varun-pluginhive / functions.php
Last active September 14, 2018 06:40
Snippet to convert the dimension in FedEx plugin. WOOCOMMERCE FEDEX SHIPPING PLUGIN WITH PRINT LABEL - https://www.pluginhive.com/product/woocommerce-fedex-shipping-plugin-with-print-label/
/**
* Snippet to convert the dimension in FedEx plugin.
* Created at : 14 Sep 2018
* Updated at : 14 Sep 2018
* Xadapter Plugins : https://www.pluginhive.com/plugins/
* Gist Link : https://gist.github.com/varun-pluginhive/068bb9aa5b54e79973255b571d0ab629
*/
if( ! function_exists('ph_fedex_convert_dimension') ) {
function ph_fedex_convert_dimension( $converted_dimension, $dimension, $to_unit, $from_unit ) {
@varun-pluginhive
varun-pluginhive / functions.php
Last active September 12, 2018 16:47
Snippet to hide all ups rates apart from access point economy. If Access point has been selected. WOOCOMMERCE UPS SHIPPING PLUGIN WITH PRINT LABEL - https://www.pluginhive.com/product/woocommerce-ups-shipping-plugin-with-print-label/
/**
* Snippet to hide all ups rates apart from access point economy. If Access point has been selected.
* Created at : 12 Sep 2018
* Updated at : 12 Sep 2018
* PluginHive Plugins : https://www.pluginhive.com/
* Gist Link : https://gist.github.com/varun-pluginhive/0fff2c5a078192748aff1627756b862d
*/
if( ! function_exists('ph_hide_ups_rates_apart_from_access_point_economy') ) {
function ph_hide_ups_rates_apart_from_access_point_economy( $rates ) {
$access_point = WC()->session->get('ph_ups_selected_access_point_details');
@varun-pluginhive
varun-pluginhive / functions.php
Last active September 11, 2018 12:14
Snippet to change Access Point name on checkout field. WOOCOMMERCE UPS SHIPPING PLUGIN WITH PRINT LABEL - https://www.pluginhive.com/product/woocommerce-ups-shipping-plugin-with-print-label/
/**
* Snippet to change Access Point name on checkout field.
* Created at : 11 Sep 2018
* Updated at : 11 Sep 2018
* PluginHive Plugins : http://www.pluginhive.com/plugins/
* Gist Link : https://gist.github.com/varun-pluginhive/b048f5b225f0182211afdbc0c6d15362
*/
if( ! function_exists('ph_customize_access_point_name') ) {
function ph_customize_access_point_name( $fields ){