Okay
  Public Ticket #4492799
B2B price shows 0.00 when “Regular price” is empty (some products have regular price, some don’t)
Closed

Comments

  •  2
    Vladislav started the conversation

    Hi,

    Here’s our setup:

    • All products are visible to everyone (B2C), but only B2B users can purchase.

    • We set B2B prices via B2BKing Price Lists (by B2B groups).

    • Some products have a Regular price, some don’t (we don’t sell those in retail).

    • When logged in as B2B, on product/archive pages if the Regular price is empty, the price shows 0.00. However, after adding to cart, the price is correct from the price list.

    It seems dynamic pricing on product/archive pages doesn’t apply when the Regular price is empty, even though the cart uses the correct list price.

    Question: How can we ensure B2B users always see the B2BKing price list price on product and archive pages, even when the Regular price is empty—while B2C can continue to use the Regular price when it exists?

    We can provide any additional info (settings, etc.). Site: vascoshop.lt.

    Thanks,
    Vladislav

    Attached files:  da79f458-2f19-4af1-811e-07e5132d0f4a.jpg
      e3a78a20-5820-4bb3-9533-117d8a428b71.jpg

  •  2,535
    WebWizards replied

    Hi Vladislav,

    For B2B users, when there's a difference between the price shown on product/archive pages and the price in cart, this typically points to a caching issue or some kind of conflict.

    I noticed from your screenshots that you have the LiteSpeed plugin active.

    When using caching with dynamic pricing (where different users see different prices), it's important to either disable caching for logged-in users or ensure each user has their own unique cache. Otherwise, you can run into issues like users seeing incorrect prices.

    Here's more information on configuring caching properly with B2BKing: https://woocommerce-b2b-plugin.com/docs/users-see-wrong-content-b2c-users-see-b2b-content-or-prices/

    Please try checking if clearing Litespeed cache or deactivating the Litespeed plugin solves that. If so, it indicates that's the issue - the solution would be going in LiteSpeed settings and deactivating caching for logged in users.

    Kind regards,
    Stefan

  •  2
    Vladislav replied

    Following up on the pricing display issue. I tested your recommendation regarding LiteSpeed Cache:

    • Cleared the entire LiteSpeed cache.

    • Fully disabled the LiteSpeed Cache plugin.

    Unfortunately, the situation did not change – for B2B users, on product and archive pages (loop), the price still shows as 0.00 when the Regular price is empty. However, once the same product is added to the cart, the correct B2BKing Price List price is applied.

    Our setup in short:

    • WooCommerce + WoodMart theme.

    • B2BKing Pro; B2B prices are set via Price Lists by B2B groups.

    • All products are visible to B2C, but only B2B users can purchase.

    • Some products do not have a Regular price (since they are not offered for retail).

    It seems that on product/archive templates, the price is not replaced with the Price List value when Regular price is empty, even though the logic works correctly in the cart.

    My questions:

    1. Does B2BKing have a specific setting that would force Price List prices to be displayed for B2B users on product/archive pages whenever the Regular price is empty?

    2. If a programmatic solution is needed, could you please provide an official code snippet that:

      • Ensures B2B users always see their Price List price (single product + archive/loop), even if Regular price is empty;

      • Works with WoodMart (which uses overridden content-product.php templates);

      • Uses the correct WooCommerce hooks/filters (woocommerce_get_price_html, woocommerce_product_get_price, or others you recommend);

      • Calls the proper B2BKing function/method to retrieve the correct Price List price based on the logged-in user’s group.

    If needed, I can provide additional details (specific product IDs, groups) or staging site access. Our site is vascoshop.lt.

    Thank you in advance for your guidance on how to properly force Price List prices to display for B2B users on product and archive pages.

    Best regards,
    Vladislav

  •  2,535
    WebWizards replied

    Hi Vladislav,

    Thanks for confirming that disabling LiteSpeed didn't resolve the issue,

    B2BKing should automatically display Price List prices for B2B users on product/archive pages even when the Regular price is empty - this should work without any additional settings.

    I believe there is likely another plugin or theme conflict that's preventing B2BKing from properly displaying the prices on the frontend (while still working correctly in the cart).

    To properly identify what's causing this, it would be best if we can investigate directly on your site. Could you please share an admin access to the site or a staging clone site where we can troubleshoot this?

    Kind regards,
    Stefan

  •   Vladislav replied privately
  •  2,535
    WebWizards replied

    Hi Vladislav,

    Thanks for the access details,

    I believe I found the solution to the issue,

    The problem was that B2BKing isn't normally built for cases where products don't have a regular price at all. The dynamic discount rules were interpreting this situation incorrectly, leading to the 0.00 display on products with a dynamic rule discount but no regular price to calculate a discount from.

    I've added this code snippet to resolve it:

    add_action('wp', function(){
    	global $b2bking_public;
    	remove_filter('b2bking_dynamic_recalculate_sale_price_display', array($b2bking_public, 'b2bking_allow_negative_discounts'), 10, 3);
    });

    I added this to your "Vasco Customizations" plugin at the end of the file.

    From my testing, it appears to be working correctly now: https://prnt.sc/tIMoFxaQp

    Please let me know if you see any further issues,

    Kind regards,
    Stefan