Wix booking custom pricing

Question:
How to add custom pricing based on specific dates
Product:
Wix Editor
What are you trying to achieve:
adjust booking prices based on time frame for example from may 1st to July 1st price is $100 and then from July 1st to Oct 1st price is $150.

What have you already tried:
I tried to look for custom code but i dont understand anything

Additional information:
Custom pricing is a major part of what im selling because it all depends on the date. I dont see any way of doing it through the services section. Im feel crippled and need help

Custom pricing logic can be implemented using Velo code. This tutorial shows you how:

If you’re not familiar with writing code, then I would suggest hiring a developer to build this for you on your website.

how to hire someone ?

You can hire a developer from the Marketplace, or if you want us to develop this for you, please reach out via our website by clicking on the button below. We’re Wix Certified Velo Developers and specialise in developing custom code solutions just like this. (:

Get in touch

i got the function to work locally in the fucntion output but when i go and publish it doesnt reflect when i go look into the wix logs i only see this Your site was published with an update to the bookings pricing provider
integration, ‘pricecustom’ . The price is set to Fixed in my service is that why ?

It’s hard to tell what’s causing this without taking a look at your site and the code you’ve written. It could either be your frontend code, or the Service Plugin which might not be working as expected.

my config.js has this code // No imports needed for config

export function getConfig() {
  return {
    pricingProviderName: "calculatePrice" // Must match your function name
  };
}

then my .js has this

// datepackage.js (Final Production Version)
export const calculatePrice = async (options) => {
  try {
    // Validate input
    if (!options?.booking?.startDate) {
      console.error("Missing booking data");
      return { calculatedPrice: 1062 }; // Winter default
    }

    // Calculate season
    const month = new Date(options.booking.startDate).getMonth() + 1;
    const isSummer = month >= 5 && month <= 8;
    
    // Debug log for live testing
    console.log("Live price calculation:", {
      date: options.booking.startDate,
      month,
      season: isSummer ? "summer" : "winter",
      price: isSummer ? 897 : 1062
    });

    return {
      calculatedPrice: isSummer ? 897 : 1062,
      _metadata: { refreshCheckout: true } // Force UI update
    };

  } catch (error) {
    return { calculatedPrice: 1062 }; // Fail-safe
  }
};

Yes, this code is pretty much correct and should update the price at checkout, so you won’t need this line:

However, do note that this code will run for ALL your services and will change the price of all of them during checkout. So if you need different pricing for specific tours, you’ll need to perform additional checks to fetch the booked tour and update the price accordingly.

And again, this will not update on the site’s frontend. The price will still be what you have set to default when the user browses through your tour packages. This code will only run and update the price when the user actually proceeds to book by clicking on the Book Now button.