URL Mapping | Override Button link on each page

PHOTO EMBED

Tue Feb 25 2025 12:32:46 GMT+0000 (Coordinated Universal Time)

Saved by @Shira

<script>
  jQuery(document).ready(function($){
    var currentUrl = window.location.href;

    // Create a mapping of URLs and their respective links
    var urlMapping = {
      "https://www.basquedestination.com/en/rioja-alavesa-visita-a-la-cuna-del-vino/": "https://fareharbor.com/embeds/book/basquedestination/items/609105/?full-items=yes&flow=1338016",
      "https://www.basquedestination.com/en/tour-arquitectonico-de-bilbao-y-puente-de-bizcaia/": "https://fareharbor.com/embeds/book/basquedestination/items/609008/?full-items=yes&flow=1337994",
      "https://www.basquedestination.com/en/tour-pais-vasco-frances/": "https://fareharbor.com/embeds/book/basquedestination/items/609056/?full-items=yes&flow=1337998",
      "https://www.basquedestination.com/es/pintxotour-privado-en-bilbao-3/": "https://fareharbor.com/embeds/book/basquedestination/items/608963/?full-items=yes&flow=1338004",
      "https://www.basquedestination.com/es/tesoros-de-la-costa-vasca-zarautz-y-getaria-1/": "https://fareharbor.com/embeds/book/basquedestination/items/609084/?full-items=yes&flow=1338004",
      "https://www.basquedestination.com/es/costa-vasca-helicoptero/": "https://fareharbor.com/embeds/book/basquedestination/items/609061/?full-items=yes&flow=1337998",
      "https://www.basquedestination.com/es/entre-fogones-con-un-cocinero-sociedad-gastronomica/": "https://fareharbor.com/embeds/book/basquedestination/items/608992/?full-items=yes&flow=1338004",
      "https://www.basquedestination.com/es/getaria-villa-marinera/": "https://fareharbor.com/embeds/book/basquedestination/items/608997/?full-items=yes&flow=1338004",
      "https://www.basquedestination.com/es/pintxotour-privado-en-san-sebastian-4/": "https://fareharbor.com/embeds/book/basquedestination/items/608963/?full-items=yes&flow=1338004",
      "https://www.basquedestination.com/es/pintxotour-privado-en-bilbao/": "https://fareharbor.com/embeds/book/basquedestination/items/609109/?full-items=yes&flow=1338004",
      "https://www.basquedestination.com/es/pesca-en-la-costa-vasca-ondare-experiencias-hotel-arbaso-basque-destination/": "https://fareharbor.com/embeds/book/basquedestination/items/609087/?full-items=yes&flow=1337998",
      "https://www.basquedestination.com/es/surfea-con-locales/": "https://fareharbor.com/embeds/book/basquedestination/items/609093/?full-items=yes&flow=1337998",
      "https://www.basquedestination.com/es/la-sidra-y-el-mar/": "https://fareharbor.com/embeds/book/basquedestination/items/609064/?full-items=yes&flow=1338004",
      "https://www.basquedestination.com/es/miercoles-de-mercado-y-queso/": "https://fareharbor.com/embeds/book/basquedestination/items/609066/?full-items=yes&flow=1338004",
      "https://www.basquedestination.com/es/visita-cultural-privada-de-bilbao-y-museo-guggenheim/": "https://fareharbor.com/embeds/book/basquedestination/items/609004/?full-items=yes&flow=1337994",
      "https://www.basquedestination.com/es/recorrido-a-pie-por-la-costa-vasca-y-el-flysch/": "https://fareharbor.com/embeds/book/basquedestination/items/609104/?full-items=yes&flow=1337998",
      "https://www.basquedestination.com/es/rioja-alavesa-3/": "https://fareharbor.com/embeds/book/basquedestination/items/609105/?full-items=yes&flow=1338016",
      "https://www.basquedestination.com/es/tierra-de-san-ignacio-la-ruta-de-los-tres-templos-1/": "https://fareharbor.com/embeds/book/basquedestination/items/608996/?full-items=yes&flow=1335791",
      "https://www.basquedestination.com/es/visita-cultural-privada-de-donostia-san-sebastian/": "https://fareharbor.com/embeds/book/basquedestination/items/608980/?full-items=yes&flow=1335791",
      "https://www.basquedestination.com/es/rioja-alavesa-visita-a-la-cuna-del-vino/": "https://fareharbor.com/embeds/book/basquedestination/items/609112/?full-items=yes&flow=1335791",
      "https://www.basquedestination.com/es/excursion-a-bilbao-nuestra-ciudad-mas-vanguardista/": "https://fareharbor.com/embeds/book/basquedestination/items/609002/?full-items=yes&flow=1337994",
      "https://www.basquedestination.com/es/banos-de-bosque-ondare-experiencias-hotel-arbaso-basque-destinaton/": "https://fareharbor.com/embeds/book/basquedestination/items/609089/?full-items=yes&flow=1335791",
      "https://www.basquedestination.com/es/vitoria-y-el-valle-salado-de-anana-1/": "https://fareharbor.com/embeds/book/basquedestination/items/609095/?full-items=yes&flow=1338020",
      "https://www.basquedestination.com/en/vitoria-y-el-valle-salado-de-anana-6/": "https://fareharbor.com/embeds/book/basquedestination/items/609000/?full-items=yes&flow=1338020"
    };

    // Check if the current URL matches one of the keys in the mapping
    if(urlMapping[currentUrl]) {
      // Find the button using the provided selector and update its link
      $('.reservaExperiencia').attr('href', urlMapping[currentUrl]);
    }
  });
</script>
content_copyCOPY