← All changes
|
app/Hooks/Handlers/ShortCodes/PricingTableShortCode.php
+2
-8
1.3.21
→
1.6.5
View file →
| @@ -67,15 +67,11 @@ | ||
| 67 | 67 | return $productVariation; |
| 68 | 68 | }); |
| 69 | 69 | |
| 70 | 70 | $activeVariants = []; |
| 71 | - $getActiveVariants = explode(',', Arr::get($shortcodeAttributes, 'active_variant')); | |
| 71 | + $activeVariantItems = array_filter(explode(',', Arr::get($shortcodeAttributes, 'active_variant', ''))); | |
| 72 | 72 | |
| 73 | - foreach ($getActiveVariants as $item) { | |
| 74 | - if (empty($item)) { | |
| 75 | - continue; | |
| 76 | - } | |
| 77 | - // Check if the item contains an '=' sign using Str::contains() | |
| 73 | + foreach ($activeVariantItems as $item) { | |
| 78 | 74 | if (Str::contains($item, '=')) { |
| 79 | 75 | list($key, $value) = explode('=', $item); |
| 80 | 76 | $activeVariants[trim($key)] = trim($value); |
| 81 | 77 | } |
| @@ -101,11 +97,9 @@ | ||
| 101 | 97 | |
| 102 | 98 | public function render(?array $viewData = null) |
| 103 | 99 | { |
| 104 | 100 | AssetLoader::markFrontendAssetsRequired(); |
| 105 | - ob_start(); | |
| 106 | 101 | (new PricingTableRenderer($viewData))->render(); |
| 107 | - return ob_get_clean(); | |
| 108 | 102 | } |
| 109 | 103 | |
| 110 | 104 | public function localizeData(): array |
| 111 | 105 | { |