Viewing 12 replies - 16 through 27 (of 27 total)
  • Thread Starter rafix

    (@rafix)

    Hi Claudio,

    Thanks for joining the forum post.

    Can you specify which code you want to see?

    With kind regards

    Plugin Contributor Claudio Sanches

    (@claudiosanches)

    However this filter already is in the code and doesn’t catch the suffix at the simple product.

    From that code ^

    Thread Starter rafix

    (@rafix)

    I Hope this is the code you meant earlier! If not please do tell!

    [ Moderator note: excessive amount of PHP redacted, please use pastebin.com instead and share the link to your paste. ]

    Thread Starter rafix

    (@rafix)

    New link posted due too much php

    https://pastebin.com/H1v9amre

    Plugin Contributor Claudio Sanches

    (@claudiosanches)

    @rafix not sure why you should me the entire WC_Product, show me your custom code where you are applying the filter.

    Thread Starter rafix

    (@rafix)

    Hi claudio,

    The filters get added into a different file, they are located in the child theme’s functions.php as you can see in earlier posts.

    I’ve tried adding the new filter into here as well, and into the wc product. However both did not seem to make the suffix appear at the simple products.

    /**
     * @snippet       Disable Variable Product Price Range
     * @how-to        Watch tutorial @ https://businessbloomer.com/?p=19055
     * @sourcecode    https://businessbloomer.com/disable-variable-product-price-range-woocommerce/
     * @author        Rodolfo Melogli
     * @compatible    WooCommerce 2.4.7
     */
    
    add_filter( 'woocommerce_variable_sale_price_html', 'bbloomer_variation_price_format', 10, 2 );
    
    add_filter( 'woocommerce_variable_price_html', 'bbloomer_variation_price_format', 10, 2 );
    
    function bbloomer_variation_price_format( $price, $product ) {
    
    // Main Price
    $prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
    $price = $prices[0] !== $prices[1] ? sprintf( __( 'vanaf %1$s <small class="woocommerce-price-suffix">excl. BTW</small>', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
    
    // Sale Price
    $prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) );
    sort( $prices );
    $saleprice = $prices[0] !== $prices[1] ? sprintf( __( 'vanaf %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
    
    if ( $price !== $saleprice ) {
    $price = '<del>' . $saleprice . '</del> <ins>' . $price . '</ins>';
    }
    return $price;
    }
    Plugin Contributor Claudio Sanches

    (@claudiosanches)

    Show me an example of how it should appear.

    Thread Starter rafix

    (@rafix)

    So all the prices that are above the (incl. BTW) are excluding VAT

    So what we want to make appear at the products that do not have the suffix yet is:

    {price ex}
    ({price inc} incl. BTW)

    I’ve also contacted woothemes and gave login details there, can you access these?

    Thread Starter rafix

    (@rafix)

    Any update on the suffix thread.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    I could, but given this is a customisation WooThemes shouldn’t cover this under the support policy..

    Try the woocommerce_get_price_html filter I suggested earlier. That one catches more price output functions.

    Thread Starter rafix

    (@rafix)

    Hi Mike,

    I’ve tried the woocommerce_get_price_html filter you’ve given me. However this still did not catch the suffix to appear.

    So you know how to get the last suffix to appear? What would the costs be for this and how long would this take?

    With kind regads

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    You’d need to contact a developer via jobs.wordpress.net or https://woocommerce.com/wooexperts/ ??

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘Price suffix at simple product’ is closed to new replies.