Home / Forums / WoodMart support forum / Promotion with a discount label displayed
Home › Forums › WoodMart support forum › Promotion with a discount label displayed
Promotion with a discount label displayed
- This topic has 7 replies, 2 voices, and was last updated 1 year, 3 months ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
March 17, 2025 at 5:19 am #646242
kruajengParticipantI want to set up a product promotion with a discount label displayed as shown in this image.
How do I do that?
Attachments:
You must be logged in to view attached files.March 17, 2025 at 2:23 pm #646439Hello,
There is no option in the theme settings to display the save price like this. This requires customization, which is beyond our support policy.
I have searched for a possible solution and found a custom function that you can add to your functions.php file. If the provided code does not work as expected, unfortunately, we are unable to modify it further.
Add this to your theme’s functions.php file of the theme.
add_filter('woocommerce_get_price_html', 'custom_sale_savings', 10, 2); function custom_sale_savings($price, $product) { if ($product->is_on_sale()) { $regular_price = $product->get_regular_price(); $sale_price = $product->get_sale_price(); $savings = $regular_price - $sale_price; $price .= '<span class="save-price">Save $' . number_format($savings, 2) . '</span>'; } return $price; }To style the save price add the following code in Theme Settings > Custom CSS > Global CSS area.
.save-price { display: inline-block; background-color: #ff0000; /* Change to your preferred color */ color: #fff; font-size: 14px; font-weight: bold; padding: 3px 8px; border-radius: 5px; margin-left: 10px; }Hope this Helps!
Best Regards,
March 17, 2025 at 3:05 pm #646451
kruajengParticipantHello, Aizaz Imtiaz Awan
Could you please tell me
How to remove or change the currency To ฿?
I sell products in Thailand.And I can’t find the functions.php file.
Which menu in the theme is it hidden under? Could you please check?Thank you.
March 17, 2025 at 5:08 pm #646511Hello,
01. You can modify the currency symbol in the code by replacing “$” with “฿” like this:
add_filter('woocommerce_get_price_html', 'custom_sale_savings', 10, 2); function custom_sale_savings($price, $product) { if ($product->is_on_sale()) { $regular_price = $product->get_regular_price(); $sale_price = $product->get_sale_price(); $savings = $regular_price - $sale_price; $price .= '<span class="save-price">Save ฿' . number_format($savings, 2) . '</span>'; } return $price; }02. You can use a file manager plugin to edit your wp-config.php file.
Install and activate a https://wordpress.org/plugins/wp-file-manager/
Open the file manager plugin in your WordPress dashboard. Navigate to your website’s root directory and locate the wp-config.php file.
Use the plugin’s code editor to open the file. Search for
define(‘DISALLOW_FILE_EDIT’, true);and change true to false.Follow this guide: https://theplusaddons.com/blog/how-to-fix-wordpress-theme-file-editor-missing
Best Regards,
March 17, 2025 at 5:49 pm #646518
kruajengParticipantHello, Aizaz Imtiaz Awan
I enabled Auto height for all,
But the heights are still inconsistent.How can I correct this?
Attachments:
You must be logged in to view attached files.March 18, 2025 at 10:11 am #646636Hello,
I have checked your site, and the grid product heights appear to be the same.
For clarification, please see this screenshot: https://ibb.co/fjnrxYw
The inconsistency might be due to the “Save” label—some products have it while others don’t, which could be affecting the height alignment.
If you have any questions feel free to contact us.
Best Regards,
March 18, 2025 at 11:45 am #646701
kruajengParticipantThank you
close TopicMarch 18, 2025 at 3:28 pm #646816Hello,
You’re very welcome! I’m glad I could help. If you need anything else, feel free to reach out!
Thanks for contacting us.
Have a great day.Topic Closed.
Best Regards, -
AuthorPosts
The topic ‘Promotion with a discount label displayed’ is closed to new replies.
- You must be logged in to create new topics. Login / Register