Post by linards » Mon Nov 03, 2014 11:18 am

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.
Last edited by linards on Thu Nov 06, 2014 2:35 pm, edited 1 time in total.

Newbie

Posts

Joined
Wed Feb 12, 2014 7:18 pm

Post by SXGuy » Mon Nov 03, 2014 4:20 pm

Product options. Just create options for each bottle size.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by linards » Thu Nov 06, 2014 2:28 pm

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.

Newbie

Posts

Joined
Wed Feb 12, 2014 7:18 pm

Post by paco_rojo » Thu Jul 09, 2015 12:22 pm

Did you find a way to have different part numbers or product id or so on for each volume. We also have a product in 1 2 3 Oz 1/4 1/2 1 2 5 10 lbs and need some thing to distinguish a different part number for each.

Newbie

Posts

Joined
Thu Apr 23, 2015 6:10 am

Post by LédiFrance » Wed Jul 22, 2015 11:01 pm

Here is a small vQmod script for OpenCart 2 which adds an EAN field for each option :

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>
Of course one must add the 'ean' field in the relevant table in the database :

Code: Select all

alter table ledifrance_db.oc_product_option_value add ean varchar(13);
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).

Newbie

Posts

Joined
Wed Jul 22, 2015 10:40 pm
Who is online

Users browsing this forum: No registered users and 1 guest