Hello,
We have a module name pre-order for x-cart 5.3.3.1,
When i installed that module and after enabled i go to the product page at backend, then click on any product ad go to details page, There i find that A new tab "Preorder" is available. When i click on that tab then it's page are working but i have a problem that when i Click on "Product variant" Tab the it throw an error as below :
HTML Code:
ERROR: "Includes\ErrorHandler::FATAL_ERROR" (code 2)
Call to a member function toArray() on null
and when i uninstalled preorder module that that "Product Variant" tab is working fine.
The code for the "Pre-order" module at path to call the preorder page is as below
classes/XLite/Module/Wevbkulsoftware/PreorderSales/Controller/Admin/Product.php
PHP Code:
/**
* Page key
*/
const PAGE_VARI = 'preorders';
public function getPages()
{
$list = parent::getPages();
if (!$this->isNew()) {
$list = array_merge(
array_slice($list, 0, 5),
array(static::PAGE_VARI => static::t('PreorderSales')),
array_slice($list, 5)
);
}
return $list;
}
protected function getPageTemplates()
{
$list = parent::getPageTemplates();
if (!$this->isNew()) {
$list = array_merge(
array_slice($list, 0,5),
array(static::PAGE_VARI => 'modules/Webkulsoftware/PreorderSales/preorders/body.twig'),
array_slice($list, 5)
);
}
return $list;
}
And code for the module "Product variant" at path below
classes/XLite/Module/XC/ProductVariants/Controller/Admin/Product.php
is
PHP Code:
/**
* Page key
*/
const PAGE_VARIANTS = 'variants';
/**
* Get pages
*
* @return array
*/
public function getPages()
{
$list = parent::getPages();
if (!$this->isNew()) {
$list = array_merge(
array_slice($list, 0, 2),
array(static::PAGE_VARIANTS => static::t('Variants')),
array_slice($list, 2)
);
}
return $list;
}
/**
* Get pages templates
*
* @return array
*/
protected function getPageTemplates()
{
$list = parent::getPageTemplates();
if (!$this->isNew()) {
$list = array_merge(
array_slice($list, 0, 2),
array(static::PAGE_VARIANTS => 'modules/XC/ProductVariants/variants/body.twig'),
array_slice($list, 2)
);
}
return $list;
}
So, Please let me know the possible reason.