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 | |
| /** | |
| * Display the value of a specific field as a price | |
| * Update the field_id to match your own field ID | |
| */ | |
| function demo_display_value_as_price( $value, $item ) { | |
| if( $item['field_id'] == '1047' && $item['type'] == 'number' ) { | |
| $value = wc_price( $value ); | |
| } | |
| return $value; |
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 | |
| /** | |
| * Set maximum number of bookable items | |
| */ | |
| function demo_max_bookings_per_product( $max, $product_id ) { | |
| if( $product_id == 1234 ) { | |
| $max = 3; | |
| } | |
| return $max; | |
| } |
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 | |
| add_filter( 'pewc_enable_summary_panel', '__return_true' ); |
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 | |
| /** | |
| * Include grouped products in Products Categories child products | |
| */ | |
| function demo_get_products_for_cats_args( $args ) { | |
| $args['type'] = array( 'simple', 'variable', 'grouped' ); | |
| return $args; | |
| } | |
| add_filter( 'pewc_get_products_for_cats_args', 'demo_get_products_for_cats_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
| <?php | |
| /** | |
| * Fix for conflict with Divi Plus | |
| */ | |
| remove_filter( 'woocommerce_product_is_on_sale', 'wcfad_product_is_on_sale', 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
| <?php | |
| /** | |
| * Hook: woocommerce_product_upsells_products_heading. | |
| * Modify the text in the upsells section title. | |
| */ | |
| function plugin_republic_product_upsells_products_heading( $text ) { | |
| // Modify the $text here | |
| return $text; | |
| } | |
| add_filter( 'woocommerce_product_upsells_products_heading', 'plugin_republic_product_upsells_products_heading', 10, 1 ); |
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 | |
| /** | |
| * Hook: woocommerce_product_single_add_to_cart_text. | |
| * Modify the text displayed on the 'Add to cart' button. | |
| */ | |
| function plugin_republic_product_single_add_to_cart_text( $text, $product ) { | |
| // Modify the $text here | |
| return $text; | |
| } | |
| add_filter( 'woocommerce_product_single_add_to_cart_text', 'plugin_republic_product_single_add_to_cart_text', 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
| <?php | |
| /** | |
| * Hook: woocommerce_get_stock_html. | |
| * Modify the HTML for the stock notice on the product page. | |
| */ | |
| function plugin_republic_get_stock_html( $html, $product ) { | |
| // Modify the $html here | |
| return $html; | |
| } | |
| add_filter( 'woocommerce_get_stock_html', 'plugin_republic_get_stock_html', 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
| <?php | |
| /** | |
| * Hook: woocommerce_reset_variations_link. | |
| * Modify the HTML for the 'Clear' options link. | |
| */ | |
| function plugin_republic_reset_variations_link( $html ) { | |
| // Modify the $html here | |
| return $html; | |
| } | |
| add_filter( 'woocommerce_reset_variations_link', 'plugin_republic_reset_variations_link', 10, 1 ); |