Post by raffael » Wed Nov 17, 2010 7:53 pm

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

Attachments

Created Product Attributes.png

Product Attribute List - Created Product Attributes.png (41.57 KiB) Viewed 8995 times

Apply Product Attributes.png

Applying Product Attributes on a product - Apply Product Attributes.png (36.66 KiB) Viewed 8995 times

Frontend.png

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.

Newbie

Posts

Joined
Wed Jun 02, 2010 12:30 am

Post by scanreg » Wed Nov 17, 2010 10:40 pm

I tried the download link, didn't seem to work

Active Member

Posts

Joined
Thu May 06, 2010 12:15 am

Post by raffael » Sun Nov 21, 2010 9:45 pm

Make sure you have used the whole link:

http://www.rhcreativity.de/clients/prod ... ackage.zip

Newbie

Posts

Joined
Wed Jun 02, 2010 12:30 am

Post by Xsecrets » Sun Nov 21, 2010 10:59 pm

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


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by celestial » Tue Nov 23, 2010 1:28 am

Yes but the effort is good, thanks

Celestial - Martín Abel Rosales
WhatsApp: 50671482211
Email: martinrosales2012@hotmail.com
Skype: martin.abel.rosales
San José , Costa Rica


User avatar
Expert Member

Posts

Joined
Sat Mar 20, 2010 4:19 am
Location - Costa Rica

Post by jcgadgets » Fri Dec 03, 2010 1:31 pm

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

Active Member

Posts

Joined
Sun Oct 31, 2010 4:49 pm

Post by raffael » Sat Jan 29, 2011 5:48 pm

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.
Thanks for your interest.
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.

Newbie

Posts

Joined
Wed Jun 02, 2010 12:30 am

Post by jcgadgets » Sat Jan 29, 2011 5:54 pm

raffael wrote:
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.
Thanks for your interest.
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,

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

Active Member

Posts

Joined
Sun Oct 31, 2010 4:49 pm

Post by scanreg » Sat Jan 29, 2011 11:22 pm

Xsecrets wrote:this functionality has already been added to the upstream for 1.5.0.
Ah, so a large, blue sweater will be trackable as inventory in 1.5.0 perhaps?

Am I getting this right?

Thanks

Active Member

Posts

Joined
Thu May 06, 2010 12:15 am

Post by okmoocow » Mon Feb 21, 2011 8:23 am

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

Newbie

Posts

Joined
Sun Feb 20, 2011 11:17 pm

Post by legend717 » Wed Mar 02, 2011 6:21 pm

Version 1.4.7, 1.4.8, 1.4.9 - Not Working !

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();
}

User avatar
New member

Posts

Joined
Tue Sep 21, 2010 2:57 pm

Post by raffael » Fri Mar 04, 2011 6:22 pm

As I said, my mods are made for 1.4.7. Which version are you using?
Are you sure you have completed all steps of installation?
You could wait for 1.5.0. I think Daniel has been implementing this feature on his own.

Newbie

Posts

Joined
Wed Jun 02, 2010 12:30 am

Post by legend717 » Sat Mar 05, 2011 2:38 pm

I use 1.4.7. I read the instructions. Controllers edit.

Code: Select all

<td class="left"><a onclick="addProductAttribute();" class="button"><span>Add Product Attribute</span></a></td>
JavaScript Error "addProductAttribute is not defined"

Image

User avatar
New member

Posts

Joined
Tue Sep 21, 2010 2:57 pm

Post by tim21701 » Mon Mar 07, 2011 9:41 pm

in 1.4.9.3 is not working

User avatar
Newbie

Posts

Joined
Fri Feb 25, 2011 5:46 pm
Location - Russia, Murmansk

Post by mstron » Wed May 25, 2011 6:59 pm

Image
  • Are you sure you have completed all steps of installation?
In the Instruction and in files there are no javascript functions that is placed in the end of product.tpl. This functions adding new line with list box of attributes and etc.

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>
[/size]

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. :(

Newbie

Posts

Joined
Tue May 24, 2011 4:04 pm
Who is online

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