Post by Xsecrets » Tue Jun 08, 2010 9:35 pm

I have a product extra field contribution that allows you to create the extra fields from the backend. It does take quite a bit of editing to install it though unless you are running a completely base install.

you can find it Here

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 Qphoria » Tue Jun 08, 2010 9:50 pm

I had some early ideas to have new table called "additional_fields" where you could have a dynamic add box that would be for custom fields for all pages on a per-product basis.

Quick example:
db table: additional_fields
controller, id, key, value, language_id
product, 53, special shipping notes, This product cannot be shipped to Mars, 1
product, 53, temperature, This product can reach 1000 degrees, 1
product, 54, Lace-style, Laces Out, 1
customfields.jpg

customfields.jpg (19.59 KiB) Viewed 2516 times

But there are many ways to do it so its not been fine tuned or even discussed for a core level change at this time.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by timkirtley » Tue Jun 08, 2010 10:04 pm

Okay,

Contribution looks interesting, I'll have a look.. Obiously not asking for a full breakdown, but how much 'adjusting' is the plug-in going to need as the template for my store is very slimmed down..?

Again, coming from my experience with magento, a couple questions about custom fields. Is it only possible to create text input fields for the back end, what about checkboxes? Is it easy to reference these newly created fields in the product template and create conditional statements depending on the value of the fields?

Thanks again.

New member

Posts

Joined
Fri Jun 04, 2010 7:01 am

Post by timkirtley » Wed Jun 09, 2010 5:32 pm

Yeah, Qphoria.. something along those lines would be useful.. I guess ideally, you would be able to create these Custom Fields for an individual product, or create a global custom field that is applicable to every product.

So, do you think you'll be able to have this functionality built in by the end of today?

Only kidding. I'm happy to give it a go using the information in the previous posts.. In order to get these custom fields available in the back end I'm going to have to edit files for the admin section, which are core files right? Does this mean any changes I make here will be overwritten if I update to future versions? Is this unavoidable?

New member

Posts

Joined
Fri Jun 04, 2010 7:01 am

Post by Xsecrets » Wed Jun 09, 2010 9:13 pm

Yes the extra fields module does have quite a few core file edits. Actually pretty much the whole thing, but unfortunately as you said at this point it's unavoidable. The extra fields contribution is only displayed to the customer it is not an option that the customer can choose. There is a commercial module out there that adds checkbox file and text options that the customer can choose.

As for the template portion of the extra fields contribution. It's fairly simple. It adds the extra fields in a tab with the current instructions, but you could easily just put the loop anywhere on the page you want. If you understand html/php enough to change the template it should be fairly obvious how I'm adding the extra fields and move them around.

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 timkirtley » Wed Jun 09, 2010 9:21 pm

Okay cool..

No actually I was interested in using checkboxes in the admin section. I want to use checkboxes so the end user of the store can switch promotional banners on and off for their product from the backend.

New member

Posts

Joined
Fri Jun 04, 2010 7:01 am

Post by kronos » Sat Jul 03, 2010 4:52 am

I would love to see Custom Field support in Open Cart.

Newbie

Posts

Joined
Sat Jul 03, 2010 4:51 am

Post by crazykiddo » Wed Jul 17, 2013 4:13 pm

I've tried the method above for oc 1.5.5.1 but it doesn't work

I add a field in my sql and added some colors like red, blue, orange. In my OC admin the things won't update once I change the color to another since I have in typed out in sql. What could be the reason behind this?

I try everything but nothing seems to work. So this is all it shows.

Got this to show up on my product page but that's it. I type red but nothing shows up on pp. Except
Color:

If I submit this I get the error listed below. I have the table in my sql with the condition typed in sql.
public function editProduct($product_id, $data)" 121
color = '" . $this->db->escape($data['color']) . "',

I get an error when submitting
Error shows up as a zero
0

Any Ideas how to go on adding a field without the error and how to get the color?
I want it to have Color: Red but it's Color: (blank) on product page

Newbie

Posts

Joined
Sat Jun 22, 2013 10:32 am

User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore
Who is online

Users browsing this forum: No registered users and 51 guests