Issue with product prices in the live search dropdown result
Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Issue with product prices in the live search dropdown result
- This topic has 3 replies, 2 voices, and was last updated 6 days, 16 hours ago by
Ernest Marcinko.
-
AuthorPosts
-
June 28, 2026 at 5:36 am #57662
Mohamed Salah
ParticipantHello Ajax Search Pro Support Team,
I have just bought your plugin and its amazing, However my WooCommerce website is an Arabic (RTL) WooCommerce store, and I am facing an issue with how the product prices are displayed in the live search dropdown results.
The Issue:
The price numbers, decimals, and the currency symbol (EGP) are overlapping and displaying in a scrambled/reversed order (e.g.,00.EGP18500.instead ofEGP 18,500.00).The Root Cause:
I have a custom WooCommerce price format (using tags like<span>,<sup>,<small>to shrink decimals), and WooCommerce naturally uses the<bdi>tag to isolate the price direction in RTL languages.
Thats it:<code class="language-php">add_filter( 'formatted_woocommerce_price', 'sebakashop_span_decimals', 10, 5 ); function sebakashop_span_decimals( $formatted_price, $price, $decimal_places, $decimal_separator, $thousand_separator ) { $price = round( $price, $decimal_places ); $whole = number_format( floor( $price ), 0, $decimal_separator, $thousand_separator ); $decimal_value = round( ( $price - floor( $price ) ) * pow( 10, $decimal_places ) ); $decimal = str_pad( $decimal_value, $decimal_places, '0', STR_PAD_LEFT ); return $whole . '<span class="price-decimals">' . $decimal_separator . $decimal . '</span>'; }It seems that the plugin is either stripping these essential HTML tags or stripping their inline attributes (like
dir="rtl"orstyle), which breaks the text direction and the custom formatting completely.What I have tried so far (without success):
-
Enabled “Get product price HTML directly” / “Use WooCommerce price HTML”.
-
Added
<abbr><b><span><bdi><small><sup>to the “HTML Tags exclude from stripping content” field. -
Tried wrapping the
{Price}tag in the “Advanced Description Field” with<span dir="rtl">and<abbr>, but the formatting is still broken.
I have attached screenshots showing the scrambled price in the dropdown, as well as my current backend settings.
Could you please advise on how to force the plugin to completely render the native WooCommerce price HTML (including all tags and attributes) without any stripping, so it matches the rest of the shop?
Thank you,
June 29, 2026 at 6:47 am #57663Ernest Marcinko
KeymasterHi!
Thank you for all the details, it helps a lot.
The output is correct, the issue is that the text direction and alignment on the price is rtl/right, which causes the flip of the elements. This custom CSS will resolve it:
.rtl .asp_r .price { * { direction: ltr !important; text-align: left !important; } del { margin-left: 0.7em; } }All the best,
ErnestJune 29, 2026 at 9:39 am #57665Mohamed Salah
ParticipantThank you, its fixed.
June 29, 2026 at 9:50 am #57666Ernest Marcinko
KeymasterYou cannot access this content.
-
-
AuthorPosts
- You must be logged in to reply to this topic.