This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_before_add_to_cart_quantity', 'display_quantity_minus' ); | |
function display_quantity_minus() { | |
echo '<div class="quantity-wrapper"><span>Qty</span><button type="button" class="minus" >-</button>'; | |
} | |
add_action( 'woocommerce_after_add_to_cart_quantity', 'display_quantity_plus' ); | |
function display_quantity_plus() { | |
echo '<button type="button" class="plus" >+</button></div>'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ARCHIVE | |
add_filter('woocommerce_product_add_to_cart_text', 'custom_archive_cart_button_text'); | |
function custom_archive_cart_button_text() { | |
return __('Purchase', 'woocommerce'); | |
} | |
// SINGLE PAGE | |
add_filter('woocommerce_product_single_add_to_cart_text', 'custom_single_cart_button_text'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// You can add this function to any hook listed here - https://www.businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/ | |
function product_attributes() { | |
global $product; | |
// GET SPECIFIC ATTRIBUTE | |
$attribute = $product->get_attribute( 'pa_attribute' ); | |
$specificAttribute = $product->get_attribute( 'pa_specific-attribute' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add this function to any hook listed here - https://www.businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/ | |
function product_variation_values() { | |
global $product; | |
if ( $product->is_type( 'variable' ) ) { | |
$variations = $product->get_available_variations(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_show_variation_price', function() {return true;}); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_variation_is_active', 'disable_out_of_stock_variations', 10, 2 ); | |
function disable_out_of_stock_variations( $active, $variation ) { | |
if( ! $variation->is_in_stock() ) { | |
return false; | |
} | |
return $active; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add this function to any hook listed here - https://www.businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/ | |
function delivery_countdown() { | |
date_default_timezone_set('Europe/London'); // Specify preferred time zone | |
$deadline = 12; // 0 = 12AM, 12 = 12PM, 23 = 11PM | |
$isWeekend = null; | |
$weekend = array('Saturday', 'Sunday'); | |
$weekdayDeadline = "Friday 12PM"; |