Post by kestas » Sat Nov 24, 2018 4:43 am

Hi,
Now exist the companies, that offer an additional warranty. The additional warranty starts after the end of the base warranty provided by the manufacturer of the product. Often, the term of the warranty are different for different products, so this additional field is required for entering the product warranty term, and the column for the warranty term in the database. This will make easy the implementation of an additional warranty API.
This additional field for the product should be named "Base warranty term"
Of course I know this can be easy added by ocmod, but I prefere this field in core.

Cheers

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by IP_CAM » Sat Nov 24, 2018 8:18 am

Well, in my 1.5.6.5/OC-2 themed Version, I solved this
by use of this VqMod Extension. But the Code itself can
easy be placed into the Source as well, after a couple of lines with
$this->data to $data Code have been adapted, to also
match later OC Versions ... :D
Ernie
PS: Product image shows my last Love, before I left Canada
again, after 2 Years of beeing there, many many Moon's ago ... ::)

Code: Select all

<modification>
<id><![CDATA[Product Warranty Details Free]]></id>
<version><![CDATA[OC v.1.5.6.5]]></version>
<vqmver><![CDATA[2.5.1]]></vqmver>
<author><![CDATA[ocart777 - IP_CAM]]></author>

<file name="admin/controller/catalog/product.php" error="log">
<operation error="log">
<search position="after"><![CDATA[$this->language->get('entry_name');]]></search>
<add><![CDATA[
	$this->data['entry_warranty'] = $this->language->get('entry_warranty');
	$this->data['entry_warranty_help'] = $this->language->get('entry_warranty_help');
]]></add>
</operation>
</file>

<file name="admin/model/catalog/product.php" error="log">
<operation error="log">
<search position="replace"><![CDATA[$this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', ]]></search>
<add><![CDATA[
	$this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', warranty_details = '" . $this->db->escape($value['warranty_details']) . "',
]]></add>
</operation>

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

<file name="admin/view/template/catalog/product_form.tpl" error="log">
<operation error="log">
<search position="before" offset="1"><![CDATA[<td><?php echo $entry_meta_description; ?></td>]]></search>
<add><![CDATA[
	<tr>
	<td><?php echo $entry_warranty; ?><span class="help"><?php echo $entry_warranty_help ?></span></td>
	<td><input type="text" name="product_description[<?php echo $language['language_id']; ?>][warranty_details]" size="100" value="<?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['warranty_details'] : ''; ?>" /></td>
	</tr>
]]></add>
</operation>
</file>

<file name="catalog/view/theme/default/template/product/product.tpl" error="log">
<operation error="log">
<search position="before"><![CDATA[<ul class="nav nav-tabs">]]></search>
<add><![CDATA[
	<?php if ($warranty_details) { ?>
	<span style="text-align:center;margin-bottom:0px;"><h4><?php echo $warranty_details; ?></h4></span>
	<?php } ?>
]]></add>
</operation>
</file>
</modification>
---
Image

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

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

Post by kestas » Sat Nov 24, 2018 9:36 pm

Yes Ernie, you are right I can add it using vqmod or ocmod it is no problem. I think it is very easy implement it to the core...

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am
Who is online

Users browsing this forum: No registered users and 29 guests