Hey guys,
I finally had time to release my opencart extension / mod that gives you the ability to create global product attributes and assign individual values to them on each products.
It works like this:
1. You create some Product Attributes in the admin section via Catalog > Product Attributes. You could create for example the attribute "Material" and "water proof". These are simply string entries in the database.
2. Now you go to a product you want to add these attributes: Catalog > Product > Edit. In the tab 'Product Attributes' next to 'Data' and 'Options' you can add one or more attributes you've just created in step 1.
3. Then enter the value of each product attribute you have just added: You could add 'yes' to the attribute 'water proof' and 'Polyester' to the attribute 'Material'
4. Click 'save'.
It's that easy.
Since this is a very basic functionality of an eCommerce software, I didn't spend time to check how to implement it as extension. So I deeply integrated it in the opencart software. I've started a few months ago, so the opencart version is v1.4.7. I didn't test it with the newer ones, actually. But I think it should work, too.
Of course, I'm using the MVC pattern, so don't worry about bad code structure. But please let me know if there's anything I could do better.
WARNING!!!
Please do not use this mod for your running opencart installation. You should only use this mod in testing envs. I released this mod so that Daniel and others can discuss if this would be integrated in the future, since it's a very fundamental feature.
Please see the instructions.txt. I hope I made it clear how to install it. I might have not mentioned anything necessary, so please let me know if you couldn't manage to install.
Download http://www.rhcreativity.de/clients/prod ... ackage.zip
I finally had time to release my opencart extension / mod that gives you the ability to create global product attributes and assign individual values to them on each products.
It works like this:
1. You create some Product Attributes in the admin section via Catalog > Product Attributes. You could create for example the attribute "Material" and "water proof". These are simply string entries in the database.
2. Now you go to a product you want to add these attributes: Catalog > Product > Edit. In the tab 'Product Attributes' next to 'Data' and 'Options' you can add one or more attributes you've just created in step 1.
3. Then enter the value of each product attribute you have just added: You could add 'yes' to the attribute 'water proof' and 'Polyester' to the attribute 'Material'
4. Click 'save'.
It's that easy.
Since this is a very basic functionality of an eCommerce software, I didn't spend time to check how to implement it as extension. So I deeply integrated it in the opencart software. I've started a few months ago, so the opencart version is v1.4.7. I didn't test it with the newer ones, actually. But I think it should work, too.
Of course, I'm using the MVC pattern, so don't worry about bad code structure. But please let me know if there's anything I could do better.
WARNING!!!
Please do not use this mod for your running opencart installation. You should only use this mod in testing envs. I released this mod so that Daniel and others can discuss if this would be integrated in the future, since it's a very fundamental feature.
Please see the instructions.txt. I hope I made it clear how to install it. I might have not mentioned anything necessary, so please let me know if you couldn't manage to install.
Download http://www.rhcreativity.de/clients/prod ... ackage.zip
Attachments
Product Attribute List - Created Product Attributes.png (41.57 KiB) Viewed 8995 times
Applying Product Attributes on a product - Apply Product Attributes.png (36.66 KiB) Viewed 8995 times
Frontend Product Attributes - Frontend.png (27.71 KiB) Viewed 8995 times
Last edited by raffael on Sun Nov 21, 2010 9:46 pm, edited 1 time in total.
well There has been a product extra fields mod out for quite a while, and a mod made for 1.4.7 will not work for later versions because of the token system, also this functionality has already been added to the upstream for 1.5.0.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
I've been dying for this kind of a feature. Is there anyway to get additional fields up by the price, manufacturer, availability, etc. fields? This would really look so professional if I could add two to three fields.
Thank you,
Jared
Thank you,
Jared
Thanks for your interest.jcgadgets wrote:I've been dying for this kind of a feature. Is there anyway to get additional fields up by the price, manufacturer, availability, etc. fields? This would really look so professional if I could add two to three fields.
This mod has been written to implement the possibility to add any desired attribute to your product.
In my opinion, this is basic functionality and this is the gap, opencart developers have to close, in order to catch up ecommerce solutions like Magento. If I could provide any help to increase the development speed of 1.5.0. with my modification, I was really happy. The database model of the attributes is straight forward and consistent with the remaining database model design. The only thing that I have not been looking after is the token system.
No problem,raffael wrote:Thanks for your interest.jcgadgets wrote:I've been dying for this kind of a feature. Is there anyway to get additional fields up by the price, manufacturer, availability, etc. fields? This would really look so professional if I could add two to three fields.
This mod has been written to implement the possibility to add any desired attribute to your product.
In my opinion, this is basic functionality and this is the gap, opencart developers have to close, in order to catch up ecommerce solutions like Magento. If I could provide any help to increase the development speed of 1.5.0. with my modification, I was really happy. The database model of the attributes is straight forward and consistent with the remaining database model design. The only thing that I have not been looking after is the token system.
I actually ended up paying someone to do it (because I was even more of a novice at the time), and now there is a simple free contribution out here (just search the forums) that seems to work great.
However it is, I'm just really glad it is in the works for 1.5.0, as I was quite surprised to learn that this had to be custom coded in...
Thank you,
Jared
OK one question'
When & Where on the 1.5
I am a newbee for OC & have loaded several catagories & numerous products. I am now at the parts part of it , ........the parts of the parts so to speak . Without this I will have nothing. So again when & where. I thought this would of been a part of any cart db or . Now I am questioning OC as my ecommerce platform. Should I look elsewhere or wait. Help
When & Where on the 1.5
I am a newbee for OC & have loaded several catagories & numerous products. I am now at the parts part of it , ........the parts of the parts so to speak . Without this I will have nothing. So again when & where. I thought this would of been a part of any cart db or . Now I am questioning OC as my ecommerce platform. Should I look elsewhere or wait. Help
Version 1.4.7, 1.4.8, 1.4.9 - Not Working !
-----------
Admin - Catalog - Product - Edit -> "ERROR 500"
After adding:
Code: Select all
addProductAttribute is not defined
Admin - Catalog - Product - Edit -> "ERROR 500"
After adding:
Code: Select all
/*
* New Product Attributes
*/
$this->load->model('catalog/product');
if (isset($this->request->post['product_attributes'])) {
$this->data['product_attributes'] = $this->request->post['product_attributes'];
} elseif (isset($product_info)) {
$this->data['product_attributes'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']); // get the attributes and their values for this product
} else {
$this->data['product_attributes'] = array();
}
I use 1.4.7. I read the instructions. Controllers edit.
JavaScript Error "addProductAttribute is not defined"

Code: Select all
<td class="left"><a onclick="addProductAttribute();" class="button"><span>Add Product Attribute</span></a></td>


- Are you sure you have completed all steps of installation?
Hope you just forget to place it in the archive. Update and upload it plz.
P.S.
Have made js to this button, place in the end of product.tpl:
Code: Select all
<script type="text/javascript"><!--
var product_attribute_row = <?php echo $product_attribute_row++; ?>;
function addProductAttribute() {
html = '<tbody id="product_attribute_row' + product_attribute_row + '">';
html += '<tr>';
html += '<td class="left">';
html += '<select name="product_attribute[' + product_attribute_row+ '][id]">';
html += '<option value="product_attribute[' + product_attribute_row + '>][name]"><?=$choose_product_attribute?></option>';
html += '<?php foreach($all_product_attributes as $a_product_attribute) {?>';
html += '<option value="<?=$a_product_attribute['product_attribute_id']?>"><?=$a_product_attribute['name']?></option>';
html += '<?php } ?>';
html += '</select>';
html += '</td>';
html += '<td class="left">';
html += '<input type="text" name="product_attribute[' + product_attribute_row + '][value]" value="" /></td>';
html += '<td class="left"><a onclick="$(\'#product_attribute_row' + product_attribute_row + '\').remove();" class="button"><span><?php echo $button_remove; ?></span></a>';
html += '</td>';
html += '</tr>';
html += '</tbody>';
$('#product_attributes').append(html);
product_attribute_row++;
}
//--></script>
Next problem is that product_attribute.php in model folder has no functions to push data in to "product_to_product_attribute" table in DB where relation between product and his attributes are saved.

Who is online
Users browsing this forum: Majestic-12 [Bot] and 3 guests