PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.6
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.6
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 1.3.19 All 49 releases
← All changes | app/Hooks/Handlers/BlockEditors/ProductCardBlockEditor.php +6 -12 1.3.21 → 1.6.6 View file →
@@ -70,20 +70,14 @@
70 70 if (!$product) {
71 71 return '';
72 72 }
73 73
74 - $selectedProductId = 'product_id=' . $product->ID;
75 -
76 - $selectedVariantId = '';
77 - if ($variationId = Arr::get($shortCodeAttribute, 'variant_id', false)) {
78 - $selectedVariantId = 'variant_id=' . $variationId;
79 - }
80 -
81 - $priceFormat = Arr::get($shortCodeAttribute, 'price_format', 'starts_from');
82 - $cardWidth = Arr::get($shortCodeAttribute, 'card_width', 216);
83 -
84 - $shortcodeName = ProductCardShortCode::getShortCodeName();
85 - return "[$shortcodeName $selectedVariantId $selectedProductId price_format=$priceFormat card_width=$cardWidth]";
74 + return ProductCardShortCode::make([
75 + 'product_id' => $product->ID,
76 + 'variant_id' => Arr::get($shortCodeAttribute, 'variant_id', ''),
77 + 'price_format' => Arr::get($shortCodeAttribute, 'price_format', 'starts_from'),
78 + 'card_width' => Arr::get($shortCodeAttribute, 'card_width', 216),
79 + ])->renderShortcode($block);
86 80 }
87 81
88 82
89 83