Log in
Interface

ButtonInterface

Magento\Catalog\Api\Data\ProductRender\ButtonInterface

What it does

This interface defines the contract for product action buttons in Magento 2, such as 'Add to Cart', 'Add to Compare', or 'Add to Wishlist'.

Developers use this interface when rendering product buttons that require backend interaction, allowing them to set the button's URL, POST data for form submission, and whether the product has required options that must be selected before the action can be completed.

Public Methods

  • setPostData()
  • getPostData()
  • setUrl()
  • getUrl()
  • setRequiredOptions()
  • hasRequiredOptions()
  • getExtensionAttributes()
  • setExtensionAttributes()