Automattic\WooCommerce\Blocks\BlockTypes
AddToCartForm::enqueue_assets
Enqueue assets specific to this block. We enqueue frontend scripts only if the quantitySelectorStyle is set to 'stepper'.
Method of the class: AddToCartForm{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->enqueue_assets( $attributes, $content, $block );
- $attributes(array) (required)
- Block attributes.
- $content(string) (required)
- Block content.
- $block(WP_Block) (required)
- Block instance.
AddToCartForm::enqueue_assets() AddToCartForm::enqueue assets code WC 10.5.0
protected function enqueue_assets( $attributes, $content, $block ) {
$parsed_attributes = $this->parse_attributes( $attributes );
if ( 'stepper' !== $parsed_attributes['quantitySelectorStyle'] ) {
return;
}
parent::enqueue_assets( $attributes, $content, $block );
}