← All changes
|
includes/Admin/Product/Data/Handlers/SimpleProductHandler.php
+8
-1
1.10.9
→
1.10.27
View file →
| @@ -43,11 +43,18 @@ | ||
| 43 | 43 | $name = $prefix ? "{$prefix} {$baseName}" : $baseName; |
| 44 | 44 | $name = $suffix ? "{$name} {$suffix}" : $name; |
| 45 | 45 | |
| 46 | 46 | $attributeSuffix = $this->attributeService->getAttributeSuffix($product); |
| 47 | - if ($attributeSuffix) $name .= " ({$attributeSuffix})"; | |
| 47 | + if ($attributeSuffix !== null && $attributeSuffix !== '') $name .= " ({$attributeSuffix})"; | |
| 48 | 48 | |
| 49 | 49 | return mb_substr($name, 0, 120); |
| 50 | + } | |
| 51 | + | |
| 52 | + public function getSku($product): ?string | |
| 53 | + { | |
| 54 | + $sku = trim((string) $product->get_sku()); | |
| 55 | + | |
| 56 | + return $sku !== '' ? $sku : null; | |
| 50 | 57 | } |
| 51 | 58 | |
| 52 | 59 | public function getDescription($product): string |
| 53 | 60 | { |