Hostaway / wordpress-plugin

Wordpress plugin by Hostaway.com
7 stars 1 forks source link

Per Night Price Issue #19

Open wajihsayyed opened 6 months ago

wajihsayyed commented 6 months ago

Per night price in the listings' booking section is showing 0.00 USD x XX Nights. I have checked the latest, second-latest, and even third-latest plugins, and they all show up the same way. Attaching 3 screenshots from 3 different websites as proof of error.

Thanks clipboard_image_a98ba23506993f1d clipboard_image_40a6cd6a971de5e6 0-02-03-9e7710b3d7f401b13ebbcb92b6cfd246643263d53684ba4d2c6c8c45b2e91acd_9bb8f61451f0d883

piyushpathar commented 1 month ago

just need to add below snippet to wp-content/plugins/hostaway/assets/hostaway.jsafter line number 3528 or after var pricePerNight = selectors.pricebreakdown.pricePerNight(store);

if(!pricePerNight){
    var getAmount = function getAmount() {
      if (useCustomAmount) return customAmount;

      var res = item.total;
      var amount = res;

      if (res) {
        if (showDecimals) {
          amount = (0, _roundDecimals.roundDecimals)(amount);
        } else {
          amount = (0, _roundDecimals.roundDecimals)(amount, 0);
        }
      }

      return amount;
    };
    var amount = getAmount();

    pricePerNight = amount / nights;
  }