X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Manufacturers with icons on customer_manufacturers_list.tpl (https://forum.x-cart.com/showthread.php?t=12024)

mffowler 02-07-2005 07:12 PM

Manufacturers with icons on customer_manufacturers_list.tpl
 
To get the manufacturer icons to show up in the manufacturers list (not the menu- the full page) was pretty simple, but getting them into columns was not that easy ... so I based it on the subcategories table and the manufacturers menu. The code below does not have the title or dialog.tpl, but you can add that in ...

Just change the 4 in
Code:

{ if %mid.index% is div by 4}
to the number of columns that you desire: 2, 3 etc. and replace the following templates code with:

Modules/Manufacturers/customer_manufacturers_list.tpl:
Code:

{* $Id: customer_manufacturers_list.tpl,v 1.3 2004/05/28 12:21:10 max Exp $ *}



{capture name=dialog}
{assign var="tmp" value="0"}
{section name=mid loop=$manufacturers}
{if $manufacturers[mid].manufacturerid}{assign var="tmp" value="1"}{/if}
{/section}

{section name=mid loop=$manufacturers}
{ if %mid.first% }
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
{/if}
{ if %mid.index% is div by 4}
<tr>
{/if}
<td align="center" valign="middle">
      <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" border="0"><tr><td height="70">
[img]mlogo.php?manufacturerid={$manufacturers[mid].manufacturerid}[/img]</td></tr>
<tr><td align="center" valign="middle">
<font size="3">{$manufacturers[mid].manufacturer}</font></td></tr></table>


</td>
{ if %mid.last% }
</tr>
</table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" content=$smarty.capture.dialog extra="width=100%"}

I then changed the {include} statement in /modules/Manufacturers/menu_manufacturers.tpl to:
Code:

{include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_manufacturers menu_content=$smarty.capture.menu link_href="manufacturers.php"}
so that it would link to the manufacturers page (the same way "Help" does). It is not based on the quantity of manufacturers enabled in General Settings/Module Options, so all of your manufactureres are included. Also, if you deactivate any in the manufacturers settings, then they will be deactivated ...

If anyone has any improvements to this, I would love to incorporate them.

- Mike

fearnothing 07-12-2005 03:06 PM

Mike - Great mod! Thanks for that!

There was a problem with the last include where it should be dialog.tpl rather than dialog_home.tpl for most installations but that is a very minor gripe and easy to sort out.

Just what I was looking for!

If you have any other mods relating to manufacturers that would want to post I'd be interested as I am planning to use this module extensively when my store goes live.

FN

bluecat 07-12-2005 08:52 PM

Excellent, and exactly what I needed. Thank you! Thanks also fearnothing, and for the non-experts like me, change the following in the code to work (near bottom):

Quote:

it should be dialog.tpl rather than dialog_home.tpl

bluecat 07-12-2005 08:59 PM

Again, thank you.

Would anyone know how to make it so only the "image" logo and "description" shows up? Right now, it's the image, and the manufacturer name under the image. So it would look like this:

.gif image

explanation of the product, etc... explanation of the product, etc... explanation of the product, etc...

Thank you.

hyratech 07-31-2005 04:37 PM

My /modules/Manufacturers/customer_manufacturers_list.tpl
Does not contain all those codes.. which like do I change and what do I add?
Sound like an idiot huh? but please help me. :-)

If i just copy the code above to my file, will it work?

hyratech 07-31-2005 04:49 PM

Damn.. I am an Idiot! I Am suppose to copy the codes.. haha.

while i'm at it.. how do I make the name of the manufacture to center it?
now it's like this

IMAGE
Long Manufactuere Name

How do i make to look like this:

....IMAGE.....
Manufacturer

fearnothing 08-01-2005 09:21 AM

hyratech - I wrapped the logo and link in <DIV> tags like this:

<div align="center">
[img]mlogo.php?manufacturerid={$manufacturers[mid].manufacturerid}[/img]
</div>

The other change was to take out the <font size="3"> ... </font> tags to make the link a little less overpowering :)

hyratech 08-01-2005 09:59 AM

I'm a newbee, can u be a little more specific... like where and what file... thanx

fearnothing 08-01-2005 10:12 AM

Sorry ... I'm a newbie myself in everything but what it says on the left of this page!

In the original code above in Modules/Manufacturers/customer_manufacturers_list.tpl you''ll see this line about three-quarters of the way down:

<tr><td align="center" valign="middle">

insert a new line of code in after that line like this:

<div align="center">

then look for the closing </A> tag which is in the fourth line down after that new line you have just entered, and after the tag put </div>

so now the line in question should look like this:

[/b]</font></A></div></td></tr></table>



Changing the font size is an optional nicety - I would try this first and make sure it works for you.

Davidh 06-12-2006 02:59 AM

Another great mod, just installed myself thanks, however one quick question.

The images are being pulled from the databse rather than file system, is it possible to change this like the category icons?


All times are GMT -8. The time now is 04:15 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.