Welcome to the Liquify Community

Updated 7 days ago

Webflow direct Checkout not working

Hi,

I used a Code Snippet from Shopify dynamic Button for the direct Checkout. I know it´s not liquify direct, but maybe somebody knows what to do.

The direct checkout (f.e. works when I have something in the Cart, but doesn´t work when there isn´t something in the cart. So I think there is a problem with ids etc...

Here the code I used:
{% if product.available %}
<!-- Produktformular beginnt -->
{% form 'product', product, class: 'product-form' %}
<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
{{ form | payment_button }}
{% endform %}
{% endif %}
c
j
12 comments
So when I want to checkout, I get following message:
Attachment
Bildschirmfoto_2024-11-27_um_08.40.01.png
Hi @consti, can i check it somewher on the live site?

But it should be fixed when you add a x-bind:value="selected_or_first_available_variant.id" to the input field.
I hid it, but I will add that x-bind:value="selected_or_first_available_variant.id" and upload it again
Where do I need to add this?
instead of this? value="{{ product.variants.first.id }}"
or add it after the value="{{ product.variants.first.id }}"?
on the input and i would keep the value but modify like this: value="{{ product.selected_or_first_available_variant.id }}"
like this? <input type="hidden" name="id" value="{{ product.selected_or_first_available_variant.id }}" x-bind:value="selected_or_first_available_variant.id" />
okay thanks, I will try it
it works now thank you!
Add a reply
Sign up and join the conversation on Discord