Post by MarkIce » Thu Jun 29, 2017 7:44 pm

Hi,

problem trying to get two free vqmods to work at the same-time on opencart V1.5.6.4,
but can't seem to find the problem.. anyone have any ideas at all

1, vqmod categories products
2, vqmod admin show product option quantity

both vqmods work ok, until they are both running at the sametime, then the vqmod categories products , stops working

New member

Posts

Joined
Sat Mar 01, 2014 5:58 am

Post by IP_CAM » Thu Jun 29, 2017 8:03 pm

well, that's because they both try to use the same ANCHOR TAG, and
of of them is replacing the default VqMod ANCHOR TAG !
Update: I combined the two VqMods into one, to make it a little easier on you,
after I found a more or less virgin Test Shop Admin Section, in my chaotic Site Assortment.
If this is, what you planned to achieve !?
Good Luck! ;)
Ernie
---
categories_products_and_options.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id><![CDATA[Products by Category - Show option quantity]]></id>
<version><![CDATA[OC v.1.5.6.x]]></version>
<vqmver><![CDATA[2.4.1]]></vqmver>
<author><![CDATA[Shawn Noh - hakim_jz]]></author>

<file name="admin/controller/catalog/product.php">
<operation error="log">
<search position="replace"><![CDATA['quantity'   => $result['quantity'],]]></search>
<add><![CDATA[
		'quantity'   => $result['quantity']. ($result['option_quantity'] ? '<br><b>Summary Option Quantity = '. $result['sum_opt_qty'].'</b><br>' . str_replace(',','<br>',$result['option_quantity']) : ''),
]]></add>
</operation>

<operation error="log">
<search position="before"><![CDATA[$this->template = 'catalog/product_list.tpl';]]></search>
<add><![CDATA[
		$this->load->model('catalog/category');
		$this->data['categories'] = $this->model_catalog_category->getCategories(array());
		$this->data['current_category'] = $filter_category;
]]></add>
</operation>

<operation error="log">
<search position="after"><![CDATA[protected function getList() {]]></search>
<add><![CDATA[
		if (isset($this->request->get['cid'])) {
		$filter_category = intVal($this->request->get['cid']);
		} else {
		$filter_category = 0;
		}
]]></add>
</operation>

<operation error="log">
<search position="after"><![CDATA['filter_status'   => $filter_status,]]></search>
<add><![CDATA[
		'filter_category'   => $filter_category,
]]></add>
</operation>	
</file>

<file name="admin/model/catalog/product.php">
<operation error="log">
<search position="replace"><![CDATA[$sql = "SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id)";]]></search>
<add><![CDATA[
		$sql = "SELECT p.product_id, p.image, p.model, p.quantity, p.price, p.status, pd.name, SUM(pov.quantity) as 'sum_opt_qty', GROUP_CONCAT( ovd.name,' : ', pov.quantity ORDER BY ovx.sort_order, ovd.option_id, ovd.name ASC ) AS 'option_quantity'
		FROM " . DB_PREFIX . "product p
		LEFT JOIN " . DB_PREFIX . "product_description pd ON p.product_id = pd.product_id AND pd.language_id = '" . $this->config->get('config_language_id') . "'
		LEFT JOIN " . DB_PREFIX . "product_option_value pov ON p.product_id = pov.product_id
		LEFT JOIN " . DB_PREFIX . "option_value_description ovd ON pov.option_value_id = ovd.option_value_id AND ovd.language_id = '" . $this->config->get('config_language_id') . "'
		LEFT JOIN " . DB_PREFIX . "option_value ovx ON ovd.option_value_id = ovx.option_value_id";
]]></add>
</operation>

<operation error="log">
<search position="before"><![CDATA[if (!empty($data['filter_category_id'])) {]]></search>
<add><![CDATA[
		if (!empty($data['filter_category'])) {
		$sql .= " INNER JOIN " . DB_PREFIX . "product_to_category pc ON (p.product_id=pc.product_id AND pc.category_id=".intVal($data['filter_category']).")";
		}
]]></add>
</operation>
</file>
		
<file name="admin/view/template/catalog/product_list.tpl">
<operation error="log">
<search position="replace"><![CDATA[<h1><img src="view/image/product.png" alt="" /> <?php echo $heading_title; ?>]]></search>
<add><![CDATA[
		<h1><img src="view/image/product.png" alt="" /> <?php echo $heading_title; ?> On
		<select id="select_category">
		<option value="0">All Categories</option>
		<?php
		foreach($categories as $category) {
		$category_id = intVal($category['category_id']);
		$category_name = $category['name'];
		$selected = ($current_category==intVal($category['category_id']))?"selected":"";
		echo "<option value='{$category_id}' {$selected}>{$category_name}</option>";
		}
		?>
		</select>
]]></add>
</operation>

<operation error="log">
<search position="before"><![CDATA[//--></script>]]></search>
<add><![CDATA[
		$("#select_category").change(function() {
		location.href="<?php echo html_entity_decode($this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '', 'SSL'));?>&cid="+$(this).val();
		});
]]></add>
</operation>

<operation error="log">
<search position="after"><![CDATA[url = 'index.php?route=catalog/product&token=<?php echo $token; ?>';]]></search>
<add><![CDATA[
		url += '&cid=<?php echo $current_category;?>';
]]></add>
</operation>
</file>
</modification>
Image

Attachments

product_categories_and_options.jpg

product_categories_and_options.jpg (166.39 KiB) Viewed 645 times


Ernie's OpenCart v.1.5.6.5 LIGHT + V-Pro + OpenShop Admin v.1.75 Test Sites
http://www.bigmax.ch - http://www.opencart.li/shop/ - http://www.velomech.ch/cart/
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by MarkIce » Sun Jul 02, 2017 7:20 pm

Big thanks for that, i've now got things working..

New member

Posts

Joined
Sat Mar 01, 2014 5:58 am
Who is online

Users browsing this forum: No registered users and 8 guests