... |
... |
@@ -175,16 +175,19 @@ class ShopwareImportProductsJob extends AbstractController
|
175 |
175 |
|
176 |
176 |
// Properties handling
|
177 |
177 |
$arrProperties = [];
|
|
178 |
+ $arrPropertyGroups = [];
|
178 |
179 |
|
179 |
180 |
if (
|
180 |
181 |
($propertyVal = $Product->getLage())
|
181 |
|
- && ($propertyGroupId = $this->mappings->getPropertyGroupIdByName('Einzellage')) !== null)
|
|
182 |
+ && ($propertyGroupId = $this->mappings->getPropertyGroupIdByName('Einzellage')) !== null
|
|
183 |
+ && ($propertyId = $this->mappings->getPropertyIdByNameAndGroup($propertyVal,$propertyGroupId, true)) !== null)
|
182 |
184 |
{
|
183 |
185 |
$arrProperties[] = [
|
184 |
|
- 'id' => $this->mappings->getPropertyIdByNameAndGroup($propertyVal,$propertyGroupId, true),
|
|
186 |
+ 'id' => $propertyId,
|
185 |
187 |
'groupId' => $propertyGroupId,
|
186 |
188 |
'name' => $propertyVal
|
187 |
189 |
];
|
|
190 |
+ $arrPropertyGroups[] = $propertyGroupId;
|
188 |
191 |
}
|
189 |
192 |
|
190 |
193 |
if (
|
... |
... |
@@ -197,54 +200,64 @@ class ShopwareImportProductsJob extends AbstractController
|
197 |
200 |
'groupId' => $propertyGroupId,
|
198 |
201 |
'name' => $propertyVal
|
199 |
202 |
];
|
|
203 |
+ $arrPropertyGroups[] = $propertyGroupId;
|
200 |
204 |
}
|
201 |
205 |
|
202 |
206 |
if (
|
203 |
207 |
($propertyVal = $Product->getFarbe())
|
204 |
|
- && ($propertyGroupId = $this->mappings->getPropertyGroupIdByName('Farbe')) !== null)
|
|
208 |
+ && ($propertyGroupId = $this->mappings->getPropertyGroupIdByName('Farbe')) !== null
|
|
209 |
+ && ($propertyId = $this->mappings->getPropertyIdByNameAndGroup($propertyVal,$propertyGroupId, true)) !== null)
|
205 |
210 |
{
|
206 |
211 |
$arrProperties[] = [
|
207 |
|
- 'id' => $this->mappings->getPropertyIdByNameAndGroup($propertyVal,$propertyGroupId, true),
|
|
212 |
+ 'id' => $propertyId,
|
208 |
213 |
'groupId' => $propertyGroupId,
|
209 |
214 |
'name' => $propertyVal
|
210 |
215 |
];
|
|
216 |
+ $arrPropertyGroups[] = $propertyGroupId;
|
211 |
217 |
}
|
212 |
218 |
|
213 |
219 |
if (
|
214 |
220 |
($propertyVal = $Product->getGeschmack())
|
215 |
|
- && ($propertyGroupId = $this->mappings->getPropertyGroupIdByName('Geschmack')) !== null)
|
|
221 |
+ && ($propertyGroupId = $this->mappings->getPropertyGroupIdByName('Geschmack')) !== null
|
|
222 |
+ && ($propertyId = $this->mappings->getPropertyIdByNameAndGroup($propertyVal,$propertyGroupId, true)) !== null)
|
216 |
223 |
{
|
217 |
224 |
$arrProperties[] = [
|
218 |
|
- 'id' => $this->mappings->getPropertyIdByNameAndGroup($propertyVal,$propertyGroupId, true),
|
|
225 |
+ 'id' => $propertyId,
|
219 |
226 |
'groupId' => $propertyGroupId,
|
220 |
227 |
'name' => $propertyVal
|
221 |
228 |
];
|
|
229 |
+ $arrPropertyGroups[] = $propertyGroupId;
|
222 |
230 |
}
|
223 |
231 |
|
224 |
232 |
if (
|
225 |
233 |
($propertyVal = $Product->getRebsorte())
|
226 |
|
- && ($propertyGroupId = $this->mappings->getPropertyGroupIdByName('Rebsorte')) !== null)
|
|
234 |
+ && ($propertyGroupId = $this->mappings->getPropertyGroupIdByName('Rebsorte')) !== null
|
|
235 |
+ && ($propertyId = $this->mappings->getPropertyIdByNameAndGroup($propertyVal,$propertyGroupId, true)) !== null)
|
227 |
236 |
{
|
228 |
237 |
$arrProperties[] = [
|
229 |
|
- 'id' => $this->mappings->getPropertyIdByNameAndGroup($propertyVal,$propertyGroupId, true),
|
|
238 |
+ 'id' => $propertyId,
|
230 |
239 |
'groupId' => $propertyGroupId,
|
231 |
240 |
'name' => $propertyVal
|
232 |
241 |
];
|
|
242 |
+ $arrPropertyGroups[] = $propertyGroupId;
|
233 |
243 |
}
|
234 |
244 |
|
235 |
245 |
if (
|
236 |
246 |
($propertyVal = $Product->getWeinlinie())
|
237 |
|
- && ($propertyGroupId = $this->mappings->getPropertyGroupIdByName('Weinlinie')) !== null)
|
|
247 |
+ && ($propertyGroupId = $this->mappings->getPropertyGroupIdByName('Weinlinie')) !== null
|
|
248 |
+ && ($propertyId = $this->mappings->getPropertyIdByNameAndGroup($propertyVal,$propertyGroupId, true)) !== null)
|
238 |
249 |
{
|
239 |
250 |
$arrProperties[] = [
|
240 |
|
- 'id' => $this->mappings->getPropertyIdByNameAndGroup($propertyVal,$propertyGroupId, true),
|
|
251 |
+ 'id' => $propertyId,
|
241 |
252 |
'groupId' => $propertyGroupId,
|
242 |
253 |
'name' => $propertyVal
|
243 |
254 |
];
|
|
255 |
+ $arrPropertyGroups[] = $propertyGroupId;
|
244 |
256 |
}
|
245 |
257 |
|
246 |
258 |
if (count($arrProperties))
|
247 |
259 |
{
|
|
260 |
+ $this->shopware->truncatePropertiesForProductBySku($Product->getSku(),$arrPropertyGroups);
|
248 |
261 |
$arrData['properties'] = $arrProperties;
|
249 |
262 |
}
|
250 |
263 |
|