Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 2.42 KB

File metadata and controls

54 lines (35 loc) · 2.42 KB

Buy Button

Description

BuyButton is a VTEX Component that is resposible to handle events of adding products in the minicart. This Component can be imported and used by any VTEX App.

📢 Disclaimer: Don't fork this project, use, contribute, or open issue with your feature request.

Table of Contents

Usage

You should follow the usage instruction in the main README.

Then, add buy-button block into your app theme, as we do in our Product Details app.

Blocks API

When implementing this component as a block, various inner blocks may be available. The following interface lists the available blocks within BuyButton and describes if they are required or optional.

  "buy-button": {
    "component": "BuyButton"
  }

For now this block does not have any required or optional blocks.

Configuration

Through the Storefront, you can change the BuyButton's behavior and interface. However, you also can make in your theme app, as Store theme does.

Prop name Type Description Default value
isOneClickBuy Boolean Should redirect to the checkout page or not false
shouldOpenMinicart Boolean Should open the Minicart after clicking the button false
large Boolean Sets button to large style, filling whole width (like a block) -
available Boolean If component is available or not true
showToast Boolean If toast with feedback should be shown after add item request is processed -
showItemsPrice Boolean If you want to show the total price of items to be added to cart false

Styles API

You should follow the Styles API instruction in the main README.

CSS Namespaces

🚧 🚧 🚧