Astra_Woocommerce::get_sale_flash_markup( string $sale_notification, string $product )
Astra Sale flash markup.
Description
Parameters
- $sale_notification
-
(string) (Required) sale bubble type.
- $product
-
(string) (Required) Product.
Return
(mixed) HTML markup.
Source
File: inc/compatibility/woocommerce/class-astra-woocommerce.php
public function get_sale_flash_markup( $sale_notification, $product ) {
$text = __( 'Sale!', 'astra' ); // Default text.
// CSS classes.
$classes = array();
/** @psalm-suppress UndefinedFunction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$classes[] = ( astra_is_shop_page_modern_style() ) ? 'ast-on-card-button ast-onsale-card' : 'onsale';
/** @psalm-suppress UndefinedFunction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$classes = implode( ' ', $classes );
// Generate markup.
return '<span ' . astra_attr(
'woo-sale-badge-container',
array(
'class' => $classes,
'data-sale' => array(),
'data-notification' => 'default',
)
) . '>' . esc_html( $text ) . '</span>';
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 3.9.2 | Introduced. |