Home Forums WoodMart support forum Disable variable price (most expensive price) on woocommerce product

Disable variable price (most expensive price) on woocommerce product

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #135558

    Arenar
    Participant

    Hi,

    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.
    #135662

    Hello,

    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

    #135739

    Arenar
    Participant

    Hi,

    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.
    #135774

    Hello,

    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

    #135914

    Arenar
    Participant

    Hi 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:

    #135928

    Hello,

    Please disable blocking to your login URL so that I could log in.

    Best Regards

    #135935

    Arenar
    Participant

    Details in the private content

    #135950

    Hello,

    You have copied the code incorrectly, never copy email, always copy from the forum.

    Best Regards

    #140655

    Arenar
    Participant

    Thank 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

    #140659

    Jeriss Cloud Center
    Participant

    @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;
    	}
    }
    #140665

    Arenar
    Participant

    Hi,

    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,

    #140777

    Hello,

    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

Viewing 12 posts - 1 through 12 (of 12 total)