Home / Forums / WoodMart support forum / Price “from” (dynamic discount)
Home › Forums › WoodMart support forum › Price “from” (dynamic discount)
Price “from” (dynamic discount)
- This topic has 8 replies, 2 voices, and was last updated 1 year, 11 months ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
August 9, 2024 at 12:49 am #589131
DEVPOM1234ParticipantHello,
The product price “from” show the normal price not the best price from the dynamic discount (see in attachment.
On my exemple the best price is 2,40€ but it’s appear 3,20€.Attachments:
You must be logged in to view attached files.August 9, 2024 at 2:43 pm #589280Hello,
Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.
Best Regards
August 9, 2024 at 2:51 pm #589289
DEVPOM1234ParticipantFind in private :
The website is in production so don’t make a mistakeAugust 10, 2024 at 10:11 am #589426Hello,
Yes, it is the theme’s default functionality. It always shows the product’s normal price which you have added in the price field: https://postimg.cc/NL8k78sc
It will not show the price from the Dynamic discount table.
Best Regards.
August 10, 2024 at 8:13 pm #589481
DEVPOM1234ParticipantHello,
Thank you, how we can do for have the best price from Dynamic discount table.
Because the customer see this price and is wrongAugust 11, 2024 at 11:06 am #589513
DEVPOM1234ParticipantWhat do you think of this code for show the lower price if there is a best price in dynamic discount :
add_filter('woocommerce_get_price_html', 'apply_dynamic_discount_price', 100, 2); function apply_dynamic_discount_price($price, $product) { // Vérifiez si $data est défini globalement ou essayez de l'initialiser ici global $data; // Si $data n'est pas vide, essayez de trouver le prix le plus bas if (!empty($data)) { $lowest_price = null; foreach ($data as $id => $row) { if (is_null($lowest_price) || $row['price'] < $lowest_price) { $lowest_price = $row['price']; } } // Si un prix plus bas est trouvé, le remplacer par le prix par défaut if ($lowest_price) { $price = wc_price($lowest_price); } } return $price; }August 12, 2024 at 9:23 am #589585Hello,
You can try the code in the child theme’s function.php file if it works for you please let us know.
Best Regards.
August 13, 2024 at 11:53 am #589857
DEVPOM1234ParticipantHello,
Unfortunately, it doesn’t works.
August 13, 2024 at 12:51 pm #589866Hello,
Then please hire a developer to do this for you. As I already told you that there is no option in Theme Settings available for that.
It requires customizations and this is beyond our limitations and support policy.
Regards.
Xtemos Studios -
AuthorPosts
- You must be logged in to create new topics. Login / Register