I'm launching tonight and trying to get a vqmod addition in before it goes live.
If someone can see the issue right away I'd really appreciate it. This is the error:
Code: Select all
Parse error: syntax error, unexpected '$this' (T_VARIABLE), expecting function (T_FUNCTION) in /home/atit/public_html/system/storage/modification/catalog/controller/product/product.php on line 28
Code: Select all
<modification>
<name><![CDATA[<font color="#0000"><b>Ecomteck - Sold Items - Number Bought The Product</font>]]></name>
<version>2.3.0</version>
<link>http://ecomteck.com</link>
<author>ecomteck@gmail.com</author>
<code>ec_sold_items</code>
<file path="catalog/language/*/product/product.php">
<operation>
<search position="replace"><![CDATA[$_['text_search'] = 'Search';]]></search>
<add><![CDATA[
$_['text_sold_items'] = 'This item has been sold: <span class="sold_total"><b>%s</b> <span>times</span></span>';
$_['text_search'] = 'Search';
]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/product/product.tpl">
<operation>
<search position="replace"><![CDATA[<?php if ($price) { ?>]]></search>
<add><![CDATA[
<?php if(isset($sold_items)) { ?>
<div class="ec_block_sold_items">
<div><?php echo sprintf($language->get("text_sold_items"), $sold_items); ?></div>
</div>
<?php } ?>
<?php if ($price) { ?>
]]></add>
</operation>
</file>
<file path="catalog/controller/product/product.php">
<operation>
<search position="before"><![CDATA[public function index() {]]></search>
<add><![CDATA[
protected function getTotalBought($product_id, $order_status_id = 0){
$this->load->language('product/product');
$this->load->model('catalog/product');
$data['language'] = $this->language->get('language');
$data['sold_items'] = $this->getTotalBought($product_info['product_id']);
$bought = 0;
$filter_status = " AND o.order_status_id > 0";
if($order_status_id ) {
$filter_status = " AND o.order_status_id IN (".implode(",",$order_status_id).")";
}
$query = $this->db->query("SELECT sum(quantity) as `total` FROM `" . DB_PREFIX . "order_product` op
LEFT JOIN `".DB_PREFIX."order` AS o ON op.order_id = o.order_id WHERE op.product_id = ".$product_id.$filter_status);
if($query->num_rows){
return $query->row['total'];
}
return 0;
}
]]></add>
</operation>
</file>
</modification>