← All changes
|
includes/Admin/Product/Data/ProductDataBuilder.php
+2
-1
1.9.1
→
1.10.21
View file →
| @@ -33,9 +33,9 @@ | ||
| 33 | 33 | public function fromWooProduct(int $productId): self |
| 34 | 34 | { |
| 35 | 35 | $product = wc_get_product($productId); |
| 36 | 36 | |
| 37 | - if (!$product) throw new \InvalidArgumentException("Product with ID {$productId} not found"); | |
| 37 | + if (!$product) throw new \InvalidArgumentException(esc_html("Product with ID {$productId} not found")); | |
| 38 | 38 | |
| 39 | 39 | // Validate product first |
| 40 | 40 | if ($this->validator) $this->validator->validate($product); |
| 41 | 41 | |
| @@ -68,8 +68,9 @@ | ||
| 68 | 68 | private function initializeData(): void |
| 69 | 69 | { |
| 70 | 70 | $this->data = [ |
| 71 | 71 | 'name' => '', |
| 72 | + 'sku' => null, | |
| 72 | 73 | 'description' => '', |
| 73 | 74 | 'category_id' => null, |
| 74 | 75 | 'category_ids' => [], |
| 75 | 76 | 'primary_price' => null, |