Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Display Model Number on Category Page

Display Model Number on Category Page

Views: 3,096

Results 1 to 20 of 42
5 Jul 2012, 8:28 PM
#1
briandoakes avatar

briandoakes

New Zenner

Join Date:
Feb 2012
Posts:
28
Plugin Contributions:
0

Display Model Number on Category Page

Hello,
I have spent the past 3 hours searching how to display the model number on a category page underneath the product title.

I have found threads on adding model numbers to the shopping cart, product detail page, sideboxes, everything except the category page.

Can anyone point me in the right direction?

Thanks,
Brian

6 Jul 2012, 9:45 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Display Model Number on Category Page

Not exactly sure what you mean by the 'category page', but if it's the product listing, check Admin - Configuration - Product Listing - Display Product Model.

6 Jul 2012, 1:30 PM
#3
briandoakes avatar

briandoakes

New Zenner

Join Date:
Feb 2012
Posts:
28
Plugin Contributions:
0

Re: Display Model Number on Category Page

stevesh:

Not exactly sure what you mean by the 'category page', but if it's the product listing, check Admin - Configuration - Product Listing - Display Product Model.

Thank you for the response. Yes, I believe it is what you would call the product listing.

That was actually the very first thing I did, went to the Admin - Config - Product Listing - Display Product Model and changed that to 1 instead of 0. That however did not display the Model Number.

To preface, I am not a developer, Im more of a designer, although I can understand and manipulate code. I am working on a custom theme that someone else made, not the default Zen Cart. I came across a tutorial online that got me to the point of being able to display the Product ID by using the following code: $listing->fields['products_id'] but how can I translate that to show our actual product model number?

On our Product Detail Page, the Product Model Number displays

<!-- Begin Product Model Number -->
                  <div style="background-color:#96ccc5; border:1px solid #000;">
                            
							<!-- In Stock -->
							<?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
                                
                            <?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? TEXT_PRODUCT_MODEL  . $products_model : '') . "\n"; ?>
                             
                      		
                            <!-- Out of Stock -->
                            <?php
                            } else {
                            ?>
                            <?php echo '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>'; ?>
                            <?php echo '<li><table width="100%" border="1" cellspacing="0" cellpadding="0"><tr><td valign="middle" width="1%"><img src="images/arrow-images.jpg" alt="" width="44" height="50" /></td><td valign="middle" width="99%">Out Of Stock</td></tr></table></li>'; ?>
                            
                            <?php 
                                }
                            ?>
                     </div>       
               <!-- Begin Product Model Number -->

So Ive been stuck trying to figure out how to get that Model Number to display on the Product Listing.

Any help would be appreciated.

Thanks,
Brian

6 Jul 2012, 1:54 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Display Model Number on Category Page

briandoakes:

Thank you for the response. Yes, I believe it is what you would call the product listing.

That was actually the very first thing I did, went to the Admin - Config - Product Listing - Display Product Model and changed that to 1 instead of 0. That however did not display the Model Number.

This is the correct, STANDARD way of doing it.

If your site is not displaying the model number after you have toggled this "switch" then whoever designed/supplied your template has removed this function.

My guess is that you are using a TEMPLATE MONSTER template - in which case you need to contact them to ask how you re-instate this core function.

While you are at it, ask them what other functions they have removed (there are likely to be quite a lot, because TM is known to smash up ZC functionality quite badly).

6 Jul 2012, 1:58 PM
#5
briandoakes avatar

briandoakes

New Zenner

Join Date:
Feb 2012
Posts:
28
Plugin Contributions:
0

Re: Display Model Number on Category Page

Hi Schoolboy,
Thanks for the response...

Yeah, whether I turn it on or off, it will display the Product ID like 38,20, etc but not our own unique Model #.

It is not from Template Monster. The company I am at had a developer create it a while ago for them and we no longer are in contact with him.

Do you know of a way that I could re-instate this functionality? Since Model #s are displaying on our Product Detail Pages, Im thinking there's a way to do it. I just dont know how.

6 Jul 2012, 2:11 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Display Model Number on Category Page

Firstly, you need to see what he called the site's CUSTOM template.

Then, you need to FTP (to your computer), the entire INCLUDES folder. This will bring in ALL files (core and customized).

Then, in the following directories, you will need to find the CUSTOM TEMPLATE folders (they exist at various sub-levels in these folders, so drill down to see where they all are):

includes/languages
includes/modules
includes/templates

(A "custom template" will have "modified" files in all of these three main areas, so they all need to be looked at).

When you have a COPY of the full "includes" folder, you need to do FILE COMPARISONS with a copy of the ORIGINAL zencart files.

So... determine what VERSION of ZC your site is using (can be found out in the ADMIN area under TOOLS >>> SERVER/VERSION INFO), and then download a full copy of the Zc version software.

Next... get a copy of a GOOD file comparison package - like WINMERGE or BEYOND COMPARE

Then, using this file comparison system, COMPARE the CUSTOMISED versions of files, with their CORE ORIGINAL. Differences between the files will be highlighted.

In your case, I imagine it's mostly files in the templates folder(s) that have been smashed up, so you could concentrate on this area.

Look particularly at:

tpl_modules_product_listing.php

It will be in:

CORE VERSION:
includes/templates/template_default/tpl_modules_product_listing.php

CUSTOM VERSION
includes/templates/YOUR_CUSTOM-TEMPLATE/tpl_modules_product_listing.php

Then... do COMPARISONS for ALL template files by following the same pattern...

6 Jul 2012, 2:17 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Display Model Number on Category Page

If you find a depressingly large number of customised files, it is sometimes easier and faster to just load up a NEW template, and re-skin it to your existing template's design.

Another way to check TEMPLATE MODIFICATIONS is to temporarily "switch back" to the "classic" template, and load up the "problem page" again. This will show the page's CORE FUNCTIONS, because "classic" is a good "diagnostic tool" for seeking out template alterations.

If the page shows your desired behaviour, then the "fault" (or removed function) lays in the CUSTOM TEMPLATE setup - in which case, your focus for remedial action will concentrate on the custom template folder's files.

In SOME CASES, MODULE files may have been "adjusted", because certain "pages" have specific FUNCTIONS applied in their MODULE files.

It's a tedious task... but once cleaned up, your site should work in accordance with the way it was designed...

6 Jul 2012, 2:17 PM
#8
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Display Model Number on Category Page

I would switch temporarily to the Classic template and see if the model number appears. If so, you'll need to find the file the template designer removed that section from, possibly includes/modules/YOUR_TEMPLATE/product_listing.php.

A link to the site might let us spot something, too.

Edit: Must. Type. Faster.

6 Jul 2012, 2:19 PM
#9
briandoakes avatar

briandoakes

New Zenner

Join Date:
Feb 2012
Posts:
28
Plugin Contributions:
0

Re: Display Model Number on Category Page

Thank you for the very in-depth response. Much appreciated. As I mentioned... Im more of a designer than a programmer, so although I have been able to figure out how to manipulate the layout of my ZC Store and add some basic stuff, when it gets to the technical level you are discussing. It's gonna take me a while to figure out. LOL

I am relatively new to ZenCart and dont even know hot to switch back to classic template as you mentioned.

thank you though!

6 Jul 2012, 2:21 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Display Model Number on Category Page

Sorry... just looking at your earlier post...

You mention "Product ID numbers" and "Our product model numbers".

I am not clear of what you mean exactly, because in "zencart-speak" the ID is a unique incrementalised number added to a product record in the database. In general, this number is NOT displayed in the website.

The MODEL NUMBER is the SKU, or EAN, that YOU enter in the Products Model field when you ADD/EDIT a product via the admin panel.

Could it be that your developer BUILT a bespoke system for inserting YOUR OWN "Model Numbers" ???

If so, then a different approach is required.

6 Jul 2012, 2:25 PM
#11
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Display Model Number on Category Page

I hope your developer did not fiddle with the "classic" template... If he did he needs to be sent to the "Naughty Corner". :(

To switch templates:-

ADMIN >>> TOOLS >>> TEMPLATE SELECTION...
Click EDIT on the right-hand side...
From subsequent dropdown, select "Classic", click UPDATE...

Go to site and call up page...

Changing back is simply doing the above, but selecting your custom template again...

6 Jul 2012, 2:25 PM
#12
briandoakes avatar

briandoakes

New Zenner

Join Date:
Feb 2012
Posts:
28
Plugin Contributions:
0

Re: Display Model Number on Category Page

@Schoolboy.. CORRECT... when I say Product ID Numbers are displaying, it is showing the unique incremental number added to the product record in the DB.

Here you can take a look at the development site:
http://www.maxximastyle.com/devcur/led-night-lights/white-led-night-lights

See how right above the price, it is displaying numbers like 38, 20, 10, 14, 45, etc... those are the unique incremental numbers.

Taking the very first product in the top left and clicking through to it:
http://www.maxximastyle.com/devcur/led-night-lights/white-led-night-lights/maxxima-2-led-night-light-with-white-lens-pack-of-2

Our Model # is MLN-15WL-02 (right below Add To Cart), This is the Model # I would like to display on the previous products listing page instead of "38"

6 Jul 2012, 2:29 PM
#13
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Display Model Number on Category Page

Horrors... !

Your "developer" has committed the CARDINAL SIN and done direct edits to the CLASSIC template.

This is "firing squad" stuff...

Hunt him down and send him off to the vet for neutering (we don't want more of his genes in the genepool).

Hmmmm....

Fixing this may be a bit more complex... You may need to consider commercial assistance...

6 Jul 2012, 2:30 PM
#14
briandoakes avatar

briandoakes

New Zenner

Join Date:
Feb 2012
Posts:
28
Plugin Contributions:
0

Re: Display Model Number on Category Page

How can you tell he did direct edits to the classic template? In looking at the Template Selection Drop Down, there is only ONE option, which leads me to believe you are correct.

6 Jul 2012, 2:33 PM
#15
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Display Model Number on Category Page

When I call up your site in a browser, I look at the page SOURCE CODE and I see:

<link rel="stylesheet" type="text/css" href="includes/templates/classic/css/style_imagehover.css" /> <link rel="stylesheet" type="text/css" href="includes/templates/classic/css/stylesheet.css" /> <link rel="stylesheet" type="text/css" media="print" href="includes/templates/classic/css/print_stylesheet.css" /> <script type="text/javascript" src="includes/templates/classic/jscript/jscript_imagehover.js"></script>
6 Jul 2012, 2:35 PM
#16
briandoakes avatar

briandoakes

New Zenner

Join Date:
Feb 2012
Posts:
28
Plugin Contributions:
0

Re: Display Model Number on Category Page

oh. ugh... this sucks... lol i've actually made some headway in making changes to the site without knowing much about ZenCart.. but it's been a nightmare to say the least trying to make heads or tails of this mess.

So in theory, if i installed a fresh version of 1.39 somewhere and then looked at the code that generates the Model Number and tried to bring that into this existing mess, in theory it should work properly? Or is there more to it you think?

6 Jul 2012, 2:36 PM
#17
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Display Model Number on Category Page

There IS a way of CONVERTING your current CLASSIC template to a CUSTOM template, but the steps to do so are a bit too detailed to list here.

A few years ago I compiled a document (in MS Word) for one of our clients, outlining the procedure.

I'll see if I can find that doc - if so I will send it to you. (It may be on anther computer, and if it is, it may take some time to dig out).

6 Jul 2012, 2:41 PM
#18
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Display Model Number on Category Page

Well... it could be that your developer made one or two "minor" changes... or a whole HOST of changes... Impossible to tell at this point.

Unless there is a DESPERATE REASON to show model numbers on the product listing pages, just live with it for a while until you can tackle this on a more measured, planned process.

I would (at this stage) NOT advocate doing "fresh installs"... besides... this would NOT give you any indication of where the file system has been customised.

You can only find customisations using the WINMERGE process i describe above.

And you don't want to be doing radical fiddling with a live site... you want to do your diagnosis OFF-LINE... that is why I suggest you FTP the INCLUDES folder to your local machine - away from the web server - so you do not mess up stuff on the live site...

6 Jul 2012, 2:44 PM
#19
briandoakes avatar

briandoakes

New Zenner

Join Date:
Feb 2012
Posts:
28
Plugin Contributions:
0

Re: Display Model Number on Category Page

Yeah thats what I meant.. a fresh install on a local or separate server... NOT on our live site.. something where I can look at it and understand how it works then try to implement on our development site first and then maybe our live site.

6 Jul 2012, 2:46 PM
#20
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Display Model Number on Category Page

When you do the file comparisons, bear in mind that the files you need to be comparing will be in all folders called "classic".

I hope your developer did not edit CORE files (such as in template_default)... It could be that he HAS done this, in which case, after you take him to the Vet, introduce him to the guillotine...