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
| /** | |
| * By default, WooCommerce will capitalize order item meta labels | |
| * in some cases this may be undesirable, use this snippet to | |
| * un-do the capitalization | |
| * @see wc function wc_attribute_label in includes/wc-attribute-functions.php | |
| */ | |
| add_filter( 'woocommerce_attribute_label', 'wooninja_attribute_label', 10, 2 ); | |
| function wooninja_attribute_label( $formatted_label, $original_label ) { | |
| return $original_label; |
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_get_price_html', 'wooninja_free_price_replace', 99, 2 ); | |
| function wooninja_free_price_replace( $price_html, $product ) { | |
| if ( 'booking' == $product->product_type ) { | |
| $price_html = str_replace( 'Free', 'MY REPLACEMENT', $price_html ); | |
| } | |
| return $price_html; | |
| } |
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_free_price_html', 'wooninja_modify_free_price' ); | |
| function wooninja_modify_free_price( $price ) { | |
| //modify MY FREE PRICE to fit your needs :) | |
| return 'MY FREE PRICE'; | |
| } |
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
| /** | |
| * I have a WooCommerce Subscription product set up to bill every 2nd month | |
| * The product is also set up to synchronize payments to the 25th of each month | |
| * and the products are shipped on the 1st of every 2nd month - the shipping | |
| * schedule is fixed, i.e. shipments only go out on even numbered months | |
| * | |
| * How can I prevent my customers from being billed 5 weeks before their first box | |
| * actually goes out? | |
| */ | |
| add_filter( 'woocommerce_subscriptions_synced_first_payment_date', 'wooninja_filter_first_payment_date', 10, 2 ); |
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( 'booking_form_fields', 'handsomebeardedguy_booking_form_fields' ); | |
| function handsomebeardedguy_booking_form_fields( $fields ) { | |
| if ( isset( $fields['wc_bookings_field_resource'] ) ) { | |
| $fields['wc_bookings_field_resource']['options'][0] = 'Make a selection...'; | |
| ksort( $fields['wc_bookings_field_resource']['options'] ); | |
| } | |
| return $fields; | |
| } |
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_shop_loop_item', 'beardedguy_add_quantity_input' ); | |
| function beardedguy_add_quantity_input() { | |
| global $product; | |
| $product_type = ( version_compare( WC_VERSION, '3.0', '<' ) ) ? $product->product_type : $product->get_type(); | |
| if ( 'simple' == $product_type ) { | |
| remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); | |
| add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_single_add_to_cart', 10 ); | |
| } else { | |
| remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_single_add_to_cart', 10 ); |
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 | |
| /** | |
| * The template for displaying product content within loops. | |
| * | |
| * Override this template by copying it to yourtheme/woocommerce/content-product.php | |
| * Adapted from work originally authored by WooThemes | |
| * @license [<http://fsf.org/>] [GPL 3] | |
| * @version 1.6.4 | |
| */ |
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
| li.product-type-variable td { | |
| float: left; | |
| } | |
| #main li.product input { | |
| float: none; | |
| } |
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_get_price', 'wooninja_price_increase' ); | |
| function wooninja_price_increase( $price ) { | |
| return $price + ( $price * .2 ); | |
| } |
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_change_payment_button_text', 'wooninja_change_payment_button_text' ); | |
| function wooninja_change_payment_button_text() { | |
| return 'MY BUTTON TEXT'; | |
| } | |
| add_filter( 'woocommerce_my_account_my_subscriptions_actions', 'wooninja_filter_subscriptions_actions', 99 ); | |
| function wooninja_filter_subscriptions_actions( $actions ) { | |
| foreach ( $actions as $key => $value ) { |