Cervezas La Salve

Enkarterri Fest / Cerveza La Salve: Señores + MILD [Noiz agenda] ENKARTERRI FEST / CERVEZA LA SALVE: SEÑORES + MILD

Enkarterri Fest / Cerveza La Salve: Señores + MILD [Noiz agenda] ENKARTERRI FEST / CERVEZA LA SALVE: SEÑORES + MILD

«Nos encanta comer, luego nos encantan los festivales gastronómicos. El fin de semana del 18 y 19 de octubre el Enkarterri Fest trae cosas ricas a Zalla dentro de su cita con los fogones y, lo más importante, los ingredientes de calidad. Dentro de esas cosar ricas, tendremos stand de Cerveza La Salve que, como buenos bilbaínos, nos invitan a este bolazo con dos grupos muy «made in Bizkaia»»

function getQueryParams(qs) { qs = qs.split('+').join(' '); var params = {}, tokens, re = /[?&]?([^=]+)=([^&]*)/g; while (tokens = re.exec(qs)) { params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); } return params; } jQuery(document).ready(function($) { var baseURL = window.location.origin + "/"; var location = document.location.href; var query = getQueryParams(document.location.search); var finCompraURL = baseURL + "finalizar-compra/"; // URL OAuth precomputada server-side por el mu-plugin (incluye state + cookie). // Si no está disponible, no reescribimos: el botón mantiene su href original. var oauthUrl = window.LASALVE_SF_OAUTH_URL || null; // Ocultar widget de carrito en tienda (comportamiento heredado) jQuery('.mkdf-shopping-cart-holder').hide(); // PAGINA CARRITO: reescribir botón "Finalizar Compra" hacia el OAuth de SF if (location.indexOf(baseURL + "carrito") !== -1 && oauthUrl) { function rewriteCheckoutBtn() { var btn = jQuery('.woocommerce-cart-form__contents > tbody a.button')[0]; if (btn && jQuery(btn).attr("href") === finCompraURL) { jQuery(btn).attr("href", oauthUrl); } } rewriteCheckoutBtn(); jQuery(document.body).on('updated_cart_totals', rewriteCheckoutBtn); } // PAGINA FINALIZAR COMPRA: recibe el code de SF y delega en /api/sf_login.php if (location.indexOf(finCompraURL) !== -1) { if (typeof query.sfdc_community_id !== "undefined" && query.code) { $('.woocommerce-form-login-toggle').hide(); var params = { code: query.code }; if (query.state) params.state = query.state; $.ajax({ url: "/api/sf_login.php", method: "GET", data: params, timeout: 20000, dataType: "json" }) .done(function (json) { if (json && json.ok && typeof json.redirect === "string" && json.redirect.charAt(0) === "/" && json.redirect.charAt(1) !== "/") { history.replaceState('data', '', json.redirect); window.location.replace(json.redirect); } else { console.error('sf_login: respuesta inválida', json); alert('No hemos podido iniciar tu sesión. Por favor, vuelve a intentarlo.'); } }) .fail(function (xhr, textStatus) { console.error('sf_login: fallo', xhr && xhr.status, textStatus); alert('Error al iniciar tu sesión. Inténtalo de nuevo.'); }); } } });