Home Forums Themes Support Gecko How to strike through prices when sale on

Tagged: 

Viewing 7 reply threads
  • Author
    Posts
    • #22920

      Is it possible to display the price of a product with the original price with a line through it and the sale price beside it. It is a visual for the customer to see clearly what they are saving. At the moment I have it in the description which highlights it but only once you have gone to that product page –  https://www.wheyuk.com/product/pro-recovery/

      Thanks

    • #22923

      Hi,

      Please add below code

      .price del span {text-decoration: line-through;}

      Best regards

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

    • #22935

      Thank you, I have added this to Jan Studio Theme – General Settings CSS Style Sheet but it has not had any effect. Is there another place I should be adding it please.

    • #22947

      Hi,

      The price on top is price of separate variation not sale price, the code apply for variation at bottom http://take.ms/ITRhq

      Best regards

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

    • #22948

      I see, thank you. Is there a way to show it at the price of separation variation as well?

    • #22951

      Hi,

      Please add below code to gecko-child > functions.php

      function wc_varb_price_range( $wcv_price, $product ) {
       
          $prefix = sprintf('%s: ', __('From', 'wcvp_range'));
       
          $wcv_reg_min_price = $product->get_variation_regular_price( 'min', true );
          $wcv_min_sale_price    = $product->get_variation_sale_price( 'min', true );
          $wcv_max_price = $product->get_variation_price( 'max', true );
          $wcv_min_price = $product->get_variation_price( 'min', true );
       
          $wcv_price = ( $wcv_min_sale_price == $wcv_reg_min_price ) ?
              wc_price( $wcv_reg_min_price ) :
              '<del>' . wc_price( $wcv_reg_min_price ) . '</del>' . '<ins>' . wc_price( $wcv_min_sale_price ) . '</ins>';
       
          return ( $wcv_min_price == $wcv_max_price ) ?
              $wcv_price :
              sprintf('%s%s', $prefix, $wcv_price);
      }
       
      add_filter( 'woocommerce_variable_sale_price_html', 'wc_varb_price_range', 10, 2 );
      add_filter( 'woocommerce_variable_price_html', 'wc_varb_price_range', 10, 2 );

      For more please refer this topic https://wedevs.com/105501/disable-woocommerce-variable-product-price/

      Best regards

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

    • #22965
      This reply has been marked as private.
    • #22974

      Hi,

      Please remove code and add to gecko-child > functions.php not in gecko. Because when you update gecko theme the code will be remove. If you put in gecko-child the code will prevent when have update.

      Best regards

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

Viewing 7 reply threads

You must be logged in to reply to this topic.