Skip to content

Instantly share code, notes, and snippets.

@RuslanSushko
RuslanSushko / buyNow.js
Last active December 25, 2015 16:18 — forked from adardesign/buyNow.js
(function () {
adrma.session.getSession.done(function gotSession(session) {
var buyNowButton,
productInfoContainer = $(".product-info-container");
if (session.cartCount === 0) {
productInfoContainer.find(".add-to-cart").after('<button class="radius add-to-cart button primary-dark action" data-action="silentAddToCart" type="button">Buy Now</button>');
buyNowButton = productInfoContainer.find("[data-action='silentAddToCart']");