If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Display manufacturer instead of category on product page

Display manufacturer instead of category on product page

Locked

Started by justinae on 30 Nov 2007, 5:31 AM · Views: 1,499

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
30 Nov 2007, 5:31 AM
#1
justinae avatar

justinae

New Zenner

Join Date:
Nov 2007
Posts:
27
Plugin Contributions:
0

Post #1 by justinae

When I click on one of the products it displays the category as a link to products in that category. I want it, instead, to display the manufacturer with a link to all the products by that manufacturer.

Here is the url: http://www.pedxshoes.com/index.php?main_page=product_info&products_id=3

You can see where it says "Shoes". I want it to say "John Fluevog" which is the manufacturer. I turned on the "show manufacturer" in admin but that just puts a line in the description.

many thanx,
Justin

30 Nov 2007, 3:50 PM
#2
kitcorsa avatar

kitcorsa

Totally Zenned

Join Date:
Feb 2007
Posts:
1,724
Plugin Contributions:
0

Post #2 by kitcorsa

if you are maining the shoes link above the pic there is a way you can do this quite easyly.

in admin config/product display there is a button to turn product manufacture name on and off, turn this back on.

this will probally display the manufacture name at the bottom.

then you need to edit the file tpl_product_info_display in your temple file or default template file and move the code

<!--bof Product details list  -->
<?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))) ) { ?>
<ul id="productDetailsList" class="floatingBox back">
  <?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li>' . TEXT_PRODUCT_WEIGHT .  $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>'  : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?>
</ul>
<br class="clearBoth" />
<?php
  }
?>
<!--eof Product details list -->

to lines 30 or somewhere up to top of the listing.

thats a basic way of doing it.


30 Nov 2007, 3:55 PM
#3
kitcorsa avatar

kitcorsa

Totally Zenned

Join Date:
Feb 2007
Posts:
1,724
Plugin Contributions:
0

Post #3 by kitcorsa

you could also try just adding the code

  <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?>

to the top like above and see if that work, or if you still want the link to work make acobination of the exsisting link code and replace the code that brings in the text shoes and replace with the cide that brings in the manufactures name.

iv not tried this my self but you could try, just make a copy of the exsisting tpl_product_info_display file then you wont cock anyhing up as you can just delete the modiefed file and put the old on back


30 Nov 2007, 4:06 PM
#4
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

Post #4 by banswidthjunkie

With the standard template defaults there is no way to do this, so you will have to edit the code directly :smile:

In /includes/templates/YOURTEMPLATE/templates there should be a file called tpl_product_info_display.php. If it is not there copy the file from /includes/templates/template_default/templates into that directory, that will mean you can undo this without any hassle.

Now hackety, hack hack hack change the code around line 25 which says

<!--bof Category Icon -->
<?php if ($module_show_categories != 0) {?>
<?php
/**
 * display the category icons
 */
require($template->get_template_dir('/tpl_modules_category_icon_display.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_icon_display.php'); ?>
<?php } ?>
<!--eof Category Icon -->

to

<!--bof Category Icon -->
<?php if ($module_show_categories != 0) {?>
<?php
/**
 * display the category icons
 */
define( "SWITCH_CATEGORY_FOR_MANUFACTURER", true );

if( (int)$product_info->fields["manufacturers_id"] != 0 ) {
  $manufacturerLink = '<a href="' . zen_href_link( FILENAME_DEFAULT, 'manufacturers_id=' . $product_info->fields["manufacturers_id"] ) . '">' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</a>';
} else {
   $manufacturerLink = TEXT_PRODUCT_MANUFACTURER . "No manufacturer specified";
}

if( SWITCH_CATEGORY_FOR_MANUFACTURER ){?>
<div align="<?php echo $align; ?>" id="manufacturerName" class="manufacturerName"><?php echo $manufacturerLink; ?></div>
<?php
} else {
  require($template->get_template_dir('/tpl_modules_category_icon_display.php',DIR_WS_TEMPLATE, $current_page_base,  'templates'). '/tpl_modules_category_icon_display.php');
}}
?>
<!--eof Category Icon -->

Setting true to false in the code above reverts to default behaviour.

My ZenCart Mods: Define Pages Generator | Fual Slimbox (Lightbox)
A site I did for a mate: http://richard-moon.co.uk/

30 Nov 2007, 4:30 PM
#5
kitcorsa avatar

kitcorsa

Totally Zenned

Join Date:
Feb 2007
Posts:
1,724
Plugin Contributions:
0

Post #5 by kitcorsa

lol i was just playing around with that code above but you beat me to it


1 Dec 2007, 5:17 AM
#7
justinae avatar

justinae

New Zenner

Join Date:
Nov 2007
Posts:
27
Plugin Contributions:
0

Post #7 by justinae

wow. great responses. Thank you so much. worked perfectly.