I In diesem Skript wird angenommen, dass Werte aus Eingabefeldern abgerufen und dann in eine href-Verknüpfung eingefügt werden. aber ich erhalte diesen Fehler in der Konsole:JQuery-Fehler: Uncaught Error: Syntaxfehler, nicht erkannter Ausdruck
Uncaught Error: Syntax error, unrecognized expression: ?add-to-cart=7690&variation_id=8498&attribute_pa_color=gold
Hier ist das Skript:
jQuery(document).on("click", ".variations_form.cart .variation_buttons_wrapper a", function(){
// Get all the values needed for the URL
var add_to_cart = jQuery(this).parent().parent().parent().parent().parent().parent().find('input[name="add-to-cart"]').val();
var variation_id = jQuery(this).parent().parent().parent().parent().parent().parent().find('input[name="variation_id"]').val();
var pa_color = jQuery(this).attr("id");
setTimeout(function(){
// Craft the URL
var link = jQuery("?add-to-cart=" + add_to_cart + "&variation_id=" + variation_id + "&attribute_pa_color=" + pa_color);
alert(link);
}, 500);
});
Irgendwelche Ideen ??
Danke das hat funktioniert. – mysticalghoul
Ich werde aber anscheinend muss ich noch 5 Minuten warten. – mysticalghoul