Support » Plugin: Markup by Attribute for WooCommerce » Wrong product prices for sales

  • Resolved eckengucker


    Hey there. First of all thank you for your amazing plugin. It’s nicely coded and well documented.

    But like “cwlocal” wrote 6 months ago I’m running in the same problem with discounted products. The description shows only the regular price which is very confusing. Can you tell my which parts I have to delete to remove the regular price from the description and only show the markup’s? This would be a first, even not perfect, solution for me.

    Right now I solved the problem by bulk editing the description within the database but that’s not a permanent solution.

    Thank you in advance

    • This topic was modified 1 year, 4 months ago by eckengucker.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Mark Tomlinson


    Yes, I see what you are saying. Your particular theme does not show that the bike is on sale, so it becomes confusing when the regular price is shown in the description with no elaboration.

    Briefly, the reason I left it this way is that if the product is clearly shown to be on sale, then a description showing how the regular price is calculated followed by the final regular price crossed out and the sale price next to it would make perfect sense.

    The easiest, but the bluntest way to correct this is to go to WooCommerce > Settings > Products > Markup by Attribute and select the following option:
    Do NOT add pricing information to the description field.

    This will eliminate the markup information all together. You have to use Set regular price again to clear the descriptions.

    But, I realize that’s not what you asked. So, if you are using Markup by Attribute version 3.5, you can go to the Plugin Editor and select Markup by Attribute for WooCommerce. Then navigate to src > backend > product.php and comment lines 237 through 250. It should look something like this:

    //      if ( $orig_price <> 0 )
    //      {
    //          $description .= html_entity_decode
    //          (
    //              MT2MBA_PRICE_META .
    //              sprintf
    //              (
    //                  get_woocommerce_price_format(),
    //                  get_woocommerce_currency_symbol( get_woocommerce_currency() ),
    //                  $orig_price_formatted
    //              ) .
    //              PHP_EOL
    //          );
    //      }

    Again, you will have to use the Set regular price function to make this work.

    I hope this helped. I’ll look at an option to not include the original price in the description for the next release.

    Thank you. Your provided solution is working as long as you add the new option.

    With our theme or better the plugin we are using I run into another problem. Normally I would show the regular price crossed out and behind the sale price. Since the plugin only allows to set regular, active, sale and full price and non of these are working without printing a price range.

    My idea was to use mt2mba_base_sale_price and mt2mba_base_regular_price but for products without a discount they are the same. So far I found no solution to show a regular price for simple and variable products within the plugin but that doesn’t belong here..

    Plugin Author Mark Tomlinson


    Glad it’s working. I’ll get started on setting up the new option to not show the base price in the description.

    If you’d like to talk to me about some of your ideas, you can always reach out to me at

    Well I thought about the sale price. The problem is to check how long the sale price is valid and alter the description afterwards. With the way your plugin works this is not possible I guess. Hence simply adding the sale price instead of the regular price won’t work. Honestly I’ve no idea how solve that problem satisfying :/

    Plugin Author Mark Tomlinson


    You are correct.

    I’ve explored the idea of hooking into the code that ‘expires’ the sale price. But that would require a lot of exploration and a major update to the plug-in. Because you are the second person to request some variation of this, I have to assume there are many more people who want it but don’t ask. I will explore it again.

    Your plugin deserves a lot more attention. I think the new function gonna be useful for many users. I’m looking forward to your new ideas. As soon as I have time I send you the German translation file.

    Plugin Author Mark Tomlinson


    Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Wrong product prices for sales’ is closed to new replies.