Ejemplo n.º 1
0
 private function checkChangeAsNotVariationProduct(\Ess\M2ePro\Model\Listing\Product $listingProduct)
 {
     /** @var \Ess\M2ePro\Model\Amazon\Listing\Product\Variation\Manager $variationManager */
     $variationManager = $listingProduct->getChildObject()->getVariationManager();
     $isVariationMagentoProduct = $listingProduct->getMagentoProduct()->isProductWithVariations();
     if ($isVariationMagentoProduct || !$variationManager->isVariationProduct()) {
         return false;
     }
     $variationManager->getTypeModel()->clearTypeData();
     if ($variationManager->isRelationParentType()) {
         $listingProduct->setData('general_id', NULL);
         $listingProduct->setData('is_general_id_owner', \Ess\M2ePro\Model\Amazon\Listing\Product::IS_GENERAL_ID_OWNER_NO);
         $listingProduct->setData('status', \Ess\M2ePro\Model\Listing\Product::STATUS_NOT_LISTED);
         $listingProduct->delete();
     } else {
         $variationManager->setSimpleType();
     }
     return true;
 }