/** * Add PayPal payment method * * @param PaymentCollectionEvent $event Event */ public function addPaypalPaymentMethod(PaymentCollectionEvent $event) { if ($this->plugin->isUsable(['business'])) { $paypal = new PaymentMethod($this->plugin->getHash(), 'elcodi_plugin.paypal_web_checkout.name', 'elcodi_plugin.paypal_web_checkout.description', $this->router->generate('paymentsuite_paypal_web_checkout_execute')); $event->addPaymentMethod($paypal); } }
/** * Add Free payment method * * @param PaymentCollectionEvent $event Event */ public function addFreePaymentPaymentMethod(PaymentCollectionEvent $event) { if ($this->plugin->isUsable()) { $bankwire = new PaymentMethod($this->plugin->getHash(), 'elcodi_plugin.bankwire.name', 'elcodi_plugin.bankwire.description', $this->router->generate('paymentsuite_bankwire_execute')); $event->addPaymentMethod($bankwire); } }
/** * Add Free payment method * * @param PaymentCollectionEvent $event Event */ public function addFreePaymentPaymentMethod(PaymentCollectionEvent $event) { if ($this->plugin->isUsable()) { $freePayment = new PaymentMethod($this->plugin->getHash(), 'elcodi_plugin.free_payment.name', 'elcodi_plugin.free_payment.description', $this->router->generate('freepayment_payment_routes')); $event->addPaymentMethod($freePayment); } }
/** * Add Stripe payment method * * @param PaymentCollectionEvent $event Event */ public function addStripePaymentMethod(PaymentCollectionEvent $event) { if ($this->plugin->isUsable(['private_key', 'public_key'])) { $stripeForm = $this->getStripeForm() . $this->getStripeScript(); $stripe = new PaymentMethod($this->plugin->getHash(), 'elcodi_plugin.stripe.name', 'elcodi_plugin.stripe.description', '', '', $stripeForm); $event->addPaymentMethod($stripe); } }
/** * Renders import/export buttons * * @param EventInterface $event * * @return string */ public function renderButtons(EventInterface $event) { if ($event->get('entity_type') !== 'product') { return null; } if ($this->plugin->isUsable()) { $this->appendTemplate('ElcodiProductCsvBundle::buttons.html.twig', $event, $this->plugin); } }
/** * Renders the share product button. * * @param EventInterface $event The event */ public function renderShareOrder(EventInterface $event) { if ($this->plugin->isUsable()) { $shareUrl = $this->urlGenerator->generate('store_homepage', [], true); $this->appendTemplate('@ElcodiFacebook/Post/share.html.twig', $event, $this->plugin, ['url' => $shareUrl]); } }
/** * Renders the share product button. * * @param EventInterface $event The event */ public function renderShareOrder(EventInterface $event) { if ($this->plugin->isUsable(['twitter_account'])) { $shareUrl = $this->urlGenerator->generate('store_homepage', [], true); $this->appendTemplate('@ElcodiTwitter/Tweet/share.html.twig', $event, $this->plugin, ['url' => $shareUrl, 'text' => $this->translator->trans('twitter_plugin.tweet.take_look')]); } }
/** * Render the disable under construction mode. * * @param EventInterface $event The event */ public function renderDisableUnderConstructionMode(EventInterface $event) { if ($this->plugin->isUsable()) { $masterRequest = $this->requestStack->getMasterRequest(); $currentRoute = $masterRequest->attributes->get('_route'); $isWizardFinished = $this->wizardStatus->isWizardFinished(); if ('admin_configuration_list' == $currentRoute && $isWizardFinished) { $this->appendTemplate('@ElcodiStoreSetupWizard/Wizard/disable-under-construction.html.twig', $event, $this->plugin); } } }
/** * Renders disqus block on product page * * @param EventInterface $event Event */ public function renderDisqusProductBlock(EventInterface $event) { if ($this->plugin->isUsable(['disqus_identifier', 'disqus_enabled_product'])) { $this->appendTemplate('@ElcodiDisqus/block.html.twig', $event, $this->plugin); } }
/** * Renders google analytics JS * * @param EventInterface $event Event */ public function renderJavascript(EventInterface $event) { if ($this->plugin->isUsable(['analytics_tracker_id'])) { $this->appendTemplate('@ElcodiGoogleAnalytics/javascript.html.twig', $event, $this->plugin); } }
/** * Renders import/export buttons * * @param EventInterface $event Event */ public function renderPin(EventInterface $event) { if ($this->plugin->isUsable()) { $this->appendTemplate('@ElcodiPinterest/product_pin.html.twig', $event, $this->plugin); } }
/** * Renders the javascript. * * @param EventInterface $event The event */ public function renderJavascript(EventInterface $event) { if ($this->plugin->isUsable()) { $this->appendTemplate('@ElcodiTwitter/javascript.html.twig', $event, $this->plugin); } }
/** * Renders the follow button. * * @param EventInterface $event The event */ public function renderFollowButton(EventInterface $event) { if ($this->plugin->isUsable(['twitter_account'])) { $this->appendTemplate('@ElcodiTwitter/Follow/follow.html.twig', $event, $this->plugin); } }