Zen Cart Logo

Internal part numbers

Views: 2,749

Results 1 to 20 of 20
6 Dec 2013, 5:59 PM
#1
jimdanforth avatar

jimdanforth

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Internal part numbers

I need a way to create an additional product field that holds an internal product number. Needs to be searchable from customer front-end but not display the part number.
Basically, I have supplier's part numbers and sometimes customers call with that info. If I could search from the front-end it would save time.
Secondly, I need that same number to display on the order edit page, since sometimes I need to order from my supplier by that number.
I looked at the "products extra fields" plug in but I'm not sure that one goes where I need it. 1 field is enough though.

6 Dec 2013, 6:08 PM
#2
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Internal part numbers

Hi jimdanforth,
Can you post a complete list of each of the pages you'd like the new part number to appear on?

Twitch List Price shows in a variety of places in admin and the cart, Twitch Base Price only shows in admin... I can modify the base code to do what you want and be searchable :)

6 Dec 2013, 6:38 PM
#3
jimdanforth avatar

jimdanforth

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Internal part numbers

sounds like the base is the closest to the one I need.
Searchable in front-end
displays in admin edit/create product
displays in admin edit order

6 Dec 2013, 6:46 PM
#4
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Internal part numbers

jimdanforth:

I need a way to create an additional product field that holds an internal product number. Needs to be searchable from customer front-end but not display the part number. ...
Are you saying if the customer does a search online using your internal product number you do NOT want them to be brought to your website? Hmm...

6 Dec 2013, 6:56 PM
#5
jimdanforth avatar

jimdanforth

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Internal part numbers

That is incorrect. I want the search to return the correct item, just not display the internal(supplier) number onscreen. At least in clear text.

6 Dec 2013, 7:00 PM
#6
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Internal part numbers

lhungil:

Are you saying if the customer does a search online using your internal product number you do NOT want them to be brought to your website? Hmm...

I believe the intent is similar to this scenario:
Lets say you search for 'car starter' on the following websites and they display these model numbers:

dealershipparts.com - model #0009

coolcarparts.com - model #1234

jimdanforth.com - model #800-010

Technically the product can have all three part numbers together or separately listed in the database, only jimdanforth - model #800-010 shows.

I've done this... it works like magic.

I'll get working on this code later today jimdanforth. How many characters would you like the new field to hold?

6 Dec 2013, 7:03 PM
#7
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Internal part numbers

Most search engines will not index "hidden" data anymore (or may consider it a blackhat technique), so you would need to actually display the "internal" product number on your product pages if you want customers to be able to search online (not just on your website).

6 Dec 2013, 7:04 PM
#8
jimdanforth avatar

jimdanforth

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Internal part numbers

I think we're thinking alike :)
So on jimdanforth.com you can search 0009 and it will return 800-010, or search 1234 and still get 800-010
My current longest part number is 9, so let's shoot for 10 digits, alphanumeric.

6 Dec 2013, 7:05 PM
#9
jimdanforth avatar

jimdanforth

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Internal part numbers

ihungil,

no too worried about google, etc for this search. Just internal. Helps me audit when a supplier publishes a new catalog too.

6 Dec 2013, 7:35 PM
#10
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Internal part numbers

Okay, just wanted to make sure :)

7 Dec 2013, 9:46 PM
#11
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Internal part numbers

Jimdanforth... It's ready, right on time I might add...!

I've submitted the complete ZC Plugin here:
http://www.zen-cart.com/downloads.php?do=file&id=1794

And created a new thread here:
http://www.zen-cart.com/showthread.php?211279-Twitch-Hidden-Searchable-Model-Number

In the meantime screenshots and the complete package are available on my site.

21 Jan 2014, 9:49 PM
#12
jimdanforth avatar

jimdanforth

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Internal part numbers

I think I have a database naming problem. The SQL command:
ALTER TABLE products ADD products_model_spoon VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER products_model
fails with a response:
#1146 - Table 'tractor_zc2.products' doesn't exist
Username on this account is tractor. I was able to run the command
ALTER TABLE zen_products ADD products_model_spoon VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER products_model
But all admin pages that touch a product fail.

21 Jan 2014, 11:24 PM
#13
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Internal part numbers

jimdanforth,

  • What version of ZenCart are you using?

  • What prefix are you using in your database?

  • Where did you attempt to run the SQL update - Admin-> Tools-> Install SQL Patches or with phpmyadmin/other SQL utility?

The SQL code is attempting to change the table 'products' by adding the column 'products_model_spoon' after the column 'products_model'

The error suggests you used Admin ->Install SQL Patches and it attempted to add the table prefix 'tractor_zc2.'

21 Jan 2014, 11:42 PM
#14
jimdanforth avatar

jimdanforth

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Internal part numbers

1.5.1
zen_
I tried from both phpmyadmin (old habit) and from within zencart. From within it just says "failed" at the top with no other info.

22 Jan 2014, 2:23 AM
#15
jimdanforth avatar

jimdanforth

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Internal part numbers

I do have the column when looking in phpmyadmin. I'm sure from the command :
ALTER TABLE zen_products ADD products_model_spoon VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER products_model
Do I need to edit all those pages that are trying to call product_model_spoon from products instead of zen_products?

22 Jan 2014, 4:35 AM
#16
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Internal part numbers

I'm uncertain why your db required the prefix in the command, perhaps your configure.php files are missing the line:
define('DB_PREFIX', 'zen_');

If you have a column 'products_model_spoon' in your 'products' table then all of the code will work as planned. No need to make any code changes to any of your pages.

22 Jan 2014, 4:46 AM
#17
jimdanforth avatar

jimdanforth

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Internal part numbers

Yes, the column exists in the table. However, as soon as I change the orders.php in admin to the one in your zip file, I get errors and it will not load the page. Same thing with the item edit pages. I had to roll most everything (except database) so I could process orders.

Thanks for so much help.

22 Jan 2014, 4:57 AM
#18
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Internal part numbers

I've installed this package 8 times now on stock 1.51 ZenCart installs, no errors.

Are you merging the package files with your existing files?

Without seeing the errors/code it sounds like you have other modules installed that don't like the placement of the new field.

22 Jan 2014, 5:12 AM
#19
jimdanforth avatar

jimdanforth

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Internal part numbers

I am replacing my files with the ones included in the zip package. Is that not correct?

22 Jan 2014, 5:17 AM
#20
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Internal part numbers

jimdanforth:

I am replacing my files with the ones included in the zip package. Is that not correct?

Always merge them, WinMerge works nicely, there are other file comparison programs out there.