$this->_buildProduct($contents, $products);
}
private function _buildProduct($contents, $products) {
if ($products->getCount() > 0) {
foreach ($products->getCollection() as $product) {
if (2 == $product->getType()->getId()) {
$product_display = $product->display('card.html.twig');
$attributes = $product->getAvailableProductVariations();
$extra_content = '';
if (count($attributes) > 0) {
$this->getContainer()['catalog.args'] = function () use ($args) { return $args; };
$this->getContainer()['catalog.request'] = function () use ($request) { return $request; };
$this->getContainer()['catalog.taxon'] = function () use ($taxon) { return $taxon; };
$this->getContainer()['catalog.brand'] = function () use ($brand) { return $brand; };
$this->getContainer()['catalog.sales'] = 1;
$this->_buildProduct($contents, $products);
}
private function _buildProduct($contents, $products) {
if ($products->getCount() > 0) {
foreach ($products->getCollection() as $product) {
$parameters = $reflection->getParameters();
// @todo add compare to RequestInterface
if (1 === $reflection->getNumberOfParameters()
&& $parameters[0]->getClass()
&& 'Ludri\Framework\Http\Request' == $parameters[0]->getClass()->getName()) {
$response = $this->controller->{$this->action}($this->getRequest($this->vars));
} else if (0 === $reflection->getNumberOfParameters()) {
$response = $this->controller->{$this->action}();
} else if (1 === $reflection->getNumberOfParameters()
&& !array_key_exists($parameters[0]->getName(), $this->vars)) {
$response = $this->controller->{$this->action}($this->vars);
$this->_ludri->getContainer()['router'] = function($container) {
return $this->router;
};
$event = new Event('app/start', $this);
$this->_ludri->trigger($event);
$response = $this->router->dispatch();
$event = new Event('app/prerender', $this);
$this->_ludri->trigger($event);
if (false === $response) {
if ('' == Ludri::url()->pathkey) {
$this->router->dispatch('page');
}
}
public function execute() {
if ($this->isInstalled()) {
$response = $this->start();
} else if ($this->isInstaller()) {
$response = $this->install();
}
if ($response instanceof \Ludri\Framework\Http\Response) {
$args = [
public function execCommand(Command\Arguments $arguments) {
$this->_container['console']->exec($arguments);
}
public function generate($contents = '') {
return $this->_container['app']->execute($contents = '');
}
/**
* Legacy statics methods
*/
// Figure out how to map to the needed script file
// from the existing application and possibly (re-)set
// some env vars.
return $ludri->generate();
}
}
if ($_SERVER['REMOTE_ADDR'] == '88.173.128.90') {
//echo $_ENV['APP_DEBUG'];
error_reporting(0);
ini_set('display_errors', 0);
}
$ludriResponse = LudriBridge::toLudri($ludri, $request, $response, __DIR__);
if (!$ludriResponse instanceof LudriResponse) {
$response->send();
$kernel->terminate($request, $response);
} else {
echo $ludriResponse;
No log messages
ErrorException
|
---|
ErrorException: Warning: Invalid argument supplied for foreach() at lib/ludri_commerce_package/src/Catalog/Controller.php:514 at Ludri\Commerce\Catalog\Controller->_buildProduct() (lib/ludri_commerce_package/src/Catalog/Controller.php:509) at Ludri\Commerce\Catalog\Controller->salesAction() (lib/ludri_framework_package/src/Core/Router.php:274) at Ludri\Framework\Core\Router->dispatch() (lib/ludri_framework_package/src/Core/Ludri/App.php:93) at Ludri\Framework\Core\Ludri\App->start() (lib/ludri_framework_package/src/Core/Ludri/App.php:237) at Ludri\Framework\Core\Ludri\App->execute() (lib/ludri_framework_package/src/Core/Ludri.php:302) at Ludri\Framework\Core\Ludri->generate() (src/Bridge/LudriBridge.php:27) at App\Bridge\LudriBridge::toLudri() (web/index.php:50) |