mageprince/module-buynow

Magento2 Buy Now Module

Installs: 4 154

Dependents: 0

Suggesters: 0

Security: 0

Stars: 65

Watchers: 6

Forks: 32

Open Issues: 6

Type:magento2-module

1.3.0 2020-03-22 10:29 UTC

This package is auto-updated.

Last update: 2024-04-23 20:35:16 UTC


README

This module add "BuyNow" button on product view page and list page to process directly checkout.

BuyNow Configuration: Stores->Configuration->MagePrince->Buy Now

Notice

We don't support Buy Now button on related, upsell, wishlist or any other places because it needs override core phtml files which is not the recommended solution. Please keep in note that most of the paid or free version of the Buy Now module overrides the core phtml files.

Copy below code to add Buy Now button in custom product sliders, widget, static blocks etc.

$buyNowHtml = $this->getLayout()
    ->createBlock('Mageprince\BuyNow\Block\Product\ListProduct')
    ->setProduct($_item)
    ->setTemplate('Mageprince_BuyNow::buynow-list.phtml')
    ->toHtml();
echo $buyNowHtml;

Change $_item to current product object.

You can use above code where you want to show buy now button in product. Please make sure don't copy this code to addtocart or any other form. Put this code after any </form>. Here is the screenshot of sample code of usage

93671613-00aa9480-fac2-11ea-833b-5bd2c1d2a2fb.png

Installation Instruction

  • Copy the content of the repo to the app/code/Mageprince/BuyNow folder
  • Run command: php bin/magento setup:upgrade
  • Run Command: php bin/magento setup:static-content:deploy
  • Now Flush Cache: php bin/magento cache:flush

Contribution

Want to contribute to this extension? The quickest way is to open a pull request on GitHub.

Support

If you encounter any problems or bugs, please open an issue on GitHub.

PRODUCT VIEW PAGE

View Page

PRODUCT LIST PAGE

list page

How To Find Addtocart Form Id - Useful For Custom Theme

Go to product view page and right click on addtocart button and click on inspect element. Then scroll up and find addtocart form id.

Form ID