fbpx

Translation method

WCMp Vendor Vacation

Translation method Resolved

Viewing 6 reply threads
  • Author
    Posts
    • #111724
      Naoya Ishikawa
      Participant

      The message “Shop is closed now. We will Reopen on 20th Dec 2020” that appears during the vendor’s vacation does not seem to support translation.
      Is there a way to replace the letters?

    • #111851

      Hi,
      Can you please share a screenshot of vendor page and also the product page with the text. So we will able to help you out accordingly.

      Regards,

    • #112082
      Naoya Ishikawa
      Participant
      This reply has been marked as private.
    • #112084
      Naoya Ishikawa
      Participant
      This reply has been marked as private.
    • #112106

      Hi,
      We have found a translation issue with this text.We will fix this on our next update.
      As a temporary solution please add below code
      Please add this code in the function.php of the current active theme :

      add_action('init', 'wcmp_vacation_shop_reopen_text');
      function wcmp_vacation_shop_reopen_text(){
      	global $WCMP_Vendor_Vacation;
      	remove_action('after_wcmp_vendor_description', array($WCMP_Vendor_Vacation->frontend, 'display_shop_reopen_date'));
      	add_action('after_wcmp_vendor_description',  'display_shop_reopen_date');
      }
      
      function display_shop_reopen_date($vendor_id) {
          $vendor_vacation_set_up = get_user_meta($vendor_id, '_vacation_include_dates', true);
          $holidays = isset($vendor_vacation_set_up['include_dates_array']) ? $vendor_vacation_set_up['include_dates_array'] : false;
          if (is_array($holidays) && count($holidays) > 0 && isset($vendor_vacation_set_up['avoid_purchase'])) {
              $today = date('j/n/Y');
              if (in_array($today, $holidays)) {
                  $available = true;
                  $day = 1;
                  while($available) {
                      $today = date('Y-m-d');
                      $tommorow = date('j/n/Y', strtotime($today .' +'.$day.' day'));
                      if(in_array($tommorow, $holidays)) {
                          $day++;
                      }
                      else {
                          $available = false;
                      }
                  }
                  if(!$available) {
                      $date = str_replace('/', '-', $tommorow);
                      $Reopen = date('Y-m-d', strtotime($date));
                      $shop_close_text = "Shop is closed now. We will Reopen on "; // change your text from here.
                      echo "<div class='description_data'><p>". $shop_close_text . date('jS M Y', strtotime($Reopen))."</p></div>";
                  }
              }
          }
      }
      Copy

      and change the text on the $shop_close_text variable.
      regards,

    • #115602
      Naoya Ishikawa
      Participant

      I was able to translate it safely.
      Thank you!

    • #115695

      Thank you, based on your confirmation we are marking this thread closed.

Viewing 6 reply threads

The topic ‘Translation method’ is closed to new replies.

Buy all Marketplace addons together, check out our Bundle

Buy at Slashed Price