Skip to content

Instantly share code, notes, and snippets.

@jhit
Created September 1, 2016 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhit/055cf6581cc4883bbd655a1ace5c0269 to your computer and use it in GitHub Desktop.
Save jhit/055cf6581cc4883bbd655a1ace5c0269 to your computer and use it in GitHub Desktop.
Shopware subscriber to detect if AboCommerce is activated in your template.
<?php
/**
* Adds the variable AboCommerceEnabled to the view
*
* @param Arguments $arguments
*/
public function addAboCommerceData(Arguments $arguments)
{
/** @var \Enlight_Controller_Action $controller */
$controller = $arguments->get('subject');
$view = $controller->View();
$aboCommerceEnabled = $this->container->has('abo_commerce.abo_commerce');
if ($aboCommerceEnabled == false) {
try {
/** @var \Shopware_Components_AboCommerce $aboCommerce */
$aboCommerce = Shopware()->AboCommerce();
$aboCommerceEnabled = true;
} catch (\Exception $e) {
$aboCommerceEnabled = false;
}
}
$view->assign('AboCommerceEnabled', $aboCommerceEnabled);
}
@selva9594
Copy link

How to install an Abo commerce/subscriptions plugin in Shopware. I have downloaded the test version and start to install a plugin, At the installation time facing license issue For example "Unable to install, got exception: License check for module "SwagAboCommerce" has failed. " How to rectify the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment