Example #1
0
 /**
  * @param StorageInterface         $storage
  * @param SettingsManagerInterface $settingsManager
  * @param ObjectManager            $customerManager
  * @param ChannelContextInterface  $channelContext
  */
 public function __construct(StorageInterface $storage, CustomerContextInterface $customerContext, SettingsManagerInterface $settingsManager, ObjectManager $customerManager, ChannelContextInterface $channelContext)
 {
     $this->customerContext = $customerContext;
     $this->settingsManager = $settingsManager;
     $this->customerManager = $customerManager;
     $this->channelContext = $channelContext;
     parent::__construct($storage, $this->getDefaultCurrency());
 }
Example #2
0
 public function setCurrency($currency)
 {
     if (null === ($user = $this->getUser())) {
         return parent::setCurrency($currency);
     }
     $user->setCurrency($currency);
     $this->userManager->persist($user);
     $this->userManager->flush();
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('amount', 'sylius_money', array('label' => 'sylius.form.payment_method.fee_calculator.fixed.amount', 'currency' => $this->currencyContext->getCurrency()));
 }