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 | |
/** | |
* Change the “No products in the cart” message when hovering over the mini-cart | |
* | |
*/ | |
function lar_text_strings( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case ‘No products in the cart.’ : |
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_filter( 'woocommerce_get_availability_text', 'lar_custom_change_availability_text', 15, 2 ); | |
function lar_custom_change_availability_text( $availability, $product ) { | |
if ( $product->backorders_require_notification() ) { | |
$availability = __( 'Custom text here', 'woocommerce' ); | |
} | |
return $availability; | |
} |
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 | |
function custom_order_booking_fields ( $fields ) { | |
$fields = array('wc_bookings_field_resource' => $fields['wc_bookings_field_resource']) + $fields; | |
return $fields; | |
} | |
add_filter( 'booking_form_fields', 'custom_order_booking_fields'); |
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 | |
add_filter( 'wc_stripe_hide_payment_request_on_product_page', 'lar_wc_stripe_hide_payment_request_on_product_page' ); | |
function lar_wc_stripe_hide_payment_request_on_product_page() { | |
return true; | |
} |
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 | |
// 'Continue Shopping' button re-direct | |
add_filter('woocommerce_continue_shopping_redirect', 'lar_wc_continue_shopping_redirect'); | |
function lar_wc_continue_shopping_redirect( $redirect ) { | |
$redirect = 'http://yoururl.com/'; | |
return $redirect; | |
} |
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
// Remove icons from Stripe gateway | |
function lar_remove_icons( $icons ) { | |
$icons = str_replace( '<img src="' . WC_HTTPS::force_https_url(WP_PLUGIN_URL . '/woocommerce-gateway-stripe/assets/images/jcb.svg' ) . '" class="stripe-jcb-icon stripe-icon" alt="JCB" />', '', $icons ); | |
$icons = str_replace( '<img src="' . WC_HTTPS::force_https_url(WP_PLUGIN_URL . '/woocommerce-gateway-stripe/assets/images/discover.svg' ) . '" class="stripe-discover-icon stripe-icon" alt="Discover" />', '', $icons ); | |
$icons = str_replace( '<img src="' . WC_HTTPS::force_https_url(WP_PLUGIN_URL . '/woocommerce-gateway-stripe/assets/images/diners.svg' ) . '" class="stripe-diners-icon stripe-icon" alt="Diners" />', '', $icons ); | |
return $icons; | |
} | |
add_filter( 'woocommerce_gateway_icon', 'lar_remove_icons'); |
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 to remove the variable subscription price string | |
* Add this to your child theme's functions.php file. | |
*/ | |
function wc_remove_var_subscriptions_price() { | |
return ''; | |
} | |
add_filter( 'woocommerce_variable_subscription_price_html', 'wc_remove_var_subscriptions_price' ); | |
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_action( 'template_redirect', 'wc_custom_redirect_after_purchase' ); | |
function wc_custom_redirect_after_purchase() { | |
global $wp; | |
if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { | |
wp_redirect( 'http://www.yoururl.com/your-page/' ); | |
exit; | |
} | |
} |
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_filter( 'wc_stripe_payment_icons', 'change_my_icons' ); | |
function change_my_icons( $icons ) { | |
// var_dump( $icons ); to show all possible icons to change. | |
$icons['visa'] = '<img src="http://woocommerce-ext.reh/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/visa.svg" />'; | |
$icons['mastercard'] = '<img src="http://woocommerce-ext.reh/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/mastercard.svg" />'; | |
$icons['amex'] = '<img src="http://woocommerce-ext.reh/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/amex.svg" />'; | |
return $icons; | |
} |
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_filter( 'wc_stripe_payment_icons', 'change_my_icons' ); | |
function change_my_icons( $icons ) { | |
// var_dump( $icons ); to show all possible icons to change. | |
$icons['visa'] = '<img src="https://mysite.com/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/visa.svg" />'; | |
return $icons; | |
} |
NewerOlder