Retail prices not showing on wholesale

HomeForumsGeneral Support – NOT for Volunteer and PTA plugins!Retail prices not showing on wholesale

Viewing 11 reply threads
  • Author
    Posts
    • #12335
      Anthony Terry
      Participant

      I have the wholesale ordering plugin but can someone advise how I get the retail prices to also appear on the wholesale side. I have tried changing the settings to no avail. Cheers, Anthony

    • #12337
      Stephen Sherrard
      Keymaster

      WooCommerce>Settings>Wholesale>Messages and Text section
      Scroll down to Wholesale price prefix text or Wholesale price suffix text settings. In the description for the settings is the template tag you can use to show the retail price:
      {retail_price}

      So, for example, if you want to show the retail price on a line below the wholesale price, you can use the tag for a line break followed by the tag for the retail price, like so:
      {br}Suggested Retail: {retail_price}

      • #12346
        Anthony Terry
        Participant

        Excellent. Perfect. And tops on the speedy reply. That’s just awesome and appreciated. Thanks Stephen.

    • #12355
      Anthony Terry
      Participant

      Hi Stephen, I seem to have encountered another problem. Could it be that this plugin could be overriding certain features? Products that were marked down and listed as ‘sale’ are now only displaying the sale price as their retail price and the sale button has been removed. Any suggestions?

    • #12367
      Stephen Sherrard
      Keymaster

      There are no “sale” prices for wholesale customers, so no sale banners are shown. There is only one wholesale price, so nothing to cross out and show as a sale price.

      However, if you are using the template tag to show the retail price in the prefix or suffix, then that does the regular woocommerce product->get_price method call, and will return whatever the current price is for retail (which would be the sale price, if it’s on sale).

      When viewing the same product as retail, the products should still be shown correctly, with regular price crossed out, sale price and banner displayed.

      • #12369
        Anthony Terry
        Participant

        Thanks for explaining. Aha. So if a product is reduced the retail amount displayed in wholesale mode defaults to the sale price. Got ya.

        The problem is that the sale price no longer displays in retail mode. It shows shows it worth the lower amount. You can view what i mean here. Both products are $28 but Man-tra has a sale price of $25 but that is not being displayed.

        • This reply was modified 4 years, 8 months ago by Stephen Sherrard. Reason: remove site info and password from public visibility
    • #12375
      Stephen Sherrard
      Keymaster

      I will take a look… I did a lot of optimizing and refactoring of code in the last big update, especially when using this plugin alongside the User Role Pricing plugin, so I may have messed up the display of that sale banner for retail customers also (instead of just wholesale).

    • #12377
      Stephen Sherrard
      Keymaster

      I guess not many people use the sale price feature, as you are the first to point this out. I am able to reproduce the issue on one of my dev sites. Something changed in the logic somewhere, and I’m having a hard time tracking down why it’s getting set as being not on sale, but still showing the sale price, for retail customers. None of my hooks for the “is on sale” conditional function for woocommerce are getting triggered (which is correct, because those should only be triggered for wholesale customers), but somehow it is still being determined to be not on sale.

      I’ll figure it out eventually, but must be something that recently changed that I missed in my testing.

    • #12379
      Stephen Sherrard
      Keymaster

      Found the issue… my plugin filters raw prices, even for retail customers, and sanitizes the values by making sure they are floating point numbers before returning the values (even if not changing them for retail customers), but at the point that WooCommerce is comparing sale price, regular price, and price, it’s still expecting them all to be strings (not floating point numbers), and it’s doing an exact comparison where the string and floating point number will never evaluate the same even if all the digits are exactly the same, so it’s always going to evaluate as not on sale. I had moved some of those filter hooks around in the last update so that those values are now getting converted to floating point earlier than they should. I have fixed that now so it doesn’t happen for retail customers at that point in the process.

      New update, being posted in a few minutes, will have that minor fix in it.

    • #12381
      Anthony Terry
      Participant

      Oh no. Sorry to cause some head scratching. Good luck figuring that out. Sorry to say, but there is also seems to be a fault with the ‘Thank You Text’. I have customised but it just defaults to the standard. Otherwise… it’s working great!

    • #12384
      Stephen Sherrard
      Keymaster

      No worries… easy fixed once I tracked down the issue.

      Will take a look at the thank you text. That could be a theme/template issue also, as your theme may use a custom thank you page that may not have the hook that my plugin uses to replace the standard thank you text. I will take a look though, as I probably forgot about checking that particular hook after WooCommerce made their last big update (which changed a lot of templates).

    • #12386
      Stephen Sherrard
      Keymaster

      Just did a quick test on my dev site using latest versions of everything, and the WooCommerce Storefront theme, and when set to be treated as wholesale, I see my custom thank you message at the top of the “Order Received” page. So, that is still working correctly with themes that did not modify that template/hook.

      You should look in your theme to see if it has replaced the thankyou.php template under the woocommerce/checkout folder in your theme. The line that prints out that text should have a filter hook applied to it, and should look like this:
      <p class="woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', 'woocommerce' ), $order ); ?></p>

      If that apply_filters part is not there, then my plugin can’t replace that text.

      • #12390
        Anthony Terry
        Participant

        Thanks. Sorry i am not experienced with adding script. Could you advise just exactly what and/where within the thankyou.php file i am adding that. I’m within the file, just not unsure my next step. Should it be wrapped with tags?

    • #12388
      Stephen Sherrard
      Keymaster

      Also, note, in case there was any confusion, the “messages and text” settings you set in the settings for my wholesale plugin ONLY show for wholesale customers. They don’t affect what retail customers see.

    • #12392
      Anthony Terry
      Participant

      actually forget that request. I just amended the default text within the file. Done. 🙂

Viewing 11 reply threads
  • You must be logged in to reply to this topic.