View gist:0add508ce8c8d9debf23
This file contains 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
function wc_remove_recurrence_label() { | |
remove_filter( 'woocommerce_cart_shipping_method_full_label', 'WC_Subscriptions_Cart::get_cart_shipping_method_full_label', 11, 2 ); | |
} | |
add_action( 'init', 'wc_remove_recurrence_label' ); |
View disable-paypal-woocommerce
This file contains 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
/* | |
* Disable PayPal payment method in the checkout if certain | |
* products are present in the cart. | |
* | |
* Add this to your theme's functions.php file | |
*/ | |
add_filter( 'woocommerce_available_payment_gateways', 'filter_gateways', 1); | |
function filter_gateways( $gateways ){ | |
global $woocommerce; |
View gist:a10148daa110119b262f
This file contains 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
/* Change the "Proceed to PayPal" button text in the WooCommerce checkout screen | |
* Add this to your theme's functions.php file | |
*/ | |
add_filter( 'gettext', 'custom_paypal_button_text', 20, 3 ); | |
function custom_paypal_button_text( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Proceed to PayPal' : | |
$translated_text = __( 'NEW BUTTON TEXT', 'woocommerce' ); | |
break; | |
} |
View gist:9c7087e170f9cf327f26
This file contains 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
/* Change the 'Only # left in stock' message on the WooCommerce product page to | |
* simply show 'Low Stock'. | |
* Add to your theme's functions.php file | |
*/ | |
function custom_stock_totals($availability_html, $availability_text, $product) { | |
if (substr($availability_text,0, 4)=="Only") { | |
$availability_text = "Low Stock"; | |
} | |
$availability_html = '<p class="stock ' . esc_attr( $availability['class'] ) . '">' . esc_html( $availability_text ) . '</p>'; | |
return $availability_html; |
View gist:dd0662dccd8068035757
This file contains 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 if ( is_woocommerce_activated() ) { ?> | |
<ul class="mini-cart"> | |
<li> | |
<a href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>" class="cart-parent"> | |
<span> | |
<?php | |
echo $woocommerce->cart->get_cart_total();; | |
echo sprintf(_n('<mark>%d</mark>', '<mark>%d</mark>', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count); | |
?> | |
</span> |
View woocommerce-bookings-styles.css
This file contains 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
/* | |
Modify the color styles of the WooCommerce Bookings datepicker calendar. | |
Add any/all of these styles to your theme's custom CSS, but be sure to change | |
the color hex codes to your choice. They're all black here. | |
*/ | |
/* Month header background color */ | |
#wc-bookings-booking-form .wc-bookings-date-picker .ui-datepicker-header { | |
background-color: #000000; | |
} |
View gist:c70dc98a099a9bf1c2f0
This file contains 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
/** | |
* A function to reorder the default display of fields on the WooCommerce Bookings form | |
* Put this function in your theme's functions.php file | |
*/ | |
function custom_order_booking_fields ( $fields ) { | |
$reorder = array(); | |
$reorder[] = $fields['wc_bookings_field_duration']; // Duration | |
$reorder[] = $fields['wc_bookings_field_resource']; // Resource | |
$reorder[] = $fields['wc_bookings_field_persons']; // Persons |
View gist:00f623326db4daa50394
This file contains 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
/** | |
* Redirect the Continue Shopping URL from the default (most recent product) to | |
* a custom URL. | |
* Place this code snippet in your theme's functions.php file. | |
*/ | |
function custom_continue_shopping_redirect_url ( $url ) { | |
$url = "http://www.woothemes.com"; // Add your link here | |
return $url; | |
} | |
add_filter('woocommerce_continue_shopping_redirect', 'custom_continue_shopping_redirect_url'); |
View gist:469fb7b59e8d028a21e2
This file contains 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
/** | |
* This stops the renew button from appearing in the My Account page once an order's been cancelled | |
* @param array $actions List of actions that subscriptions can do with each subscription (on top of | |
* WooCommerce) | |
* @param array $subscriptions List of subscriptions' data belonging to the current user | |
* @return array List of action buttons that can happen with each subscription | |
*/ | |
function remove_renew( $actions, $subscriptions ) { | |
foreach ( $actions as $key => $action ) { | |
if ( array_key_exists( 'renew', $action ) ) { |
View gist:7fdb43fce328049de1b9
This file contains 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 this function to your theme's functions.php file | |
* to replace the "Persons" string in the Bookings form | |
* to be "Number of Loaves". | |
*/ | |
function my_text_strings( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Persons' : | |
$translated_text = __( 'Number of Loaves', 'woocommerce-bookings' ); | |
break; | |
} |
OlderNewer