Is it possible to modify OC products details and add a special field for product volume with measurement in millilitres? Like it is about weight, and dimensions. Also it would be logical that each product volume option, like for instance 50ml, 100ml, 70ml, each would have its own product ID, EAN, price, image, special price and reward points that a customer can earn and those needed to purchase the product.
The issue is that our web store is selling perfumes. We want that a customer can simply chose an available volume option for each product on the same page.
Maybe there are some extensions for that? Thanks you in advance!
P.s. Sorry for new topic, I searched about this and didn't find anything related to the topic.
Ok, I see that creating options is what we need here.
Is there any possibility to have each product volume option it's own image, product ID or EAN, ammount of receivable reward points, reward points to buy product, special price?
Regards.
Is there any possibility to have each product volume option it's own image, product ID or EAN, ammount of receivable reward points, reward points to buy product, special price?
Regards.
Here is a small vQmod script for OpenCart 2 which adds an EAN field for each option :
Of course one must add the 'ean' field in the relevant table in the database :
From this if you're not afraid of code it is trivial to add other fields.
Note that I'm very new to OpenCart so this vQmod may not be completely foolproof. Plus there might be drawbacks in naming the field 'ean' while there is already another 'ean' field in the 'oc_product' table (though I feel it's nicer since it shows the EAN definition as in the main field without further modifications).
Finally, if you use OpenCart 1.5 you may want to have a look at this extension, from which this vQmod is inspired (but which is more complex).
Code: Select all
<modification>
<id>option EAN</id>
<version>0.1</version>
<vqmver>2.5.1</vqmver>
<author>LediFrance</author>
<file name="admin/view/template/catalog/product_form.tpl">
<operation>
<search position="after" index="1"><![CDATA[<td class="text-right"><?php echo $entry_weight; ?></td>]]></search>
<add><![CDATA[<td class="left">EAN</td>]]></add>
</operation>
<operation>
<search position="after"><![CDATA[html += ' <td class="text-right"><?php echo $entry_weight; ?></td>';]]></search>
<add><![CDATA[html += ' <td class="left">EAN</td>';]]></add>
</operation>
<operation>
<search position="replace" index="1,3" ><![CDATA[<td colspan="6"></td>]]></search>
<add><![CDATA[<td colspan="7"></td>]]></add>
</operation>
<operation>
<search position="after" ><![CDATA[$product_option_value['weight']]]></search>
<add><![CDATA[ <td><input type="text" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][ean]" value="<?php echo $product_option_value['ean']; ?>" placeholder="<?php echo $entry_ean; ?>" class="form-control" /></td>]]>
</add>
</operation>
<operation>
<search position="after" ><![CDATA[value="" placeholder="<?php echo $entry_weight; ?>"]]></search>
<add><![CDATA[html += ' <td><input type="text" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][ean]" value="<?php echo $product_option_value['ean']; ?>" placeholder="<?php echo $entry_ean; ?>" class="form-control" /></td>';]]>
</add>
</operation>
</file>
<file name="admin/model/catalog/product.php">
<operation>
<search position="after" ><![CDATA[$product_option_value_data[] = array]]></search>
<add><![CDATA[ 'ean' => $product_option_value['ean'],]]>
</add>
</operation>
<operation>
<search position="replace" ><![CDATA[['weight_prefix']) . "'");]]></search>
<add><![CDATA[['weight_prefix']) . "', ean = '" . $this->db->escape($product_option_value['ean']) . "'");]]></add>
</operation>
</file>
<file name="admin/controller/catalog/product.php">
<operation>
<search position="after" ><![CDATA[$product_option_value_data[] = array]]></search>
<add><![CDATA[ 'ean' => $product_option_value['ean'],]]>
</add>
</operation>
</file>
</modification>
Code: Select all
alter table ledifrance_db.oc_product_option_value add ean varchar(13);
Note that I'm very new to OpenCart so this vQmod may not be completely foolproof. Plus there might be drawbacks in naming the field 'ean' while there is already another 'ean' field in the 'oc_product' table (though I feel it's nicer since it shows the EAN definition as in the main field without further modifications).
Finally, if you use OpenCart 1.5 you may want to have a look at this extension, from which this vQmod is inspired (but which is more complex).
Who is online
Users browsing this forum: No registered users and 9 guests