Home Forums WoodMart support forum Incorrect prices displayed in product grid for discounted user group

Incorrect prices displayed in product grid for discounted user group

Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #719581

    robert.temczuk
    Participant

    Incorrect prices displayed in product grid for discounted user group

    Hello XTEMOS Support Team,

    I’m experiencing an issue with incorrect price display in the WooCommerce product grid on my WoodMart-powered store.

    Issue Description

    When a user is logged in and belongs to a discounted/role-based pricing group, the product grid (shop page) displays the regular (non-discounted) prices instead of the correct role-based discounted prices.

    The correct discounted price appears only after:
    – Navigating to the individual product page, OR
    – Adding the product to the cart and visiting the cart page.

    Steps to Reproduce

    1. Create a user account assigned to a discounted user group (role-based pricing).
    2. Log in as that user.
    3. Navigate to the main shop page or any category page showing the product grid.
    4. Observe the prices displayed in the grid — they show regular prices, not the discounted ones.
    5. Click on any product to open the single product page — the discounted price is now displayed correctly.
    6. Add to cart and go to cart — the discounted price is also correct there.

    Expected Behavior

    The discounted price should be visible directly in the product grid, consistent with what is shown on the product page and in the cart.

    Actual Behavior

    The product grid shows the original (non-discounted) price for users in discounted groups. The grid appears to not update or re-render prices based on the logged-in user’s role.

    Environment
    – Theme: WoodMart (latest version installed)
    – Plugin: WooCommerce
    – Role-based pricing plugin: [https://woocommerce.com/products/b2b-for-woocommerce/ ]
    – WordPress version: [7.0]
    – WooCommerce version: [latest update]

    Additional Notes

    This issue seems to suggest that the product grid is either:
    – Caching prices without taking user roles into account, OR
    – Not fetching role-based prices when rendering the grid loop.

    Please advise whether this is a known WoodMart compatibility issue with role-based pricing plugins, or if there is a specific WoodMart setting (e.g. AJAX add-to-cart, fragment caching, or price caching) that may need to be adjusted.

    Thank you in advance for your assistance.

    Best regards,
    Robert

    Attachments:
    You must be logged in to view attached files.
    #719600

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Hello,

    To help diagnose this issue, could you please test with a default theme? This will help us determine if the problem is theme-related or caused by another factor.

    Steps:
    1. Temporarily switch to the default WordPress or Storefront theme (WooCommerce’s official theme)
    2. Test the functionality
    3. Let us know if the issue persists

    Important: Make a backup before switching themes, and don’t worry—your WoodMart settings will be preserved.

    Best regards

    #719719

    robert.temczuk
    Participant

    Hello,

    I did as you have indicated.
    The issue is not occuring with the standard theme – Hello Elementor,
    so we have clear, that it must be the bug in the theme.

    How can we proceed with fixing it?

    #719722

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Hello,

    In this case, could you please temporarily disable all plugins that are not related to our theme (including caching, optimization, and third-party WooCommerce extensions)? This will help us check if any of them are causing the issue.

    After that, kindly share your WordPress admin access using the Private content field so we can investigate it directly.

    We will review your setup and get back to you shortly.

    Best regards

    #719729

    robert.temczuk
    Participant

    After cancellation of all plugins the issue still presits (screens below).

    Attachments:
    You must be logged in to view attached files.
    #719774

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Thank you. But could you please also provide us with some user account where we can see the actual problem with the pricing?

    #719790

    robert.temczuk
    Participant

    Hi, please find the access in the private content.

    #719792

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Hi there,

    Thanks for the details and for sharing access. We’ve checked and can confirm the issue.

    This behavior comes from the role‑based pricing plugin. It is built to adjust prices on the single product page (and then in the cart), but it doesn’t apply its price logic in the product loop (shop/category grid). On the shop page, WoodMart also adds custom elements like variation/quick shop controls, and the plugin’s scripts aren’t designed to run there, so the grid shows the regular price while the single product page shows the discounted one.

    This isn’t something we can fix from the theme side. You’ll need the plugin developer to add compatibility for catalog/loop prices (and, if needed, for WoodMart’s quick shop/loop rendering) so the discounted price is calculated and displayed in the grid.

    Please contact the plugin’s support and request loop/catalog price support for logged‑in role pricing on WoodMart shop pages.

    Kind regards,
    XTemos Studio

    #720858

    robert.temczuk
    Participant

    Hello,

    I have contacted the plugin developer and here’s what their team found:

    “When a variation is changed, the WoodMart AJAX function woodmart_load_available_variations is triggered.

    This function currently retrieves and returns the regular variation prices instead of the discounted B2B prices.

    As this is a third-party function provided by WoodMart, we cannot modify it directly.

    You will need to contact the WoodMart support team regarding this issue.

    We can provide the code responsible for calculating and displaying the B2B variation prices, which will need to be integrated into the pricing logic used when woodmart_load_available_variations returns the variation price data.

    Please let us know if you need the relevant code snippet to share with their support team”

    I’m sending you a code snippet as an attachment.

    Please, help me implementing it.

    Kind Regards,
    Robert

    #720860

    robert.temczuk
    Participant

    please, share the email that i can use to send you a code snippet.

    #720866

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Hi there,

    Thanks for the update. Yes — we can help you integrate this, provided the plugin developer supplies all the necessary instructions.

    Please share the following via the forum’s Private Content field:
    – The exact code snippet they provided to calculate/display the B2B variation prices.
    – Clear instructions from the plugin developer on how/where their code should be called (hooks/filters/functions) in the product loop/variation context.
    – What price fields should be replaced/returned (e.g., price, display_price, price_html, compare/regular).
    – If different from before, a test product and user/role we should use to verify.

    Once we have those details, we’ll review and provide precise instructions (or a child-theme snippet) to adapt the woodmart_load_available_variations logic accordingly.

    Kind regards,
    XTemos Studio

    #721012

    robert.temczuk
    Participant

    Hello,

    Xtemos website doesn’t let me share those files (see the error screen below).
    How do I share it with You?

    Attachments:
    You must be logged in to view attached files.
    #721019

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    You can use .txt format for the file or compress it and share it using .zip file

    #721403

    robert.temczuk
    Participant

    Please find the files in the zip.

    Attachments:
    You must be logged in to view attached files.
    #721533

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Hello,

    Could you please send us your new admin access so we can try to apply the changes on your website and see how it works?

    Kind Regards

    #722018

    robert.temczuk
    Participant

    Please, find the access in the private contet.
    The problem also occurs in the basket view (please see the attachment).
    Moreover, we’ve got a complain from one of our regular clients (no B2B role assigned, bo reducted prices), that in the product grid he saw reducted price (he shared a screen with us), while he shouldn’t.

    Attachments:
    You must be logged in to view attached files.
    #722133

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Hello,

    Thank you for the admin access. Unfortunately, the file editor is disabled on your website so we can’t do anything with the code provided. In this situation, we need your FTP or SSH access so we can edit website files and try to implement the fix provided by the plugin.

    Kind Regards

    #722216

    robert.temczuk
    Participant

    Hello Greg,

    I have enabled the WP file manager advanced plugin, so now You can enter using it.

    Kind Regards,
    Robert

    Attachments:
    You must be logged in to view attached files.
    #722226

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Hello,

    It looks like after changing the role for our user on your website, we no longer have a user account to see specific pricing. Could you please check and clarify that?
    Also, please disable all plugins that are not related to our theme and leave B2B active so we can test without them.

    Kind Regards

    #722281

    robert.temczuk
    Participant

    Please, find the access to the discounted group user in the private content

    #722300

    Serg Sokhatskyi
    Keymaster
    Xtemos team

    Hi there,

    Thanks for all the details and sorry it took a while to get back.

    We’ve analyzed how the B2B plugin works on the shop page and confirmed the issue is that it doesn’t handle our AJAX requests at all. Technically we can’t “insert” the code they sent into the theme because, in our flow, we don’t calculate or replace a single variation price ourselves. For the grid/quick shop we call the WooCommerce API that returns all variations and then output that data as‑is.

    Specifically, WoodMart uses woodmart_load_available_variations (wp-content/themes/woodmart/inc/integrations/woocommerce/modules/quick-shop.php). This function simply calls $product->get_available_variations() and returns the result via AJAX. The role-based pricing plugin must filter that data to alter prices and also process the AJAX call so the adjusted prices are included in the response. We can’t do this on the theme side for the plugin.

    Please share this with the plugin developer so they:
    – Apply their pricing logic to the data returned by get_available_variations
    – Ensure it runs on AJAX (including our woodmart_load_available_variations endpoint), so the grid/quick shop receives the discounted prices

    The only adjustment you will need to make is to add to the child theme the following hook to disable cache for this functionality.

    add_filter('woodmart_swatches_cache', '__return_false');

    Once the plugin handles those AJAX requests and filters the variations output, the correct prices will appear in the product grid.

    Kind regards,
    XTemos Studio

Viewing 21 posts - 1 through 21 (of 21 total)