Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* visit us - https://wpgenie.org */
- /*
- Simple Bulk Discount - remove action example
- this is code snippet should be used in your child theme functions.php or in your customization plugin
- */
- function your_custom_bulk_discount_text(){
- global $post;
- $wcsbd_discount_text = get_post_meta( $post->ID, '_wcsbd_discount_text' , true );
- if( !empty( $wcsbd_discount_text ) ){
- echo '<div class="your_custom_bulk_discount_text">';
- echo apply_filters( 'the_content', $wcsbd_discount_text, $post->ID );
- echo '</div>';
- }
- }
- add_action( 'template_redirect', 'template_redirect_action' );
- function template_redirect_action() {
- global $Wc_Sbd;
- remove_action( 'woocommerce_single_product_summary', array( $Wc_Sbd->plugin_public , 'bulk_discount_text' ), 45 );
- if ( is_product() ) {
- add_action('woocommerce_single_product_summary', 'your_custom_bulk_discount_text', 44 );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement