Hi,
How can i add buy now button while keeping add to cart button as well. I have option to add dynamic checkout button on product page but i don’t want that because that changes to buy with paypal or apple pay etc.
I want a simple buy now button that redirects to checkout.
Can someone help me on this?
Thanks
Hi @wasimaliawan
This is Richard from PageFly - Shopify Page Builder App
About this concern, the only way to achieve it is to disable PayPal or Apple Pay in your payment settings.
If not, the button will be dynamically changed according to the customer’s payment methods.
For example: If cx doesn’t use any payment methods like PayPal or Apple. It will show Buy It Now for your customer
Hope this can help you solve the issue
Best regards,
Richard | PageFly
Hi @wasimaliawan , dynamic button will appear Paypal, Apple or Buy now base on your customer browser. You can enable dynamic checkout button and then open your product page using a new incognito window for checking, it will appear Buy now button.
You can learn more about dynamic checkout button here
https://help.shopify.com/en/manual/online-store/dynamic-checkout/dynamic-checkout
Was not expecting such a lame answer.
I thought i can get help from here but no luck.
I have done it myself. So here is the solution if anyone else is looking for.
If anyone need help on this then you can ping me wasimali91011@gmail.com.
$(document).on('click', '.buynow-btn', function(e) {
e.preventDefault();
var variant_id = $('.product-variant-id').val();
var quantity = $('.product__info-wrapper .quantity__input').val();
var btnText= $(this).find('span')
atcb.css("display", "none");
var btnLoading= $(this).find('.loading-overlay__spinner');
atcl.removeClass('hidden');
$.ajax({
type: 'POST',
url: '/cart/add.js',
dataType: 'json',
data: {
'id': variant_id,
'quantity': quantity
},
success: function(response) {
btnText.css("display", "inline");
btnLoading.addClass('hidden');
window.location.href = '/checkout';
},
error: function(xhr, status, error) {
console.log(xhr.responseText);
}
});
});