Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #469918

    Hi There,

    There is prices showing next to my sizes on my product page dropdown box. I need the prices gone. Can someone please help! http://www.asterandoak.com.au

    I am running woocommerce too

    Thanks!

    #469968

    Hi mellypenny!

    That happens because the variations do have different prices.

    Just copy and paste below code for your theme function.php file.

    function patricks_custom_variation_price( $price, $product ) {
    
        $target_product_types = array(
            'variable'
        );
    
        if ( in_array ( $product->product_type, $target_product_types ) ) {
            // if variable product return and empty string
            return '';
        }
    
        // return normal price
        return $price;
    }
    
    add_filter('woocommerce_get_price_html', 'patricks_custom_variation_price', 10, 2);

    Let me know if it helped you

    Cheers!
    Basilis

    #470020

    Hi Basilis! Thanks for the quick reply :-)

    Where would i find the function.php file? Is it in the theme on wordpress somehwere or do i need to go into FTP?

    #470068

    Hi!

    You can access it either from FTP inside the theme folder, or from Apperance -> Edditor

    Best regards,
    Basilis

    #470793

    Hi Basilis!

    I added it to the function.php file but the price still shows – https://www.asterandoak.com.au/product/fox-organic-baby-romper/

    Is there anything else i needed to do? Like re-ad the product?

    #470821

    Hey!

    I am getting an error while loading your web site!

    If what I posted previously is not working, please also try

    
    add_filter('woocommerce_variable_price_html','custom_from',10);
    add_filter('woocommerce_grouped_price_html','custom_from',10);
    add_filter('woocommerce_variable_sale_price_html','custom_from',10);
    function custom_from($price){
        return false;
    }

    Cheers!
    Basilis

    • This reply was modified 9 years, 4 months ago by Basilis.
    #470826

    Sorry try again now.. It still didnt work :-(

    #470914

    Hey!

    Can you let me know if you copy the code from the email or you come to forum and copying it?
    Can you also add your backend access to the post

    Cheers!
    Basilis

    #470923

    I came to the forum and copied it.

    Do you mean my wordpress login?

    #470931

    Hey!

    Yea please, your WordPress login!

    Best regards,
    Basilis

    #470933

    Okay Thanks Will put it below.

    #470997

    Any Luck? Do you know what the problem is?

    #471305

    Hey!

    I check the product and the variations are quite different from the default woocommerce installation. There is a dollar sign beside the size attribute. There is a product variation in my installation but it doesn’t display any prices in the attribute options. Please try to deactivate the woocommerce extensions in the plugins directory.

    Cheers!
    Ismael

    • This reply was modified 9 years, 4 months ago by Ismael.
    #471812

    Thanks for that Ismael,

    I deactivated the plugins and figured out it was the woocommerce wholesale pricing plugin causing it. Any ideas how to get rid of it or i need to contact them?

    #472234

    Hey!

    The options are saved inside the product_variations data attribute so there’s no way to remove it without removing the entire form. Yes, please contact the plugin author regarding the issue.

    Cheers!
    Ismael

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.