当我完成订单时,问题库存更新prestashop
最近我为prestashop安装了emag marketplace模块。安装过程正常,我配置了api设置,凭据正常,但当我尝试在我的网站上下订单时,它显示500错误 我曾多次试图解决这个问题,但都没有成功。。我的日志是:当我完成订单时,问题库存更新prestashop,prestashop,Prestashop,最近我为prestashop安装了emag marketplace模块。安装过程正常,我配置了api设置,凭据正常,但当我尝试在我的网站上下订单时,它显示500错误 我曾多次试图解决这个问题,但都没有成功。。我的日志是: [19-May-2021 18:51:40 Europe/Bucharest] PHP Warning: Creating default object from empty value in /home/mgromita/public_html/modules/emagmk
[19-May-2021 18:51:40 Europe/Bucharest] PHP Warning: Creating default object from empty value in /home/mgromita/public_html/modules/emagmkp/classes/Traits/ProductTrait.php on line 129
[19-May-2021 18:51:40 Europe/Bucharest] PHP Fatal error: Uncaught Error: Call to undefined method stdClass::update() in /home/mgromita/public_html/modules/emagmkp/classes/Traits/ProductTrait.php:131
Stack trace:
#0 /home/mgromita/public_html/modules/emagmkp/emagmkp.php(349): Emagmkp->isUpdated('111')
#1 /home/mgromita/public_html/modules/jprestaspeedpack/jprestaspeedpack.php(2286): Emagmkp->hookActionUpdateQuantity(Array)
#2 /home/mgromita/public_html/override/classes/Hook.php(24): Jprestaspeedpack::execHook('m', Object(Emagmkp), 'hookActionUpdat...', Array)
#3 /home/mgromita/public_html/classes/Hook.php(414): Hook::coreCallHook(Object(Emagmkp), 'hookActionUpdat...', Array)
#4 /home/mgromita/public_html/classes/Hook.php(927): HookCore::callHookOn(Object(Emagmkp), 'actionUpdateQua...', Array)
#5 /home/mgromita/public_html/src/Adapter/HookManager.php(79): HookCore::exec('actionUpdateQua...', Array, NULL, false, true, false, NULL)
#6 /home/mgromita/public_html/src/Core/Stock/StockManager.php(192): PrestaShop\PrestaShop\Adapter\HookManager->exec('actionUpdateQua...', A in /home/mgromita/public_html/modules/emagmkp/classes/Traits/ProductTrait.php on line 131
有emagmkp.php,第349行
public function hookActionUpdateQuantity(array $params)
{
$this->isUpdated($params['id_product']);
$this->setOrderToBeSync($params['cart']->id);
}
还有ProductTrait.php类
public function isUpdated(string $productId)
{
try {
$productModel = (new PrestaShopCollection(ProductDataModel::class))
->where(
'id_product',
'=',
$productId
)
->getFirst();
$productModel->is_updated = true;
return $productModel->update();
} catch (Exception $exception) {
PrestaShopLogger::addLog($exception->getMessage());
}
return false;
}
您有一个来自jprestaspeedpack模块的被重写的“Hook.php”,我认为罪魁祸首就在那里。尝试排除该模块/覆盖,查看问题是否仍然存在。。。