Skip to content

Instantly share code, notes, and snippets.

View woocommerce_checkout_order_review.php
<?php
add_action('woocommerce_checkout_order_review', 'ts_checkout_order_review');
function ts_checkout_order_review() {
echo '<h2>woocommerce_checkout_order_review</h2>';
}
View woocommerce_checkout_before_order_review_heading.php
<?php
add_action('woocommerce_checkout_before_order_review_heading', 'ts_checkout_before_order_review_heading');
function ts_checkout_before_order_review_heading() {
echo '<h2>woocommerce_checkout_before_order_review_heading</h2>';
}
View woocommerce_after_checkout_registration_form.php
<?php
add_action('woocommerce_after_checkout_registration_form', 'ts_after_checkout_registration_form');
function ts_after_checkout_registration_form() {
echo '<h2>woocommerce_after_checkout_registration_form</h2>';
}
View woocommerce_checkout_shipping.php
<?php
add_action('woocommerce_checkout_shipping', 'ts_checkout_shipping');
function ts_checkout_shipping() {
echo '<h2>woocommerce_checkout_shipping</h2>';
}
View woocommerce_before_checkout_registration_form.php
<?php
add_action('woocommerce_before_checkout_registration_form', 'ts_checkout_billing');
function ts_checkout_billing() {
echo '<h2>woocommerce_before_checkout_registration_form</h2>';
}
View woocommerce_checkout_billing.php
<?php
add_action('woocommerce_checkout_billing', 'ts_checkout_billing');
function ts_checkout_billing() {
echo '<h2>woocommerce_checkout_billing</h2>';
}
View hide-coupon-for-categories.php
<?php
add_filter( 'woocommerce_coupons_enabled','ts_hide_coupon_field_on_cart' );
function ts_hide_coupon_field_on_cart( $enabled ) {
$product_categories = array('hd', 'led');
$cart = WC()->cart->get_cart();
foreach ( $cart as $id => $cart_item ) {
$_product = wc_get_product($cart_item[ 'data' ]->get_id() );
View hide-coupon-for-x-products.php
<?php
add_filter( 'woocommerce_coupons_enabled','ts_hide_coupon_field_on_cart' );
function ts_hide_coupon_field_on_cart( $enabled ) {
$product_ids = array(8, 55, 57);
$count = 0;
$cart = WC()->cart->get_cart();
foreach ( $cart as $id => $cart_item ) {
if( in_array( $cart_item[ 'data' ]->get_id(), $product_ids ) ) {
View hide-coupon-multiple-products.php
<?php
add_filter( 'woocommerce_coupons_enabled','ts_hide_coupon_field_on_cart' );
function ts_hide_coupon_field_on_cart( $enabled ) {
$product_ids = array(8, 55, 57);
$cart = WC()->cart->get_cart();
foreach ( $cart as $id => $cart_item ) {
if( in_array( $cart_item[ 'data' ]->get_id(), $product_ids ) ) {
return false;
View hide-coupon-for-one-product.php
<?php
add_filter( 'woocommerce_coupons_enabled','ts_hide_coupon_field_on_cart' );
function ts_hide_coupon_field_on_cart( $enabled ) {
$product_id = 55;
$cart = WC()->cart->get_cart();
foreach ( $cart as $id => $cart_item ) {
if( $cart_item[ 'data' ]->get_id() == $product_id ) {
return false;