Important notice: we will respond to all open ticket requests up until November the 1st. After this date, we will be unable to process the ticket requests here on Ticksy.

Okay
  Public Ticket #1355972
Discount not shown
Closed

Comments

  • Israel started the conversation

    If the product is simple, it shows the discount percentage, but if the product is variable, then it does not show the discount percentage (see attached image)

  •  1,845
    Elated replied

    Hello,

    You can try to alter woocommerce-functions.php file, located in >> wp-content\themes\satine\framework\modules\woocommerce\

    Just replace this code below:

    function satine_elated_woocommerce_sale_percentage($price, $sale_price){
            if($price > 0 ) {
                return '-' . (100 - round(($sale_price * 100) / $price)) . '%';
            }else{
                return esc_html__('SALE', 'satine');
            }
        }

    with this one:

    function satine_elated_woocommerce_sale_badge($product, $price, $sale_price){
            //print_r($sale_price);
            if($price > 0 && $sale_price !== 0 ) {
                return '-' . (100 - round(($sale_price * 100) / $price)) . '%';
            }else if ( !$product->has_child() && $sale_price === 0 ){
                return esc_html__('FREE', 'satine');
            }else{
                return esc_html__('SALE', 'satine');
            }
        }

    The Elated Support Center has been moved to our centralized support platform. 

    Please note that any existing tickets prior to this change will be answered right here on Ticksy, and in due time. 

    If you wish to submit a new support request, for all new inquiries please head on to our Help Center.

    Elated Themes is part of Qode Interactive – the home of 300+ premium WordPress themes.

    Don’t forget to sign up for our newsletter and be the first to find out all the latest news.

  • Israel replied

    Hello,

    By doing this, the product disappears. I have made sure the code has been replaced properly. It does not work.

  •   Elated replied privately
  • Mimouu replied

    Hello,

     I have the same problem on my website

  •  1,845
    Elated replied

    Hello @Mimouu,

    That feature is not predicted for variable products, at all. Such an option, unfortunately, does not exist within the theme, we are sorry. Achieving this will require some custom coding, but we are not in a position to accept any custom work, because we primarily need to focus on providing Theme Support to all customers. We hope you understand.

    In case you are not familiar with programming, you could hire someone to do this for you. You could look for someone who you can hire for this kind of job at the following link: - http://studio.envato.com

    Sorry for misunderstanding.


    The Elated Support Center has been moved to our centralized support platform. 

    Please note that any existing tickets prior to this change will be answered right here on Ticksy, and in due time. 

    If you wish to submit a new support request, for all new inquiries please head on to our Help Center.

    Elated Themes is part of Qode Interactive – the home of 300+ premium WordPress themes.

    Don’t forget to sign up for our newsletter and be the first to find out all the latest news.