How to move sale percentage to the beginning

This topic has 6 replies, 3 voices, and was last updated 2 years, 2 months ago ago by Rose Tyler

  • Avatar: Mavi Ekran
    Mavi Ekran
    Participant
    October 15, 2022 at 23:50

    In our language (Turkish) percentage needs to be at the beginning of the text. How do i get this.
    Image: https://prnt.sc/RAT_XDalVX9u

    5 Answers
    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff
    October 16, 2022 at 06:56

    Hello, @Mavi Ekran,

    In order to solve your issue please copy and paste the below-given Code for your theme >> functions.php file:

    add_filter( 'woocommerce_sale_flash', 'misha_change_on_sale_badge', 99, 3 );
    
    function misha_change_on_sale_badge( $badge_html, $post, $product ) {
    	return '<span class="onsale">%50 Sale</span>';
    }

    Note:you can change the text %50 Sale in the code as per your needs.

    Regards 8Themes Team.

    Avatar: Mavi Ekran
    Mavi Ekran
    Participant
    October 16, 2022 at 10:12

    But the percentage is not fixed so this is not a solution

    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff
    October 16, 2022 at 10:52

    Hello, @Mavi Ekran,

    I am sorry for the misunderstanding, Unfortunately, the thing you are looking for is not possible, and requires extra customization. Item support does not include services to modify or extend the item beyond the original features, style, and functionality described on the item page.

    If you want paid Customization services submit a customization request to WPKraken team.

    Regards 8Themes Team.

    Avatar: Mavi Ekran
    Mavi Ekran
    Participant
    October 16, 2022 at 10:58

    I guess I have to change this place on every update 🙁 https://prnt.sc/NtGjQpX6_Ivg

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    October 17, 2022 at 08:11

    Hello,

    You can rewrite etheme_sale_label_percentage_text() functon via functions.php of your child theme.
    https://developer.wordpress.org/themes/advanced-topics/child-themes/#using-functions-php
    https://webdesign.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme–cms-22623
    Please note that additional customization in files is out of our basic support scope.

    Regards

  • Viewing 6 results - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.