Automattic\WooCommerce\Blocks\BlockTypes
AbstractProductGrid::get_button_html
Get the button.
Method of the class: AbstractProductGrid{}
No Hooks.
Returns
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() AbstractProductGrid::get button html code WC 10.7.0
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>';
}