@@ -9,6 +9,7 @@ use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | |||
use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyTrait; | |||
use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait; | |||
use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface; | |||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | |||
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | |||
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | |||
use Lc\CaracoleBundle\Model\Product\ProductFamilyModel; | |||
@@ -113,13 +114,12 @@ abstract class ReductionCatalogModel extends AbstractLightEntity implements Redu | |||
return $this; | |||
} | |||
public function getProductFamily(): ?ProductFamilyModel | |||
public function getProductFamily(): ?ProductFamilyInterface | |||
{ | |||
return $this->productFamily; | |||
} | |||
public function setProductFamily(?ProductFamilyModel $productFamily): self | |||
public function setProductFamily(?ProductFamilyInterface $productFamily): self | |||
{ | |||
$this->productFamily = $productFamily; | |||
@@ -4,7 +4,7 @@ $(document).ready(function() { | |||
}) ; | |||
function initSwitchMerchant() { | |||
let $form = $('form.switch-merchant') ; | |||
let $form = $('.nav-switch-merchant form.switch-merchant') ; | |||
$form.find('select').change(function() { | |||
$form.submit() ; | |||
}) ; |
@@ -18,9 +18,14 @@ | |||
{% set form_switch_merchant = carac_form_switch_merchant('admin', 'carac_merchant_favorite') %} | |||
{% form_theme form_switch_merchant '@LcSov/adminlte/crud/form_theme.html.twig' %} | |||
{{ form_start(form_switch_merchant) }} | |||
{{ form(form_switch_merchant) }} | |||
<div class="hidden"> | |||
{{ form_widget(form_switch_merchant.merchant, {attr:{'class': 'disable-select2'}}) }} | |||
</div> | |||
{{ form_rest(form_switch_merchant) }} | |||
{{ form_end(form_switch_merchant) }} | |||
<button id="carac-button-visit-merchant" type="button" class="btn btn-default" | |||
data-dismiss="modal">Visiter</button> | |||
data-dismiss="modal">Visiter | |||
</button> | |||
{% endblock %} | |||
{% endembed %} |
@@ -45,6 +45,8 @@ | |||
{% set user = app.user %} | |||
{% set merchant_current = merchant_current() %} | |||
{{ dump( merchant_current)}} | |||
{{ dump( user.favoriteMerchant )}} | |||
{% if(user.favoriteMerchant != merchant_current) %} | |||
{# modal affichée uniquement si la sessionStorage.visit_merchant n'est pas défini (js) #} | |||
{% include '@LcCaracole/admin/merchant/modal/switch_merchant.html.twig' %} |