Skip to content

Commit

Permalink
Merge 69aa00f into 65c51a5
Browse files Browse the repository at this point in the history
  • Loading branch information
roadster31 committed Feb 2, 2016
2 parents 65c51a5 + 69aa00f commit ed3eb3c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/lib/Thelia/Action/Product.php
Expand Up @@ -117,8 +117,14 @@ public function cloneProduct(ProductCloneEvent $event)
$originalProduct = $event->getOriginalProduct();
$dispatcher = $event->getDispatcher();

$originalProductDefaultI18n = ProductI18nQuery::create()
->findPk([$originalProduct->getId(), $lang]);
if (null === $originalProductDefaultI18n = ProductI18nQuery::create()
->findPk([$originalProduct->getId(), $lang])) {
// No i18n entry for the current language. Try to find one for creating the product.
// It will be updated later by updateClone()
$originalProductDefaultI18n = ProductI18nQuery::create()
->findOneById($originalProduct->getId())
;
}

$originalProductDefaultPrice = ProductPriceQuery::create()
->findOneByProductSaleElementsId($originalProduct->getDefaultSaleElements()->getId());
Expand Down

0 comments on commit ed3eb3c

Please sign in to comment.