Created
September 1, 2016 13:01
-
-
Save jhit/055cf6581cc4883bbd655a1ace5c0269 to your computer and use it in GitHub Desktop.
Shopware subscriber to detect if AboCommerce is activated in your template.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?