Skip to content

Instantly share code, notes, and snippets.

xadapter

Block or report user

Report or block xadapter

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@xadapter
xadapter / functions.php
Created Aug 29, 2018
Support for YITH Product Bundle with Product Import Export for WooCommerce by Xadapter
View functions.php
add_filter('woocommerce_csv_product_post_columns','woocommerce_csv_product_post_columns',1);
function woocommerce_csv_product_post_columns($default_post_columns=array()){
$default_post_columns['_yith_wcpb_bundle_data'] = 'meta:_yith_wcpb_bundle_data';
return $default_post_columns;
}
add_filter('hf_woocommerce_csv_product_import_allowed_product_types', 'hf_woocommerce_csv_product_import_allowed_product_types', 1);
@xadapter
xadapter / functions.php
Created Aug 27, 2018
Snippet to change UPS account details in rate request when Access Point address has been selected. WooCommerce UPS Shipping Plugin with Print Label - https://www.xadapter.com/product/woocommerce-ups-shipping-plugin-with-print-label/
View functions.php
/**
* Snippet to change UPS account details in rate request when Access Point address has been selected.
* Created at : 27 Aug 2018
* Updated at : 27 Aug 2018
* Xadapter Plugins : https://www.xadapter.com/shop/
* Gist Link : https://gist.github.com/xadapter/8891ba54b0cd2a642813e83e1d7e9810
*/
if( ! function_exists('ph_change_ups_account_for_accesspoint_rate_request') ) {
function ph_change_ups_account_for_accesspoint_rate_request( $xml_request, $package ){
@xadapter
xadapter / function.php
Last active Aug 24, 2018
Snippet to change Estimated Delivery date style on cart page. Estimated Delivery Date Plugin for WooCommerce - https://www.xadapter.com/product/estimated-delivery-date-plugin-woocommerce/
View function.php
/**
* Snippet to change Estimated Delivery date style on cart page.
* Created at : 24 Aug 2018
* Updated at : 24 Aug 2018
* Xadapter Plugins : https://www.xadapter.com/shop/
* Gist Link : https://gist.github.com/xadapter/23dc533d6e166b76fa25d0c8d4fd0f5b
*/
add_filter( 'xa_estimated_delivery_cart_checkout_page_html_formatted_date', function($date) {
$date = str_replace( '<td', '<td style="font-weight: bold;"', $date);
@xadapter
xadapter / functions.php
Created Aug 22, 2018
Snippet to change UPS credentials in UPS Accesspoint Locator Request. WooCommerce UPS Shipping Plugin with Print Label - https://www.xadapter.com/product/woocommerce-ups-shipping-plugin-with-print-label/
View functions.php
/**
* Snippet to change UPS credentials in UPS Accesspoint Locator Request. Requires UPS plugin version - 3.10.2.
* Created at : 22 Aug 2018
* Updated at : 22 Aug 2018
* Xadapter Plugins : https://www.xadapter.com/shop/
* Gist Link : https://gist.github.com/xadapter/cb7a9a83b11d953077c57e4bcc8fa072
*/
if( ! function_exists('ph_change_ups_accesspoint_credentials') ){
function ph_change_ups_accesspoint_credentials( $xml_request, $ups_settings ) {
@xadapter
xadapter / functions.php
Created Aug 17, 2018
Import / Export bundle products using XAdapter Product Import Export for WooCommerce plugin - - with SKU
View functions.php
add_filter('hf_insert_post_extra_data', 'hf_import_alter_product_csv_row_data', 100, 3);
add_action('hf_alter_product_export_csv_columns', 'hf_alter_product_csv_columns_head', 100);
add_action('hf_alter_product_export_csv_data', 'hf_alter_product_csv_row_data', 100, 2);
/**
Product bundle export/import code snippet - with SKU
@global type $wpdb
@param type $additional_columns
@return array
@xadapter
xadapter / functions.php
Created Aug 10, 2018
Snippet to change weight in Woocommerce Canada Post Rate Request. WooCommerce Canada Post Shipping Plugin with Print Label - https://www.xadapter.com/product/woocommerce-canada-post-shipping-plugin-with-print-label/
View functions.php
/**
* Snippet to change weight in Woocommerce Canada Post Rate Request.
* Created at : 10 Aug 2018
* Updated at : 10 Aug 2018
* Xadapter Plugins : https://www.xadapter.com/shop/
* Gist Link : https://gist.github.com/xadapter/f6c84df50af11b5f952e170379933f7f
*/
add_filter( 'xa_canadapost_rate_request', function( $request ){
$default_weight = 15; // In kg
View functions.php
/**
* Snippet to hide duplicate shipping rates (Name and Cost both should match).
* Created at : 09 Aug 2018
* Updated at : 09 Aug 2018
* Xadapter Plugins : https://www.xadapter.com/shop/
* Gist Link : https://gist.github.com/xadapter/71473722eb88105bf70d6d5d0932aed1
*/
add_filter( 'woocommerce_package_rates', function( $shipping_rates ){
$hide_duplicate_rules = array('wf_multi_carrier_shipping'); // Hide Duplicate Rates for these shipping methods
View functions.php
/**
* Snippet to add handling charge to WooCommerce Shipping Methods based on Shipping Class.
* Created at : 06 Aug 2018
* Updated at : 06 Aug 2018
* Xadapter Plugins : https://www.xadapter.com/shop/
* Gist Link : https://gist.github.com/xadapter/288aff384db2a04fb3b96ec53239dbc0
*/
add_filter( 'woocommerce_package_rates', 'ph_add_extra_cost_based_on_shipping_class', 10, 2);
if( ! function_exists('ph_add_extra_cost_based_on_shipping_class') ) {
@xadapter
xadapter / functions.php
Last active Aug 3, 2018
Snippet to hide multicarrier shipping fallback rates if any other multicarrier rates are being shown. This will work when fallback rate is based on per unit quantity. Multi-Carrier Shipping Plugin for WooCommerce - https://www.xadapter.com/product/multiple-carrier-shipping-plugin-woocommerce/
View functions.php
/**
* Snippet to hide multicarrier shipping fallback rates if any other multicarrier rates are being shown. This will work when fallback rate is based on per unit quantity.
* Created at : 03 Aug 2018
* Updated at : 03 Aug 2018
* Xadapter Plugins : https://www.xadapter.com/shop/
* Gist Link : https://gist.github.com/xadapter/ba600aa9fbf72b5409cf64493070c45b
*/
add_filter( 'woocommerce_package_rates', 'ph_hide_mc_fallback_rates', 10, 2 );
if( ! function_exists('ph_hide_mc_fallback_rates') ) {
@xadapter
xadapter / style.css
Created Aug 3, 2018
Snippet to override the calendar CSS of woocommerce-booking-and-appointments plugin https://www.pluginhive.com/product/woocommerce-booking-and-appointments/
View style.css
//Change the color of text "pick Please a booking period" here.
.callender-msg{
color:white;
}
//Change the color of the calendar here.
.ph-calendar-month{
background:red;
}
You can’t perform that action at this time.