Post by tjsystems » Sun Dec 07, 2014 1:35 am

Hi Guys,

I'm using this code to add product fields to my store...Installs fine in OC211
Some how not working for me... checked al the code with github... no luck

Any ideas?

Code: Select all

<modification>
    <name>Add all product fields</name>
	<version>1.1</version>
	<author>NoSite.nl</author>
	<code>products_fields_ocmod</code>

	<file path="catalog/controller/product/category.php">
		<operation>
			<search ><![CDATA[
			$data['text_model'] = $this->language->get('text_model');
			]]></search>
			<add position="after"><![CDATA[
			// <!-- add by ocMod -->
			$data['text_sku'] = $this->language->get('text_sku');
			$data['text_upc'] = $this->language->get('text_upc');
			$data['text_ean'] = $this->language->get('text_ean');
			$data['text_jan'] = $this->language->get('text_jan');
			$data['text_isbn'] = $this->language->get('text_isbn');
			$data['text_mpn'] = $this->language->get('text_mpn');
			// <!-- end add by ocMod -->
			]]></add>
		</operation>
		<operation>
			<search ><![CDATA[
			'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url)
			]]></search>
			<add position="replace"><![CDATA[
			// <!-- add by ocMod -->
			'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url),
			'model' => $result['model'],
			'sku' => $result['sku'],
			'upc' => $result['upc'],
			'ean' => $result['ean'],
			'jan' => $result['jan'],
			'isbn' => $result['isbn'],
			'mpn' => $result['mpn']
			// <!-- end add by ocMod -->
			]]></add>
		</operation>
	</file>
	<file path="catalog/controller/product/product.php">
		<operation>
			<search ><![CDATA[
			$data['text_model'] = $this->language->get('text_model');
			]]></search>
			<add position="after"><![CDATA[
			// <!-- add by ocMod -->
			$data['text_sku'] = $this->language->get('text_sku');
			$data['text_upc'] = $this->language->get('text_upc');
			$data['text_ean'] = $this->language->get('text_ean');
			$data['text_jan'] = $this->language->get('text_jan');
			$data['text_isbn'] = $this->language->get('text_isbn');
			$data['text_mpn'] = $this->language->get('text_mpn');
			// <!-- end add by ocMod -->
			]]></add>
		</operation>
		<operation>
			<search ><![CDATA[
			'href' => $this->url->link('product/product', 'product_id=' . $result['product_id'])
			]]></search>
			<add position="replace"><![CDATA[
			// <!-- add by ocMod -->
			'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']),
			'sku' => $result['sku'],
			'upc' => $result['upc'],
			'ean' => $result['ean'],
			'jan' => $result['jan'],
			'isbn' => $result['isbn'],
			'mpn' => $result['mpn']
			// <!-- end add by ocMod -->
			]]></add>
		</operation>
	</file>
	<file path="catalog/language/english/product/category.php">
		<operation>
			<search ><![CDATA[
			$_['text_model'] = 'Product Code:';
			]]></search>
			<add position="after"><![CDATA[
			// <!-- add by ocMod -->
			$_['text_sku'] = 'Stock Code:';
			$_['text_upc'] = 'UPC:';
			$_['text_ean'] = 'EAN:';
			$_['text_jan'] = 'JAN:';
			$_['text_isbn'] = 'ISBN:';
			$_['text_mpn'] = 'MPN:';
			// <!-- end add by ocMod -->
			]]></add>
		</operation>
	</file>
	<file path="catalog/language/english/product/product.php">
		<operation>
			<search ><![CDATA[
			$_['text_model'] = 'Product Code:';
			]]></search>
			<add position="after"><![CDATA[
			// <!-- add by ocMod -->
			$_['text_sku'] = 'Stock Code:';
			$_['text_upc'] = 'UPC:';
			$_['text_ean'] = 'EAN:';
			$_['text_jan'] = 'JAN:';
			$_['text_isbn'] = 'ISBN:';
			$_['text_mpn'] = 'MPN:';
			// <!-- end add by ocMod -->
			]]></add>
		</operation>
	</file>
	<!-- edit the template file...-->
	<file path="catalog/view/theme/*/template/product/product.tpl">
		<operation>
			<search ><![CDATA[
			<?php if ($price) { ?>
			]]></search>
			<add position="before"><![CDATA[
			<!-- add by ocMod -->
			<table class="table table-striped">
				<tbody>
					<?php if ($manufacturer) { ?>
					<tr>
						<td><?php echo $text_manufacturer; ?></td>
						<td><a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a></td>
					</tr>
						<?php } ?>
						<?php if ($sku) { ?>
					<tr>
						<td><?php echo $text_sku; ?></td>
						<td><?php echo $sku; ?></td>
					</tr>
						<?php } ?>
						<?php if ($upc) { ?>
					<tr>
						<td><?php echo $text_upc; ?></td>
						<td><?php echo $upc; ?></td>
					</tr>
						<?php } ?>
						<?php if ($ean) { ?>
					<tr>
						<td><?php echo $text_ean; ?></td>
						<td><?php echo $ean; ?></td>
					</tr>
						<?php } ?>
						<?php if ($jan) { ?>
					<tr>
						<td><?php echo $text_jan; ?></td>
						<td><?php echo $jan; ?></td>
					</tr>
						<?php } ?>
						<?php if ($isbn) { ?>
					<tr>
						<td><?php echo $text_isbn; ?></td>
						<td><?php echo $isbn; ?></td>
					</tr>
						<?php } ?>
						<?php if ($mpn) { ?>
					<tr>
						<td><?php echo $text_mpn; ?></td>
						<td><?php echo $mpn; ?></td>
					</tr>
						<?php } ?>
				</tbody>
			</table>
			<!-- end add by ocMod -->
			]]></add>
		</operation>
	</file>		
</modification>
Log info:

Code: Select all

2014-12-06 18:21:54 - MOD: Modification Default
FILE: system/engine/action.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 58
FILE: system/engine/loader.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 20
LINE: 37
LINE: 54
LINE: 65
FILE: system/library/config.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 23
FILE: system/library/language.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 21
LINE: 27
----------------------------------------------------------------
MOD: Add all product fields
FILE: catalog/controller/product/category.php
CODE: $data['text_model'] = $this->language->get('text_model');
LINE: 103
CODE: 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url)
NOT FOUND!
FILE: catalog/controller/product/product.php
CODE: $data['text_model'] = $this->language->get('text_model');
LINE: 230
CODE: 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id'])
NOT FOUND!
FILE: catalog/language/english/product/category.php
CODE: $_['text_model'] = 'Product Code:';
NOT FOUND!
FILE: catalog/language/english/product/product.php
CODE: $_['text_model'] = 'Product Code:';
NOT FOUND!
FILE: catalog/view/theme/default/template/product/product.tpl
CODE: <?php if ($price) { ?>
LINE: 198
FILE: catalog/view/theme/sakelicious/template/product/product.tpl
CODE: <?php if ($price) { ?>
LINE: 106
----------------------------------------------------------------
Last edited by tjsystems on Sun Dec 07, 2014 6:59 am, edited 1 time in total.

Live with 2.2.0.0 fully SSL.


Active Member

Posts

Joined
Sun Aug 26, 2012 5:39 pm
Location - NL, Amsterdam

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by tjsystems » Sun Dec 07, 2014 3:28 am

JNeuhoff wrote:I think it's resolved, ...
Nope, this ocMod still not working for me.

Code: Select all

Notice: Undefined variable: sku 
and also on UPC/MPN/ISBN/ etc..

using default theme on OC 2.1.1

Live with 2.2.0.0 fully SSL.


Active Member

Posts

Joined
Sun Aug 26, 2012 5:39 pm
Location - NL, Amsterdam

Post by JNeuhoff » Sun Dec 07, 2014 3:38 am

You got a few errors which are to be resolved first in your OCmod:

Code: Select all

MOD: Add all product fields
FILE: catalog/controller/product/category.php
CODE: $data['text_model'] = $this->language->get('text_model');
LINE: 103
CODE: 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url)
NOT FOUND!
FILE: catalog/controller/product/product.php
CODE: $data['text_model'] = $this->language->get('text_model');
LINE: 230
CODE: 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id'])
NOT FOUND!
FILE: catalog/language/english/product/category.php
CODE: $_['text_model'] = 'Product Code:';
NOT FOUND!
FILE: catalog/language/english/product/product.php
CODE: $_['text_model'] = 'Product Code:';
NOT FOUND!
FILE: catalog/view/theme/default/template/product/product.tpl
CODE: <?php if ($price) { ?>
LINE: 198

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by tjsystems » Sun Dec 07, 2014 6:21 am

Found it! Mixed some between product and category.

Attachments

All product field


Live with 2.2.0.0 fully SSL.


Active Member

Posts

Joined
Sun Aug 26, 2012 5:39 pm
Location - NL, Amsterdam

Post by klyn05 » Sat Aug 20, 2016 6:06 am

This XML file kept the errors I had and added new ones. I don't know if its possibly because of a different OC version; nonetheless, the errors I had remained, so this is not a fix for OC 2.0...

New member

Posts

Joined
Sat Jan 03, 2015 2:27 am
Who is online

Users browsing this forum: No registered users and 2 guests