Automattic\WooCommerce\Blocks\BlockTypes

SavedForLater::render_ssr_quantity │ private │ WC 1.0

SSR-mode markup for the quantity span. SFL-specific.

Method of the class: SavedForLater{}

No Hooks.

Returns

string.

Usage

// private - for code of main (parent) class only
$result = $this->render_ssr_quantity( $item ): string;
$item(array<string, mixed>) (required)
Schema-shape item.

SavedForLater::render_ssr_quantity() code WC 11.1.2

private function render_ssr_quantity( array $item ): string {
	$quantity       = (int) ( $item['quantity'] ?? 1 );
	$quantity_label = sprintf( $this->get_quantity_label_template(), $quantity );
	return sprintf(
		'<span class="%s__quantity">%s</span>',
		esc_attr( ShopperListRenderer::ROW_CLASS ),
		esc_html( $quantity_label )
	);
}