shoppica burn engine

ThemeBurn SupportForumsOpenCart ThemesBurnEngineshoppica burn engine

This topic has been marked as not a support question.

Hi can you help I was using the older template using the opencart built in latest feature best sellers, etc.

Now I have switch to shoppica burn engine and you have them built in my discount mod does not change the price on latest feature best sellers, etc. But works fine on the product page, can you point me in the right direction would I need to add anything in this code. Thanks in advance.

<modification>
	<id>Global Customer Group Discount</id>
	<version>1.5.x</version>
	<vqmver>2.X</vqmver>
	<author>marsilea15@gmail.com</author>

	<!-- // ADMIN ////////////////////////////////////////////////////////// -->

	<file name="admin/model/catalog/product.php">
		<operation>
			<search position="replace"><![CDATA[model = '" . $this->db->escape($data['model']) . "']]></search>
			<add><![CDATA[
				model = '" . $this->db->escape($data['model']) . "', gcgd_disabled = '" . $this->db->escape($data['gcgd_disabled']?'1':'0') . "'
			]]></add>
		</operation>
	</file>

	<file name="admin/language/*/catalog/product.php">
		<operation>
			<search position="after"><![CDATA[<?php]]></search>
			<add><![CDATA[
				$_['text_yes'] = 'Yes';
				$_['text_no'] = 'No';
				$_['entry_gcgd_enabled'] = 'Global Group Discount Enabled:';
			]]></add>
		</operation>
	</file>

	<file name="admin/controller/catalog/product.php">
		<operation>
			<search position="after"><![CDATA[$this->data['token'] = $this->session->data['token'];]]></search>
			<add><![CDATA[
				$this->data['text_yes'] = $this->language->get('text_yes');
				$this->data['text_no'] = $this->language->get('text_no');
				$this->data['entry_gcgd_enabled'] = $this->language->get('entry_gcgd_enabled');

				$this->data['gcgd_disabled'] = empty( $product_info['gcgd_disabled'] ) ? '0' : '1';
			]]></add>
		</operation>
	</file>

	<file name="admin/view/template/catalog/product_form.tpl">
		<operation>
			<search position="before"><![CDATA[<td><?php echo $entry_price; ?></td>]]></search>
			<add><![CDATA[
					<td>
						<?php echo $entry_gcgd_enabled; ?>
					</td>
					<td>
						<select name="gcgd_disabled">
							<option<?php echo ! $gcgd_disabled ? ' selected="selected"' : ''; ?> value="0"><?php echo $text_yes; ?></option>
							<option<?php echo $gcgd_disabled ? ' selected="selected"' : ''; ?> value="1"><?php echo $text_no; ?></option>
						</select>
					</td>
				</tr>
				<tr>
			]]></add>
		</operation>
	</file>

	<!-- // CATALOG //////////////////////////////////////////////////////// -->

	<file name="catalog/model/catalog/product.php">
		<operation>
			<search position="replace"><![CDATA[SELECT DISTINCT *]]></search>
			<add><![CDATA[SELECT DISTINCT *, p.gcgd_disabled]]></add>
		</operation>
		<operation>
			<search position="after"><![CDATA[if ($query->num_rows) {]]></search>
			<add><![CDATA[
				if( in_array( __FUNCTION__, array( 'getProduct' ) ) ) {
					$this->load->model('account/customer_group');

					if( ! isset( $this->_customerGroup ) )
						$this->_customerGroup	= $this->model_account_customer_group->getCustomerGroup( $customer_group_id );

					$specialPrice	= $query->row['special'];

					if( $specialPrice === NULL && ! $query->row['gcgd_disabled'] ) {
						$gcgdManufacturer = $this->config->get('gcgd_manufacturer');
						$customerGroupId = $this->customer->isLogged() ? $this->customer->getCustomerGroupId() : $this->config->get('config_customer_group_id');

						if( empty( $gcgdManufacturer ) || empty( $gcgdManufacturer[$customerGroupId] ) || in_array( $query->row['manufacturer_id'], $gcgdManufacturer[$customerGroupId] ) ) {
							$specialPrice = $query->row['discount'] ? $query->row['discount'] : $query->row['price'];

							if( $this->_customerGroup['gcgd_percent'] )
								$specialPrice -= round( $specialPrice * $this->_customerGroup['gcgd_percent'] / 100, 4 );

							if( $this->_customerGroup['gcgd_amount'] )
								$specialPrice -= $this->_customerGroup['gcgd_amount'];
						}
					}

					if( $specialPrice == $query->row['price'] )
						$specialPrice = NULL;
				}
			]]></add>
		</operation>
		<operation>
			<search position="replace"><![CDATA['special'          => $query->row['special'],]]></search>
			<add><![CDATA[
				'special' => $specialPrice,
				'gcgd_disabled' => $query->row['gcgd_disabled'],
			]]></add>
		</operation>
	</file>

	<file name="catalog/controller/product/product.php">
		<operation>
			<search position="before"><![CDATA[foreach ($discounts as $discount) {]]></search>
			<add><![CDATA[
				if( ! $product_info['gcgd_disabled'] ) {
					$customerGroupId = $this->customer->isLogged() ? $this->customer->getCustomerGroupId() : $this->config->get('config_customer_group_id');
					$customerGroup	= $this->db->query( 'SELECT * FROM ' . DB_PREFIX . 'customer_group WHERE customer_group_id = ' . (int) $customerGroupId )->row;
				}
			]]></add>
		</operation>
		<operation>
			<search position="after"><![CDATA[foreach ($discounts as $discount) {]]></search>
			<add><![CDATA[
				if( ! $product_info['gcgd_disabled'] ) {
					$gcgdManufacturer = $this->config->get('gcgd_manufacturer');
					$customerGroupId = $this->customer->isLogged() ? $this->customer->getCustomerGroupId() : $this->config->get('config_customer_group_id');

					if( empty( $gcgdManufacturer ) || empty( $gcgdManufacturer[$customerGroupId] ) || in_array( $product_info['manufacturer_id'], $gcgdManufacturer[$customerGroupId] ) ) {
						if( $customerGroup['gcgd_percent'] )
							$discount['price'] -= round( $discount['price'] * $customerGroup['gcgd_percent'] / 100, 4 );

						if( $customerGroup['gcgd_amount'] )
							$discount['price'] -= $customerGroup['gcgd_amount'];
					}
				}
			]]></add>
		</operation>
	</file>

	<!-- // SYSTEM ///////////////////////////////////////////////////////// -->

	<file name="system/library/cart.php">
		<operation>
			<search position="before"><![CDATA[if ($product_reward_query->num_rows) {]]></search>
			<add><![CDATA[
				if( ! $product_special_query->num_rows && ! $product_query->row['gcgd_disabled'] ) {
					$gcgdManufacturer = $this->config->get('gcgd_manufacturer');
					$customerGroupId = $this->customer->isLogged() ? $this->customer->getCustomerGroupId() : $this->config->get('config_customer_group_id');

					if( empty( $gcgdManufacturer ) || empty( $gcgdManufacturer[$customerGroupId] ) || in_array( $product_query->row['manufacturer_id'], $gcgdManufacturer[$customerGroupId] ) ) {
						$customerGroup	= $this->db->query( 'SELECT * FROM ' . DB_PREFIX . 'customer_group WHERE customer_group_id = ' . (int) $customer_group_id )->row;

						$price = $product_query->row['price'];

						if( $product_discount_query->num_rows )
							$price = $product_discount_query->row['price'];

						if( $customerGroup['gcgd_percent'] )
							$price -= round( $price * $customerGroup['gcgd_percent'] / 100, 4 );

						if( $customerGroup['gcgd_amount'] )
							$price -= $customerGroup['gcgd_amount'];
					}
				}
			]]></add>
		</operation>
	</file>

</modification>
April 11, 2017 at 9:12 pm #58201
Viewing 1 post
  • You must be logged in to reply to this topic.