我曾经为OpenCart 1.5制作了几个扩展程序,我希望"转换"他们加入OpenCart 2.3.0.2。
我很难确定如何为2.3.0.2执行以下操作:
echo "Free Items Disabler started.<br>";
$sqll = "SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "'";
$result = mysql_query($sqll)or die(mysql_error());
$antall = mysql_num_rows($result);
echo "Products to check: ".$antall."<br>";
...
$this->session->data['success'] = 'Free Items Disabler has
disabled ' . $products_changed . ' products with no price!';
我已经尝试过查看其他2.3扩展程序来解决这个问题,但我找不到任何类似的东西。我花了两天时间试图解决这个问题。
答案 0 :(得分:0)
解决方案原来是:
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) ");
$num = $query->rows;
...
$this->session->data['success'] = 'Free Items Disabler has disabled ' . $products_changed . ' products with no price!';