Skip to content

Instantly share code, notes, and snippets.

View christingom's full-sized avatar

Chris Tingom christingom

View GitHub Profile
@Antonio-Laguna
Antonio-Laguna / functions.php
Last active April 13, 2023 07:53 — forked from kloon/functions.php
WooCommerce Dropdown Product Quantity, fully compatible with Min/Max quantities extension and working quantity
<?php
// Place the following code in your theme's functions.php file
// override the quantity input with a dropdown
// Note that you still have to invoke this function like this:
/*
$product_quantity = woocommerce_quantity_input( array(
'input_name' => "cart[{$cart_item_key}][qty]",
'input_value' => $cart_item['quantity'],
'max_value' => $_product->backorders_allowed() ? '' : $_product->get_stock_quantity(),
'min_value' => '0'
@maxrice
maxrice / wc-hide-coupons-cart-checkout.php
Created January 21, 2014 23:43
WooCommerce - hide the coupon form on the cart or checkout page, but leave coupons enabled for use with plugins like Smart Coupons and URL Coupons
<?php
// hide coupon field on cart page
function hide_coupon_field_on_cart( $enabled ) {
if ( is_cart() ) {
$enabled = false;
}
return $enabled;