PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.0
1.7.0 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 All 50 releases
← All changes | app/Services/Renderer/CartItemRenderer.php +7 -5 1.4.2 → 1.7.0 View file →
@@ -4,9 +4,8 @@
4 4
5 5 use FluentCart\App\Helpers\Helper;
6 6 use FluentCart\App\Models\Cart;
7 7 use FluentCart\Framework\Support\Arr;
8 -use FluentCart\App\Vite;
9 8
10 9 class CartItemRenderer
11 10 {
12 11 protected $item = [];
@@ -106,10 +105,14 @@
106 105 {
107 106 $href = Arr::get($this->item, 'view_url', '');
108 107
109 108 $mainTitle = (string) Arr::get($this->item, 'post_title', '');
110 - $subtitle = (string) Arr::get($this->item, 'title', '');
111 109
110 + // The Cart model already resolves & appends variation_display_title on
111 + // every cart item (Cart::getCartDataAttribute); fall back to the raw
112 + // variation title for items it didn't decorate.
113 + $subtitle = (string) Arr::get($this->item, 'variation_display_title', (string) Arr::get($this->item, 'title', ''));
114 +
112 115 $quantity = Arr::get($this->item, 'quantity', 1);
113 116
114 117 ?>
115 118 <div class="fct_item_title">
@@ -149,11 +152,10 @@
149 152
150 153 public function renderImage()
151 154 {
152 155 $image = Arr::get($this->item, 'featured_media');
153 - if (!$image) {
154 - $image = Vite::getAssetUrl('images/placeholder.svg');
155 - }
156 + // Also maps the old generic icon a pre-existing cart row may still store.
157 + $image = Helper::productImageOrPlaceholder($image);
156 158 $href = Arr::get($this->item, 'view_url', '');
157 159 $altText = sprintf(
158 160 /* translators: %s: product title */
159 161 __('Image of %s', 'fluent-cart'), Arr::get($this->item, 'title', __('product', 'fluent-cart')));