Okay
  Public Ticket #3234246
Sal Price on Dynamic Pricing
Closed

Comments

  •  1
    dan wakeham started the conversation

    Hello,

    I have added a dynamic rule to add a 10% price increase to a user group. However, when I view the shop (see screenshot), there is a sale icon and strikethrough on the original price even though the new price is higher.

    How do I switch off this functionality in the case of a price increase?

    Thanks


    Attached files:  Screenshot 2023-02-17 at 09.23.21.png
      Screenshot 2023-02-17 at 09.21.09.png

  •  2,218
    WebWizards replied

    Hello Dan,

    Thank you for purchasing our plugin,


    That is not supposed to be happening. It seems to be some kind of error or conflict. I tested this now with the latest plugin versions but I cannot see this issue locally on our test site.

    I believe it has something to do with your specific setup. It may be a plugin conflict, perhaps with another plugin that is affecting price display on your site.


    Some suggestions:

    A) Try to add this PHP code snippet to your site:

    add_filter('b2bking_dynamic_recalculate_sale_price_display', 'b2bking_raise_price_html', 1000, 3);
    function b2bking_raise_price_html($price_html, $product, $sale_price){
        
        if (wc_get_price_to_display(  $product, array( 'price' => $product->get_sale_price() ) )  > wc_get_price_to_display( $product, array( 'price' => $product->get_regular_price() ) )){
            $price_html = wc_price($sale_price) . $product->get_price_suffix();
        }
        return $price_html;
    }
    

    Depending on what it causing it, it may help to solve it,

    B) I would suggest trying to deactivate all other site plugins to see if that can solve it or help you identify where the problem is coming from.


    If you would like, we can also look into this directly for you. For that, we would need a backend login to the site or to a staging clone site, so we can run some tests and get this solved for you as soon as possible,

    Kind regards,

    Stefan

  •   dan wakeham replied privately
  •   dan wakeham replied privately
  •  2,218
    WebWizards replied

    Thank you, that was very helpful,

    There was indeed an issue in our plugin with how this was handled for variable products with the same price for all variations,

    I have made a plugin update and installed in on your site - I believe this resolved the issue and I'm no longer seeing that.

    1611724897.png


    Please let me know if you see any further problems,

  •  1
    dan wakeham replied

    Hello and thanks for looking into this. I just logged in and can see that the sale banner still remains? Please may you look at it again.

    Attached files:  Screenshot 2023-02-20 at 10.29.25.png

  •  2,218
    WebWizards replied

    Ah, I’m sorry, I was focused on the price calculation, and completely missed the “Sale” badges.

    I made another update and I believe it's resolved:

    2871274186.png


  •  1
    dan wakeham replied

    That is excellent, thank you. I have one other question, if you don't mind.

    I have the plugin set up on our euro and Gbp websites with the same configuration. However, there is a variation in how they behave.

    Some categories are restricted to certain user groups. If you click on the menu item that links to the restricted category, it says "No Products Found" on our Euro store the 404 page is loaded. Can I set a custom page to be loaded when a brand is not allowed?

  •  2,218
    WebWizards replied

    I believe this is related to the following setting:

    In B2BKing -> Settings -> Other -> you can find the setting "Product visibility cache"


    When this cache is enabled, it hides products and categories at a very deep level and it will be as if that category does not exist at all (404 error).


    So if you prefer the "No products found" message, you can disable this setting on your Euro site.


    This cache setting can have an impact on site performance (enabled is faster), but whether that's a significant difference or not depends on each site.

    I don't have a way to set a custom page when a category is hidden with the cache enabled unfortunately - the category is removed very early on, so the 404 error is inevitable, it's really as if the category does not exist.

  •  1
    dan wakeham replied

    Ok, that is fine. I have styled my 404 page as my brand is not allowed page.

    Thanks