Home › Forums › WoodMart support forum › product price not displaying right
product price not displaying right
- This topic has 14 replies, 2 voices, and was last updated 4 months, 2 weeks ago by
Hung Pham.
-
AuthorPosts
-
April 7, 2025 at 3:09 pm #652186
vtParticipanthello
i have this format for price https://prnt.sc/Q0UCG-MsE8– but in some products it appears like that https://prnt.sc/aHJoPyje6kmFApril 8, 2025 at 7:27 am #652350
Hung PhamKeymasterHi vt,
Thanks for reaching to us.
The first screenshot is not available, please double check.
Kind Regards,
April 8, 2025 at 2:46 pm #652540
vtParticipanthello
this is the problem https://prnt.sc/NfkTjSkGHAtkApril 9, 2025 at 8:36 am #652664
Hung PhamKeymasterHi vt,
Thanks for screenshots, both are look like the same. Do you want to display prices in the same line?
Kind Regards,
April 9, 2025 at 9:43 am #652697
vtParticipantthis is how its supposed to be looking like https://prnt.sc/o_2jan583cNq as you can see there is a text there which is missing thats why i showed as the problem https://prnt.sc/NfkTjSkGHAtk
April 9, 2025 at 5:46 pm #652875
Hung PhamKeymasterHi vt,
Please add this code to the functions.php of the child theme:
add_filter( 'woocommerce_get_price_html', 'add_prefix_to_regular_price', 10, 2 ); function add_prefix_to_regular_price( $price, $product ) { // Define your prefix here $prefix = 'Price: '; // Check if the product is on sale if ( $product->is_on_sale() ) { // Get the regular and sale prices $regular_price = wc_price( $product->get_regular_price() ); $sale_price = wc_price( $product->get_sale_price() ); $price = '<del>' . $prefix . $regular_price . '</del> <ins>' . $sale_price . '</ins>'; } else { // Product is not on sale, add prefix to the regular price $price = $prefix . $price; } return $price; }
Regards,
April 10, 2025 at 10:38 am #652989
vtParticipantdidnt fix anything you just added one more text called price https://prnt.sc/x2QHb0brsfEH that even destroyed the good products price too https://prnt.sc/PJV8d32s5R-W
April 10, 2025 at 10:42 am #652994
vtParticipantthis code has been removed ofc since it makes it look so bad the old code was fine it just doesnt seem to work on some products as you saw on all the pics or if you visit the site dnt add any new test or anything just fix that please thank you
April 10, 2025 at 2:13 pm #653074
Hung PhamKeymasterHi vt,
According to the screenshot, you want to add text before original price? Please confirm me back.
Regards,
April 10, 2025 at 3:40 pm #653124
vtParticipantthis text text called “Τιμη” https://prnt.sc/mVvePxAytcTd but it doesnt show on all products only in some
April 11, 2025 at 9:28 am #653281
Hung PhamKeymasterHi vt,
You can use below CSS:
.single-product .price > span.amount::before { content: "Τιμη "; display: inline-block; margin-right: 4px; color: #333; font-weight: 500; }
Regards,
April 11, 2025 at 9:45 am #653289
vtParticipantthis code has error or a confilt since it wont let me save it https://prnt.sc/KJOx7vN4krS8
April 11, 2025 at 12:28 pm #653359
Hung PhamKeymasterHi vt,
This is Custom CSS, you need to add it under Theme Settings > Custom CSS > Global CSS.
Regards,
April 11, 2025 at 4:32 pm #653442
vtParticipantokay i have replace the old code with this and it works thanks
April 12, 2025 at 11:04 am #653567
Hung PhamKeymasterHi vt,
Glad to hear your issue has been resolved. Keep us in mind for future questions and concerns, we’re always here to help!
Regards,
-
AuthorPosts
The topic ‘product price not displaying right’ is closed to new replies.
- You must be logged in to create new topics. Login / Register