Shopify themes, liquid, logos, and UX
I don't want a dynamic checkout button. When I disable the dynamic checkout button, the checkout button disappeared, and I wanted to Buy it now instead.
I'd appreciate it if anyone could help.
@weibincheng the "buy it now" Button is the default fallback button is none of the express payment options can be assigned to the button. Therefore, it is not possible to set it as default, without the deactivation of the payment methods.
Hi Finer, Thank you very much for your answer. So I only turn on the dynamic checkout button to get the buy button, and if I disable it, Is it just "add to cart" on the product?
@weibincheng correct.
You may though, disable express checkout buttons, but supply a button of your own.
If your theme has a "Custom Liquid" or "Custom HTML" block for main product info section, you can add one right below you cart button and paste a code like this:
{% if product.available %}
<div class="v-stack gap-4">
<button type="button" class="button button--xl button--outline" onclick="buyNow()">
<div>Buy now</div>
</button>
</div>
<script>
function buyNow() {
let variantId = {{ product.selected_or_first_available_variant.id }};
let search = location.search.match(/variant=(\d+)/);
if (search) variantId = search[1];
let url = `${Shopify.routes.root}cart/${variantId}:1`;
location.assign(url);
}
</script>
{% endif %}
The code should show a button, which, when pressed will redirect visitor to checkout with currently selected variant in cart.
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024