Estimated delivery feature – language change

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

  • Avatar: Raul Lazar
    Raul Lazar
    Participant
    October 14, 2022 at 08:18

    The estimated delivery is a very cool addition and I was thinking about something like this in the past, so, when I saw it, I was very excited! πŸ˜€
    The problem is with language, it’s only showing in english and I saw you comment out the code which set the locale.
    I have deleted the “comment out” from the code and now it’s showing in my language, but the question is:
    It’s there a reason why you comment out that code?
    I am asking this, because I want to know if it safe/ not producing any error or in conflict with something else if I leave that few lines of code.

    3 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    October 14, 2022 at 11:59

    Hello,

    We are really happy that you are excited by this feature. We always think about our customers when coding new features which can help them to sell more products and make it faster !
    1/ Could you please, provide us a screenshot of what you uncomment to make sure? or you may send us a file you changed (upload it on any server like -> DropMeFiles – free one-click file sharing service )
    Also, we commented those lines as we are waiting for some questions from our clients and whoa here you are ! So, let’s try to figure out this together. 2/ Did you face any issues once you uncommented those lines ?
    3/ What are options for Estimated delivery you want us to improve/add ?
    4/ Which features would you like us to add in Sales Booster or globally in Theme Options ?

    Regards

    Avatar: Raul Lazar
    Raul Lazar
    Participant
    October 14, 2022 at 13:18

    Hi,

    Thank you very much for your answer!
    1.I have unccomment:
    In the file estimated-delivery.php -> lines 159 – 160 and 276 – 285 was commented out, and I uncomment.

    			'locale' => true,
    			'locale_format' => '%A, %d %b',

    and these:

    if( $this->settings['locale'] ){
    
    			setlocale(LC_TIME, get_locale());
    
    		if( apply_filters( 'xstore/woocommerce/estimated_delivery/utf8_encode', false) ){
    			return utf8_encode( strftime($this->settings['locale_format'], $timestamp) );
    		}
    
    		return strftime($this->settings['locale_format'], $timestamp);
    		}

    These lines, are the lines needed to get local (days/month in current language) because as far as I know, if you don’t explicitly set setlocale/LC_TIME the default will be in EN.

    2. It’s seems to be no problem uncommenting these lines, everything seems to work as expected.
    3. Currently, beside the problem above, I don’t know what to say :D. This problem would be nice to be solved, because when I update the theme, the modifications will be overwritten and maybe I forget to modify again.
    4. For this, I have some ideas, but not now, I will post in the features request section.

    Have a great day!

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    October 14, 2022 at 16:15

    Hello,

    Thanks for the details !
    It will be added as an option so after update you have to switch it on in Sales Booster settings

    Regards

  • Viewing 4 results - 1 through 4 (of 4 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.