rafix
Forum Replies Created
-
Forum: Plugins
In reply to: Stock value parent with variationsIs there anyone who knows a solution to this?
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productHi 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
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productAny update on the suffix thread.
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productSo 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?
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productHi 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; }
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productNew link posted due too much php
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productI 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. ]
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productHi Claudio,
Thanks for joining the forum post.
Can you specify which code you want to see?
With kind regards
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productHi Mike,
Thank you for helping me out so much. However this filter already is in the code and doesn’t catch the suffix at the simple product.
Any more options we can try out, to get the suffix to appear?
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productHi Mike,
This did not seem to do anything, I added the snippet into the functions.php right above the other suffix. However.. No result. Is there anything else we could try? Maybe you could try this for us?
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productSo where do I need to place these then. Only in the functions file? can you be a bit more detailed? on which and where to edit these in so it will hopefully work ??
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productIt shows i can add two placeholders, however we want the text to be shown which is custom added. We cannot do this through the suffix part in woocommerce?
I’ve tried the custom route. I went into the functions.php, there I added the following:
// define the woocommerce_price_html callback function filter_woocommerce_price_html( $price, $instance ) { // make filter magic happen here... return $price; }; // add the filter add_filter( 'woocommerce_price_html', 'filter_woocommerce_price_html', 10, 2 );
Then I went to the /includes/abstracts/abstract-wc-product.php file and added under rule 957 the following line:
$price = apply_filters( 'woocommerce_price_html', $price, $this );
However this doesn’t seem to give any result in the website. what am I doing wrong?
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productThe code supports texts at the product like:
( 'vanaf %1$s <small class="woocommerce-price-suffix">excl. BTW</small>'
We’d like these to stay, I removed the code and seen what happend. But then it doesn’t show the custom lines we do want there. How would or should we change the code. To keep those there, and have the simple product show the suffix as well.
Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productWe have the option checked with:
({price_including_tax} incl. BTW)
Or are you recommending to remove previous code and place with this?
As I believe no suffix will be shown anymore then.Forum: Plugins
In reply to: [WooCommerce] Price suffix at simple productThis seems to work for the products that do have it.
/** * @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; }