Automattic\WooCommerce\Internal\ShopperLists

ShopperListRenderer::render_template_common_rowpublic staticWC 1.0

Render the image + title + price triplet for the template-mode row (no static attrs; bindings only). Identical between consumer blocks.

Method of the class: ShopperListRenderer{}

No Hooks.

Returns

String.

Usage

$result = ShopperListRenderer::render_template_common_row(): string;

ShopperListRenderer::render_template_common_row() code WC 10.9.4

<?php
public static function render_template_common_row(): string {
	ob_start();
	?>
	<div class="wc-block-components-product-image wc-block-components-product-image--aspect-ratio-auto">
		<a data-wp-bind--href="context.listItem.permalink">
			<span class="<?php echo esc_attr( self::ROW_CLASS ); ?>__image-slot" data-wp-context='{"htmlField":"image_html"}' data-wp-watch="callbacks.updateInnerHtml"></span>
		</a>
		<button
			type="button"
			class="<?php echo esc_attr( self::ROW_CLASS ); ?>__remove"
			data-wp-on--click="actions.onClickRemove"
			data-wp-bind--aria-label="state.currentItemRemoveLabel"
			data-wp-bind--disabled="state.isCurrentItemPending"
		>
			<?php echo self::get_remove_icon_svg(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static SVG markup. ?>
		</button>
		<span class="<?php echo esc_attr( self::ROW_CLASS ); ?>__variation" data-wp-bind--hidden="!state.currentItemVariationLabel" data-wp-text="state.currentItemVariationLabel"></span>
	</div>
	<h2 class="wp-block-post-title has-text-align-center has-medium-font-size">
		<a data-wp-bind--href="context.listItem.permalink" data-wp-text="state.currentItemDisplayName"></a>
	</h2>
	<div class="price wc-block-components-product-price has-text-align-center has-small-font-size" data-wp-bind--hidden="state.isPriceHidden" data-wp-context='{"htmlField":"price_html"}' data-wp-watch="callbacks.updateInnerHtml"></div>
	<?php
	return (string) ob_get_clean();
}