Customizing Dara Theme

  • Author
    Posts
  • #3175261

    I’m trying to remove the variable price range for my products, I have the code to insert but I need help in where to enter the code and how to save it?

    The blog I need help with is 604printdesign.com.

    #3175312

    dkmyta
    Staff

    Hey there,

    What type of code is that you have? If it is CSS you can copy and paste this code into the CSS section of your Customizer. If you are not certain what type of code it is perhaps paste it here for us to view and we can provide further direction.

    One thing to keep in mind, the ability to use Custom CSS is a feature only available to Premium and Business plan holders. For more information on Custom CSS and how to add it to your website please refer to the following documentation:
    https://en.support.wordpress.com/custom-css/
    https://en.support.wordpress.com/custom-design/editing-css/.

    There are also various other forms of code, many of which have limitations to their usage on WordPress.com without upgraded plans. Feel free to click on the following link to learn more: https://en.support.wordpress.com/code/

    Hope this helps,

    Cheers

    #3175355

    I’ve been adding code for various other things, but for some reason I’m not able to add this one. I am using the Dara theme.
    Please advise.
    Thanks.

    /*
    Disable Variable Product Price Range:
    */

    add_filter( ‘woocommerce_variable_sale_price_html’, ‘my_variation_price_format’, 10, 2 );

    add_filter( ‘woocommerce_variable_price_html’, ‘my_variation_price_format’, 10, 2 );

    function my_variation_price_format( $price, $product ) {

    // Main Price
    $prices = array( $product->get_variation_price( ‘min’, true ), $product->get_variation_price( ‘max’, true ) );
    $price = $prices[0] !== $prices[1] ? sprintf( __( ‘%1$s’, ‘woocommerce’ ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );

    // Sale Price
    $prices = array( $product->get_variation_regular_price( ‘min’, true ), $product->get_variation_regular_price( ‘max’, true ) );
    sort( $prices );
    $saleprice = $prices[0] !== $prices[1] ? sprintf( __( ‘%1$s’, ‘woocommerce’ ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );

    if ( $price !== $saleprice ) {
    $price = ‘‘ . $saleprice . ‘ <ins>’ . $price . ‘</ins>’;
    }
    return $price;
    }

    #3175528

    kokkieh
    Staff

    Hi there,

    This forum provides support for basic CSS customizations on WordPress.com sites only.

    What you’re trying to do is add custom PHP code to your theme. That is something completely different from CSS and we cannot help you with that here – you need a developer familiar in PHP for this type of customization. We do not provide support for this type of customization on WordPress.com.

    While you’re modifying your theme, you can consider contacting a WooCommerce Expert for help:

    https://woocommerce.com/customizations/

    You can also look at our directory of WordPress professionals at https://jetpack.pro/ or you can ask for advice at https://wordpress.stackexchange.com/

The topic ‘Customizing Dara Theme’ is closed to new replies.