gpt4 book ai didi

mysql - 打开购物车 2.0 问题

转载 作者:行者123 更新时间:2023-11-29 23:31:39 25 4
gpt4 key购买 nike

o我在他们发布通知之前升级到了 OpenCart 2.0...我已经解决了大部分问题,但是,当我尝试向购物车添加一些东西时,错误日志反射(reflect)了以下内容:

2014-10-23 12:46:00 - PHP Notice:  Error: Column 'customer_group_id' in where clause is ambiguous<br />Error No: 1052<br /> Error in: <b>/home/www/letteritgirl.net/catalog/model/catalog/product.php</b> line <b>495</b><br />
SELECT `pd`.* FROM `oc1_product_recurring` `pp` JOIN `oc1_recurring_description` `pd` ON `pd`.`language_id` = 1 AND `pd`.`recurring_id` = `pp`.`recurring_id` JOIN `oc1_recurring` `p` ON `p`.`recurring_id` = `pd`.`recurring_id` WHERE `product_id` = 999969 AND `status` = 1 AND `customer_group_id` = 1 ORDER BY `sort_order` ASC in home/www/letteritgirl.net/system/library/db/mysql.php on line 53
2014-10-23 12:46:00 - PHP Notice: Trying to get property of non-object in /home/www/letteritgirl.net/catalog/model/catalog/product.php on line 495

消息保持在加载状态,就像陷入循环一样,并且没有任何内容添加到购物车中。

第 495 行如下:

$product_option_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "product_option` po LEFT JOIN `" . DB_PREFIX . "option` o ON (po.option_id = o.option_id) LEFT JOIN `" . DB_PREFIX . "option_description` od ON (o.option_id = od.option_id) WHERE po.product_id = '" . (int)$product_id . "' AND od.language_id = '" . (int)$this->config->get('config_language_id') . "'");

我不知道如何解决这个问题。任何帮助将不胜感激。

最佳答案

您粘贴的内容不是我拥有的任何版本中的第 495 行。第 495 行是这样的,它也与日志中的查询匹配:

return $this->db->query("SELECT `pd`.* FROM `" . DB_PREFIX . "product_recurring` `pp` JOIN `" . DB_PREFIX . "recurring_description` `pd` ON `pd`.`language_id` = " . (int)$this->config->get('config_language_id') . " AND `pd`.`recurring_id` = `pp`.`recurring_id` JOIN `" . DB_PREFIX . "recurring` `p` ON `p`.`recurring_id` = `pd`.`recurring_id` WHERE `product_id` = " . (int)$product_id . " AND `status` = 1 AND `customer_group_id` = " . (int)$this->config->get('config_customer_group_id') . " ORDER BY `sort_order` ASC")->rows;

该错误表明两个或多个表具有“customer_group_id”字段,但事实并非如此,我检查了 2.0.0.0b4 和当前“稳定”版本的数据库。这表明您有一个带有不同表的更旧版本。你真的不应该使用它,会有很多错误,你甚至可能不会注意到,直到为时已晚!但要修复您的错误,只需更改

AND `customer_group_id` =

AND `pp`.`customer_group_id` =

在我上面粘贴的行中。

关于mysql - 打开购物车 2.0 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26528849/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com