diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 24af1f9..6ffc4f9 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -43,10 +43,6 @@ Magento\Config\Model\Config\Source\Yesno - - - Magento\Config\Model\Config\Source\Yesno - @@ -55,12 +51,6 @@ Enter addtocart form id for product view page(Ex. product_addtocart_form) - - - - Mageprince\BuyNow\Block\Adminhtml\System\Config\Field\AdditionalInfo - - diff --git a/etc/config.xml b/etc/config.xml index 6bc057e..93c184d 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -19,7 +19,6 @@ 1 1 1 - 1 product_addtocart_form Buy Now diff --git a/view/frontend/layout/catalog_category_view.xml b/view/frontend/layout/catalog_category_view.xml index 9929e71..a48d242 100644 --- a/view/frontend/layout/catalog_category_view.xml +++ b/view/frontend/layout/catalog_category_view.xml @@ -10,7 +10,7 @@ * @author MagePrince */ --> - + diff --git a/view/frontend/layout/catalog_product_view.xml b/view/frontend/layout/catalog_product_view.xml index 06bb84e..d1d8558 100755 --- a/view/frontend/layout/catalog_product_view.xml +++ b/view/frontend/layout/catalog_product_view.xml @@ -10,7 +10,7 @@ * @author MagePrince */ --> - + @@ -27,11 +27,5 @@ template="Mageprince_BuyNow::buynow-view.phtml" before="-" ifconfig="buynow/general/enable_view"/> - - - \ No newline at end of file diff --git a/view/frontend/templates/buynow-list.phtml b/view/frontend/templates/buynow-list.phtml index 9715e15..b205078 100755 --- a/view/frontend/templates/buynow-list.phtml +++ b/view/frontend/templates/buynow-list.phtml @@ -35,7 +35,7 @@ } } '> - + diff --git a/view/frontend/templates/buynow-view.phtml b/view/frontend/templates/buynow-view.phtml index 11ed15c..7bc5c4a 100755 --- a/view/frontend/templates/buynow-view.phtml +++ b/view/frontend/templates/buynow-view.phtml @@ -13,13 +13,17 @@ getAddToCartFormId(); ?> getButtonTitle() ?>
- -
\ No newline at end of file + diff --git a/view/frontend/web/css/buynow.css b/view/frontend/web/css/buynow.css index 3a1684c..51add5b 100755 --- a/view/frontend/web/css/buynow.css +++ b/view/frontend/web/css/buynow.css @@ -1,38 +1,18 @@ -.catalog-category-view .product-item-inner.buynow { - position: relative; - border: none; - box-shadow: none; - padding: 0 0 5px 1px; +.catalog-category-view .actions-primary + .actions-secondary { + vertical-align: top; } .catalog-category-view button.buynow { - width: 103px; + margin-left: 5px; } .catalog-product-view #product-addtocart-button { float: left; } -.catalog-product-view #buy-now -{ - margin-bottom: 15px; - width: 49%; - line-height: 2.2rem; - padding: 14px 17px; - font-size: 1.8rem; -} - -.button.buynow { - width: 100%; - margin-bottom: 10%; -} - -.catalog-category-view .product.actions.product-item-actions { - margin: 0px; -} - @media(max-width: 767px){ - .catalog-product-view #buy-now{ - width: 100%; + .catalog-category-view button.buynow{ + margin-top: 5px; + margin-left: 0px; } } \ No newline at end of file diff --git a/view/frontend/web/js/buy-now.js b/view/frontend/web/js/buy-now.js index c0dfd7f..6bca35d 100755 --- a/view/frontend/web/js/buy-now.js +++ b/view/frontend/web/js/buy-now.js @@ -10,21 +10,8 @@ define([ buyNowCartUrl = 'buynow/cart/add', buyNowUrl = baseUrl.replace(addToCartUrl, buyNowCartUrl); form.attr('action', buyNowUrl); - if(form.valid()) { - $.ajax({ - type: form.attr('method'), - url: form.attr('action'), - data: form.serialize(), - success: function (data) { - form.attr('action', baseUrl); - if (data.hasOwnProperty('backUrl')) { - window.location.href = data.backUrl; - } else { - window.location.reload(true); - } - } - }); - } + form.trigger('submit'); + form.attr('action', baseUrl); return false; }); }