Browse Source

Merge branch 'develop'

master
Guillaume Bourgeois 2 years ago
parent
commit
d6f7f47bd6
6 changed files with 23 additions and 13 deletions
  1. +8
    -7
      Controller/Merchant/SwitchMerchantController.php
  2. +7
    -1
      Controller/Order/CartController.php
  3. +5
    -2
      Controller/Product/FavoriteController.php
  4. +1
    -1
      Field/Filter/User/UserMerchantEmailFilter.php
  5. +1
    -1
      Field/Filter/User/UserMerchantFirstnameFilter.php
  6. +1
    -1
      Field/Filter/User/UserMerchantLastnameFilter.php

+ 8
- 7
Controller/Merchant/SwitchMerchantController.php View File

@@ -37,19 +37,20 @@ class SwitchMerchantController extends AbstractController
if ($context == 'admin') {
$url .= 'admin';
}
}

if(!$url) {
$url = $request->headers->get('referer');
}

if($url) {
return $this->redirect($url);
}
}

if ($url) {
return $this->redirect($url);
} else {
$this->addFlashTranslator('error', ActionDefinition::SWITCH_MERCHANT, 'Merchant');
return $this->redirect($request->headers->get('referer'));
}


$this->addFlashTranslator('error', ActionDefinition::SWITCH_MERCHANT, 'Merchant');
return $this->redirectToRoute('frontend_home');
}

}

+ 7
- 1
Controller/Order/CartController.php View File

@@ -33,6 +33,10 @@ class CartController extends AbstractController
$idProductFamily = $data['order_products']['id_product_family'];
$this->productFamily = $this->getProductFamilyContainer()->getStore()->getOneById($idProductFamily);

if(!$this->productFamily) {
$return['return'] = 'error';
}

// alerte si cookies non acceptés
if (!$user && !$visitor) {
$this->addFlash(
@@ -44,7 +48,7 @@ class CartController extends AbstractController
'fos_user_security_login'
) . '">connecter</a> pour ajouter un produit.'
);
return false;
$return['return'] = 'error';
}

if ($this->productFamily) {
@@ -68,6 +72,8 @@ class CartController extends AbstractController
$this->addOrderProduct($orderShop, $orderProduct);
}
}

$return['return'] = 'success';
}
}
}

+ 5
- 2
Controller/Product/FavoriteController.php View File

@@ -90,9 +90,12 @@ class FavoriteController extends AbstractController
private function _getProductFamily($request)
{
$idProductFamily = $request->request->get('idProductFamily');
$productFamily = $this->getProductFamilyContainer()->getStore()->getOneById($idProductFamily);

if ($productFamily) {
if($idProductFamily) {
$productFamily = $this->getProductFamilyContainer()->getStore()->getOneById($idProductFamily);
}

if (isset($productFamily) && $productFamily) {
return $productFamily;
} else {
throw new \ErrorException('Ce produit est introuvable');

+ 1
- 1
Field/Filter/User/UserMerchantEmailFilter.php View File

@@ -21,7 +21,7 @@ class UserMerchantEmailFilter extends AssociationFilter
array(
'required' => false,
'attr' => array(
'class' => ' input-sm',
'class' => ' input-sm autocomplete-disabled',
'form' => 'filters-form',
),
)

+ 1
- 1
Field/Filter/User/UserMerchantFirstnameFilter.php View File

@@ -21,7 +21,7 @@ class UserMerchantFirstnameFilter extends AssociationFilter
array(
'required' => false,
'attr' => array(
'class' => ' input-sm',
'class' => ' input-sm autocomplete-disabled',
'form' => 'filters-form',
),
)

+ 1
- 1
Field/Filter/User/UserMerchantLastnameFilter.php View File

@@ -24,7 +24,7 @@ class UserMerchantLastnameFilter
array(
'required' => false,
'attr' => array(
'class' => ' input-sm',
'class' => ' input-sm autocomplete-disabled',
'form' => 'filters-form',
),
)

Loading…
Cancel
Save