Skip to content

Commit

Permalink
Disable button after click
Browse files Browse the repository at this point in the history
  • Loading branch information
mageprince committed May 9, 2024
1 parent 017213b commit 0176ba9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Keep other item(s) in the cart on buy now.</comment>
</field>
<field id="custom_buynow_button_code" type="textarea" translate="label" sortOrder="80" showInDefault="1" showInWebsite="1">
<field id="custom_buynow_button_code" type="textarea" translate="label" sortOrder="70" showInDefault="1" showInWebsite="1">
<frontend_model>Mageprince\BuyNow\Block\Adminhtml\System\Config\Field\Disable</frontend_model>
<label>Custom Buy Now Button Code</label>
<comment><![CDATA[Paste this code into your custom product listing template file wherever you want to display the "Buy Now" button. Replace <b>$_item</b> with the current product object. This code creates a new form for the buy now button, so ensure that you do not insert this code into any other form.]]></comment>
Expand Down
1 change: 1 addition & 0 deletions view/frontend/web/js/buy-now-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ define([

return function (config, element) {
$(element).click(function () {
$(this).attr('disabled', true);
var form = $(element.form),
baseUrl = form.attr('action'),
buyNowUrl = buyNowModel.replaceBuyNowUrl(baseUrl);
Expand Down

0 comments on commit 0176ba9

Please sign in to comment.