Ver código fonte

Merge branch 'develop'

master
Guillaume Bourgeois 2 anos atrás
pai
commit
d6f7f47bd6
6 arquivos alterados com 23 adições e 13 exclusões
  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 Ver arquivo

@@ -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 Ver arquivo

@@ -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 Ver arquivo

@@ -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 Ver arquivo

@@ -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 Ver arquivo

@@ -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 Ver arquivo

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

Carregando…
Cancelar
Salvar