Skip to content

Instantly share code, notes, and snippets.

View DustinHartzler's full-sized avatar

Dustin Hartzler DustinHartzler

View GitHub Profile
<?php // only copy this line if needed
function sv_wc_pip_after_customer_addresses_add_custom_field( $type, $action, $document, $order ) {
echo $order->billing_wcj_checkout_field_1;
}
add_action( 'wc_pip_after_customer_addresses', 'sv_wc_pip_after_customer_addresses_add_custom_field', 10, 4 );
function sv_wc_pip_after_customer_addresses_add_custom_field( $type, $action, $document, $order ) {
echo get_post_meta( $order->id, 'billing_wcj_checkout_field_1', true );
}
add_action( 'wc_pip_after_customer_addresses', 'sv_wc_pip_after_customer_addresses_add_custom_field', 10, 4 );
add_filter( 'woocommerce_cart_item_price', 'wc_cp_empty_composited_item_cart_order_price', 100, 2 );
add_filter( 'woocommerce_cart_item_subtotal', 'wc_cp_empty_composited_item_cart_order_price', 100, 2 );
add_filter( 'woocommerce_checkout_item_subtotal', 'wc_cp_empty_composited_item_cart_order_price', 100, 2 );
add_filter( 'woocommerce_order_formatted_line_subtotal', 'wc_cp_empty_composited_item_cart_order_price', 100, 2 );
add_filter( 'woocommerce_composited_product_price_string', 'wc_cp_composited_product_empty_price_string', 100, 4 );
add_filter( 'woocommerce_composited_item_price_html', 'wc_cp_woocommerce_composited_item_empty_price_html', 100, 4 );
function wc_cp_woocommerce_composited_item_empty_price_html( $price_html, $product, $component_id, $composite_id ) {
$price_html = '';
<?php
/**
* Single Product Thumbnails
*
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-thumbnails.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
* will need to copy the new files to your theme to maintain compatibility. We try to do this.
* as little as possible, but it does happen. When this occurs the version of the template file will.
* be bumped and the readme will list any important changes.
<?php
/**
* Single Product Image
*
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-image.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
* will need to copy the new files to your theme to maintain compatibility. We try to do this.
* as little as possible, but it does happen. When this occurs the version of the template file will.
* be bumped and the readme will list any important changes.
.woocommerce .col2-set, .woocommerce-page .col2-set {
display: block !important;
}
add_filter( 'woocommerce_variation_is_visible', 'disable_specific_variation', 10, 4 );
function disable_specific_variation( $visible, $variation_id, $product_id, $variation ) {
if ( 23 == $variation_id ){
$visible = false;
}
return $visible;
}
<?php echo ( ! $mnm_product->variation_id && $mnm_product->is_visible() ) || ( $mnm_product->variation_id && $mnm_product->variation_is_visible() ) ? '<a href="' . $mnm_product->get_permalink() . '" target="_blank">' . $mnm_product->get_title() . '</a>' : $mnm_product->get_title(); ?>
@media only screen and (max-width: 768px){
div#simple-social-icons-3 {
padding-top: 22px;
}
}
add_filter( 'woocommerce_countries_base_postcode', create_function( '', 'return "10010";' ) );
add_filter( 'woocommerce_countries_base_city', create_function( '', 'return "NEW YORK";' ) );