Home › Forums › WoodMart support forum › Disable variable price (most expensive price) on woocommerce product
Disable variable price (most expensive price) on woocommerce product
- This topic has 11 replies, 3 voices, and was last updated 5 years, 6 months ago by
Elise Noromit.
-
AuthorPosts
-
August 1, 2019 at 1:01 pm #135558
ArenarParticipantHi,
Can you please assist me with how can I disable for most expensive cost from a variable product and only display the lowest cost?
I have attached an example image.
Thanks.
Attachments:
You must be logged in to view attached files.August 1, 2019 at 9:46 pm #135662
Elise NoromitMemberHello,
Please add this code to the Theme Settings > Custom CSS > Global:
.product-grid-item .price .amount:first-child { font-size:0; } .single-product-content p.price .amount:first-child { font-size:0; }
Best Regards
August 2, 2019 at 12:43 pm #135739
ArenarParticipantHi,
Thanks for you reply. I have tried to insert the css and it removed the lower amount and kept the dash and the highest cost.
I wanted the dash and the highest price removed, only showing the lowest amount??
Attachments:
You must be logged in to view attached files.August 2, 2019 at 2:59 pm #135774
Elise NoromitMemberHello,
Please replace the code provided in the Theme Settings > Custom CSS > Global:
body .product-grid-item .price, body .single-product-page .summary-inner > .price { font-size: 0; } .single-product-page .summary-inner > .price > span:first-child { font-size: 22px; } .single-product-page .summary-inner > .price > small { font-size: 18px; margin-left: 6px; } body .product-grid-item .price > ins, body .product-grid-item .price > span:first-child { font-size: 14px; } body .product-grid-item .price > del { font-size: 12px; margin-right: 3px; } body .product-grid-item > .price > small { font-size: 12px; margin-left: 4px; } body .single-product-page .summary-inner > .price > ins, body .single-product-page .summary-inner > .price > span:first-child { font-size: 22px; } body .single-product-page .summary-inner > .price del { font-size: 22px; margin-right: 6px; }
Best Regards
August 3, 2019 at 11:01 pm #135914
ArenarParticipantHi Elise,
Thank you though the css still doesn’t work??
It is still showing the dash and the most expensive price of the variable product?
Please see example below:
August 4, 2019 at 10:15 am #135928
Elise NoromitMemberHello,
Please disable blocking to your login URL so that I could log in.
Best Regards
August 4, 2019 at 11:03 am #135935
ArenarParticipantDetails in the private content
August 4, 2019 at 3:34 pm #135950
Elise NoromitMemberHello,
You have copied the code incorrectly, never copy email, always copy from the forum.
Best Regards
August 27, 2019 at 12:58 pm #140655
ArenarParticipantThank you for your assistance on this. Its all working, though I have noticed when I view the website via my mobile phone it shows both prices again??
Attached is the image
August 27, 2019 at 1:08 pm #140659
Jeriss Cloud CenterParticipant@arenar you better try this instead …
/** * SHOW THE LABEL "FROM X$" FOR ALL VARIABLE PRODUCTS */ add_filter( 'woocommerce_variable_sale_price_html', 'wpm_variation_price_format', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'wpm_variation_price_format', 10, 2 ); function wpm_variation_price_format( $price, $product ) { $min_price = $product->get_variation_price( 'min', true ); $max_price = $product->get_variation_price( 'max', true ); if ($min_price != $max_price){ $price = sprintf( __( 'From %1$s', 'woocommerce' ), wc_price( $min_price ) ); return $price; } else { $price = sprintf( __( '%1$s', 'woocommerce' ), wc_price( $min_price ) ); return $price; } }
August 27, 2019 at 1:21 pm #140665
ArenarParticipantHi,
Thank you for your prompt response.
I have tried the code and it’s not working. This shows both variable prices and not only the lowest one.
Regards,
August 28, 2019 at 6:46 am #140777
Elise NoromitMemberHello,
Please add this code to the Theme Settings > Custom CSS > Global:
@media (max-width: 576px) { body .product-grid-item.col-6 .price { font-size: 0; } }
Best Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register