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
| /** | |
| * See Documentation on Date/Time formatting here: | |
| * https://codex.wordpress.org/Formatting_Date_and_Time | |
| */ | |
| add_filter( 'woocommerce_bookings_time_format', 'localize_bookings_time_format' ); | |
| function localize_bookings_time_format( $format ) { | |
| return get_option( 'time_format', $format ); | |
| } |
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_checkout_fields', 'filter_checkout_fields' ); | |
| function filter_checkout_fields( $fields ) { | |
| $fields['order']['order_comments']['maxlength'] = 200; | |
| 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_filter( 'woocommerce_prevent_admin_access', '__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( 'booking_form_fields', 'wooninja_booking_form_fields' ); | |
| function wooninja_booking_form_fields( $fields ) { | |
| $fields['wc_bookings_field_persons']['label'] = 'SOMETHING ELSE'; | |
| 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_filter( 'woocommerce_product_description_heading', 'wooninja_product_description_heading', 10, 0 ); | |
| function wooninja_product_description_heading() { | |
| return 'Project Description'; | |
| } |
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_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_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_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_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; | |
| } |