Elcodi\Plugin\FacebookBundle\Templating\SharePostRenderer::renderShareProduct PHP Method

renderShareProduct() public method

Renders the share product button.
public renderShareProduct ( Elcodi\Component\Plugin\EventDispatcher\Interfaces\EventInterface $event )
$event Elcodi\Component\Plugin\EventDispatcher\Interfaces\EventInterface The event
    public function renderShareProduct(EventInterface $event)
    {
        if ($this->plugin->isUsable()) {
            /**
             * @var Product $product
             */
            $product = $event->get('product');
            $shareUrl = $this->urlGenerator->generate('store_product_view', ['id' => $product->getId(), 'slug' => $product->getSlug()], true);
            $this->appendTemplate('@ElcodiFacebook/Post/share.html.twig', $event, $this->plugin, ['url' => $shareUrl]);
        }
    }