Automattic\WooCommerce\Blocks\BlockTypes

AbstractProductGrid::get_button_html()protectedWC 1.0

Get the button.

Method of the class: AbstractProductGrid{}

No Hooks.

Return

String. Rendered product output.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_button_html( $product );
$product(\WC_Product) (required)
Product.

AbstractProductGrid::get_button_html() code WC 9.4.2

protected function get_button_html( $product ) {
	if ( empty( $this->attributes['contentVisibility']['button'] ) ) {
		return '';
	}
	return '<div class="wp-block-button wc-block-grid__product-add-to-cart">' . $this->get_add_to_cart( $product ) . '</div>';
}