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 | |
extract( $field ); | |
<p class="form-field form-field-wide <?php echo implode( ' ', $class ); ?>"> | |
<label for="<?php echo $name; ?>"><?php echo $label; ?>:</label> | |
<select name="<?php echo $name; ?>" id="<?php echo $name; ?>"> | |
<?php foreach ( $options as $key => $value ) : ?> | |
<?php | |
/* | |
The default file just echos out the value | |
this will modify that behaviour to match a pattern and replace that pattern with an empty string |
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_after_my_account', 'handsomebeardedguy_after_my_account' ); | |
add_action( 'woocommerce_subscription_details_after_subscription_table', 'handsomebeardedguy_after_my_account' ); | |
function handsomebeardedguy_after_my_account() { | |
echo '<script> | |
jQuery(document).ready(function($) { | |
$("td.subscription-actions a.cancel, table.shop_table.subscription_details a.cancel").on("click", function(e) { | |
var confirmCancel = confirm("Are you sure you want to cancel this subscription? This action is not reversible") | |
if (!confirmCancel) { | |
e.preventDefault() |
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 | |
/** | |
* My Subscriptions | |
*/ | |
?> | |
<div class="woocommerce_account_subscriptions"> | |
<h2><?php _e( 'My Subscriptions', 'woocommerce-subscriptions' ); ?></h2> | |
<?php if ( ! empty( $subscriptions ) ) : ?> |
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_filter( 'wc_customer_order_csv_export_customer_headers', 'wooninja_customer_headers' ); | |
function wooninja_customer_headers( $column_headers ) { | |
$column_headers['user_role'] = 'user_role'; | |
return $column_headers; | |
} | |
add_filter( 'wc_customer_order_csv_export_customer_row', 'wooninja_customer_role', 10, 2 ); | |
function wooninja_customer_role( $customer_data, $user ) { |
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_filter( 'woocommerce_shortcode_products_query', 'wooninja_only_sale_items', 10, 2 ); | |
function wooninja_only_sale_items( $args, $atts ) { | |
if ( $atts['category'] ) { | |
$product_ids_on_sale = wc_get_product_ids_on_sale(); | |
$args['post__in'] = array_merge( array( 0 ), $product_ids_on_sale ); | |
} | |
return $args; | |
} |
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_filter( 'woocommerce_product_add_to_cart_text', 'wooninja_read_more_text', 10, 2 ); | |
function wooninja_read_more_text( $text, $product ) { | |
if ( 'booking' == $product->product_type ) { | |
$text = 'Book Now'; | |
} | |
return $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
add_filter( 'woocommerce_shipping_calculator_enable_postcode', '__return_false' ); |
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_filter( 'woocommerce_ship_to_different_address_checked', '__return_zero' ); |
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_filter( 'woocommerce_currencies', 'wooninja_add_currencies' ); | |
function wooninja_add_currencies( $currencies ) { | |
$currencies['MNT'] = 'Mongolian Tughrik'; | |
return $currencies; | |
} | |
add_filter( 'woocommerce_currency_symbol', 'wooninja_currency_symbol', 10, 2 ); | |
function wooninja_currency_symbol( $currency_symbol, $currency ) { |
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_filter( 'woocommerce_product_description_heading', 'wooninja_product_description_heading', 10, 0 ); | |
function wooninja_product_description_heading() { | |
return 'Project Description'; | |
} |