• Hi,
    on my standard products I have an additional info below the price leading to the shipping cost page. The filter in the functions.php is

    add_filter( 'woocommerce_get_price_html', 'custom_versand_message' );
    function custom_versand_message( $versand ) {
    $zzgl = '<a style="display:block;font-size:14px;font-weight:400;text-align:left;" href="versand-und-zahlungsinformationen" target="_blank">zzgl. Versand</a>';
    return $versand . $zzgl;
    }
    

    This will now be hidden with the bundle price. Is there a similar filter I can use for the smart bundle?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WPClever

    (@wpclever)

    Hi @photospirit

    Please replace your snippet with the below:

    add_filter( 'woocommerce_get_price_html', 'custom_versand_message', 999 );
    function custom_versand_message( $versand ) {
    	$zzgl = '<a style="display:block;font-size:14px;font-weight:400;text-align:left;" href="versand-und-zahlungsinformationen" target="_blank">zzgl. Versand</a>';
    
    	return $versand . $zzgl;
    }
    Thread Starter photospirit

    (@photospirit)

    Hi,

    thanks for that, but has no effect.. still same behaviour.
    Anything else I need to consider?

    Thanks, Chris

    Plugin Author WPClever

    (@wpclever)

    Are you talking about the price on a single product page?

    If yes, please add below snippet:

    add_action( 'wp_footer', 'woosb_change_single_product_price', 99 );
    function woosb_change_single_product_price() {
    	?>
        <script type="text/javascript">
          (function($) {
            $(document).on('woosb_calc_price', function(e, total_sale, total, total_html, price_suffix, $wrap) {
              var wid = $wrap.attr('data-id');
              var $price = $('.woosb-price-' + wid);
    
              if (woosb_vars.change_price === 'yes_custom' && woosb_vars.price_selector != null &&
                  woosb_vars.price_selector !== '') {
                $price = $(woosb_vars.price_selector);
              }
    
              if ($price.length) {
                var txt = '<a style="display:block;font-size:14px;font-weight:400;text-align:left;" href="versand-und-zahlungsinformationen" target="_blank">zzgl. Versand</a>';
    
                $price.html(total_html + price_suffix + txt);
              }
            });
          })(jQuery);
        </script>
    	<?php
    }

    I tested and it works fine https://www.screencast.com/t/N02WGa5u7Ob

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add Info after Price’ is closed to new replies.