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

if ($context == 'admin') { if ($context == 'admin') {
$url .= '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

$idProductFamily = $data['order_products']['id_product_family']; $idProductFamily = $data['order_products']['id_product_family'];
$this->productFamily = $this->getProductFamilyContainer()->getStore()->getOneById($idProductFamily); $this->productFamily = $this->getProductFamilyContainer()->getStore()->getOneById($idProductFamily);


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

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


if ($this->productFamily) { if ($this->productFamily) {
$this->addOrderProduct($orderShop, $orderProduct); $this->addOrderProduct($orderShop, $orderProduct);
} }
} }

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

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

private function _getProductFamily($request) private function _getProductFamily($request)
{ {
$idProductFamily = $request->request->get('idProductFamily'); $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; return $productFamily;
} else { } else {
throw new \ErrorException('Ce produit est introuvable'); throw new \ErrorException('Ce produit est introuvable');

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

array( array(
'required' => false, 'required' => false,
'attr' => array( 'attr' => array(
'class' => ' input-sm',
'class' => ' input-sm autocomplete-disabled',
'form' => 'filters-form', 'form' => 'filters-form',
), ),
) )

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

array( array(
'required' => false, 'required' => false,
'attr' => array( 'attr' => array(
'class' => ' input-sm',
'class' => ' input-sm autocomplete-disabled',
'form' => 'filters-form', 'form' => 'filters-form',
), ),
) )

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

array( array(
'required' => false, 'required' => false,
'attr' => array( 'attr' => array(
'class' => ' input-sm',
'class' => ' input-sm autocomplete-disabled',
'form' => 'filters-form', 'form' => 'filters-form',
), ),
) )

Loading…
Cancel
Save