Browse Source

Merge branch 'feature/productUpdate' of https://gitea.laclic.fr/Laclic/LcShopBundle into feature/productUpdate

feature/export_comptable
Guillaume 4 years ago
parent
commit
f78a71dfe9
2 changed files with 5 additions and 19 deletions
  1. +3
    -17
      ShopBundle/Controller/Backend/ProductFamilyController.php
  2. +2
    -2
      ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js

+ 3
- 17
ShopBundle/Controller/Backend/ProductFamilyController.php View File

@@ -272,12 +272,6 @@ class ProductFamilyController extends AdminController
$entity->addProduct($newProduct);
}
}else {
dump('blop');
foreach ($entity->getProducts() as $product) {

dump($product);

}
//Récupère le product origin
$originProducts = $this->em->getRepository(ProductInterface::class)->findBy(array(
'productFamily' => $entity->getId(),
@@ -301,26 +295,20 @@ class ProductFamilyController extends AdminController
if ($entity->getActiveProducts()) {
$originProduct->setStatus(-1);
} else {
foreach ($entity->getProducts() as $product) {
/*foreach ($entity->getProducts() as $product) {
$product->setStatus(0);
}
}*/
$originProduct->setStatus(1);
}

//Enregistrement
$originProduct->setProductFamily($entity);
$this->em->persist($originProduct);
$entity->addProduct($originProduct);

foreach ($entity->getProducts() as $product) {
$product->setProductFamily($entity);
$this->em->persist($product);
$entity->addProduct($product);
dump($product);

}
//die();

}
}

@@ -353,9 +341,7 @@ class ProductFamilyController extends AdminController
$id = $this->request->query->get('id');
$easyadmin = $this->request->attributes->get('easyadmin');
$entity = $easyadmin['item'];
foreach ($entity->getProducts() as $product){
dump($product);
}

if ($this->request->isXmlHttpRequest() && $property = $this->request->query->get('property')) {
$newValue = 'true' === mb_strtolower($this->request->query->get('newValue'));
$fieldsMetadata = $this->entity['list']['fields'];

+ 2
- 2
ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js View File

@@ -269,10 +269,10 @@ $(window).on('load', function () {
deleteProductForm: function () {
if (confirm('Êtes-vous sur de cette action ?')) {
this.status = -1;
/*Vue.delete(this.$parent.formProducts, this.keyForm);
//Vue.delete(this.$parent.formProducts, this.keyForm);
this.$nextTick(function () {
this.$parent.updateSortableProducts(true);
});*/
});
}

},

Loading…
Cancel
Save