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 | |
| /** | |
| * Dynamically set the aspect ratio for an upload field using Advanced Uploads | |
| */ | |
| function demo_ar_get_field_id() { | |
| // Update the field ID below to your select field ID | |
| return 1242; | |
| } | |
| function demo_ar_option_attribute_string( $option_attribute_string, $item, $option_value, $option_index ) { |
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 | |
| /** | |
| * Allow 0 value in 'Number' fields | |
| */ | |
| add_filter( 'pewc_allow_empty_field_values', '__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 | |
| /** | |
| * Remove thumbs from cart | |
| */ | |
| add_filter( 'pewc_show_link_only_cart', '__return_true' ); | |
| /** | |
| * Remove thumbs from order page | |
| */ | |
| add_filter( 'pewc_remove_thumbs_in_order_page', '__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
| <a href="https://pluginrepublic.com/woocommerce-hooks-actions-filters/"><img width="1672" alt="WooCommerce product page hooks" src="https://pluginrepublic.com/wp-content/uploads/2025/10/woocommerce-single-product-page-template-hooks.jpg"></a> |
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 | |
| /** | |
| * Hide all field prices in the cart and checkout | |
| */ | |
| add_filter( 'pewc_show_field_prices_in_cart', '__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
| <?php | |
| /** | |
| * Display grid for logged-in users / standard layout for guests | |
| */ | |
| function demo_enable_variations_grid( $enable, $product_id ) { | |
| if( is_user_logged_in() ) { | |
| return true; | |
| } else { | |
| 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
| <?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' ); |