target_widget_settings = $settings; $this->target_widget_name = $widget_name; } /** * Render a single product item specifically for the Florence Grid widget * * @param WC_Product $product The product object to render * @param array $settings The widget settings */ public function render_florence_grid_item($product, $settings) { if (!$product) { return; } $product_id = $product->get_id(); $rating_count = $product->get_rating_count(); $average = $product->get_average_rating(); // Get product categories $categories = wc_get_product_category_list($product_id, ' '); $category_tags = isset($settings['category_tags']) ? $settings['category_tags'] : 'h5'; $title_tags = isset($settings['title_tags']) ? $settings['title_tags'] : 'h3'; // get the class based on the widget name $show_rating = isset($settings['show_rating']) ? $settings['show_rating'] : true; $classes = $this->target_widget_name === 'florence-grid' ? 'usk-item' : 'usk-item swiper-slide'; $classes .= $show_rating ? ' usk-have-rating' : ''; ?>