X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Need manufacturer link to open in new window (https://forum.x-cart.com/showthread.php?t=12059)

Danielle 02-09-2005 10:09 AM

Need manufacturer link to open in new window
 
When customers are in my store, and click on a manufacturer in the Manufacturer list, that manufacturer's logo and products come up. The logo is clickable and takes the customer directly to their website. I just want this website to open in a new window. I know how to do this, but not where! Which file do I add the code to?

Thanks!

Danielle 02-09-2005 10:18 AM

Nevermind, figured it out!

Bella Forma 02-09-2005 10:37 PM

Could you tell us what you did :)

Danielle 02-09-2005 10:43 PM

Oh sure...lol! I always forget that it would be good to post the solution!

OK, go to Modules/Manufacturers/customer_manufacturer_products.tpl.

I am just going to cut and paste my code and bold the changes, I think that is the easiest way to show what I did...

Quote:

{* $Id: customer_manufacturer_products.tpl,v 1.3.2.2 2004/10/13 11:21:45 max Exp $ *}
{if $manufacturer.image ne '' || $manufacturer.descr ne '' || $manufacturer.url ne ''}
<TABLE border="0">
<TR>
{if $manufacturer.image ne ''}
<TD valign="top">{if $manufacturer.url ne ''}{/if}[img]{$xcart_web_dir}/mlogo.php?manufacturerid={$manufacturer.manufactur erid}[/img]{if $manufacturer.url ne ''}{/if}</TD>
{elseif $manufacturer.url ne ''}
<TD>{$lng.lbl_url}: {$manufacturer.url}</TD>
</TR>
<TR>
{/if}
<TD valign="top">{$manufacturer.descr|escape}</TD>
</TR>
</TABLE>


{/if}
{capture name=dialog}
{if $products ne ''}
{if $sort_fields}
<DIV align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields selected=$search_prefilled.sort_field direction=$search_prefilled.sort_direction}</DIV>


{/if}
{ include file="customer/main/navigation.tpl" }
{include file="customer/main/products.tpl" products=$products}
{else}
{$lng.txt_no_products_in_man}
{/if}
{/capture}
{include file="dialog.tpl" title=$manufacturer.manufacturer content=$smarty.capture.dialog extra="width=100%"}
{ include file="customer/main/navigation.tpl" }


Bella Forma 02-09-2005 10:45 PM

Excellent thank you was just what I was looking for.

Last think I want is my customers leaving my shop for the manufacturers website!

Off to try it now :)

Danielle 02-09-2005 10:48 PM

I know!!! I can't believe that wasn't just built in! I just discovered it and had to get it fixed!

Bella Forma 02-19-2005 12:28 AM

Worked perfectly thanks Danielle :)

Danielle 02-19-2005 06:54 AM

No problem I'm glad it worked for you!

buck 07-09-2007 05:59 PM

Re: Need manufacturer link to open in new window
 
Hi Danielle,

I tried to incorporate in my code, but it didn't work. Here is my code. Can you tell why it won't work for me?

Code:

{* $Id: customer_manufacturer_products.tpl,v 1.12 2005/12/29 08:43:52 max Exp $ *}
{if $manufacturer.is_image eq 'Y' || $manufacturer.descr ne '' || $manufacturer.url ne ''}
<table>
<tr>
{if $manufacturer.is_image eq 'Y'}

{* NEW CODE*}
<TD valign="top">{if $manufacturer.url ne ''}{/if}[img]{$xcart_web_dir}/mlogo.php?manufacturerid={$manufacturer.manufactur erid}[/img]{if $manufacturer.url ne ''}{/if}</TD>
{elseif $manufacturer.url ne ''}
<TD>{$lng.lbl_url}: {$manufacturer.url}</TD>
{* END NEW CODE*}

{* replaced code to open new window with manufacturer's logo
    <td valign="top">{if $manufacturer.url ne ''}<a href="{$manufacturer.url}">{/if}<img src="{if $manufacturer.image_path ne ''}{$manufacturer.image_path}{else}{$xcart_web_dir}/image.php?id={$manufacturer.manufacturerid}&amp;type=M{/if}" alt="{$manufacturer.manufacturer|escape}" />{if $manufacturer.url ne ''}</a>{/if}</td>
{elseif $manufacturer.url ne ''}
    <td>{$lng.lbl_url}: <a href="{$manufacturer.url}">{$manufacturer.url}</a></td>
*}

</tr>
<tr>
{/if}
    <td valign="top">{$manufacturer.descr}</td>
</tr>
</table>
<br />
{/if}
{capture name=dialog}
{if $products ne ''}
{if $sort_fields}
<div align="right">{include file="main/search_sort_by.tpl" url="manufacturers.php?manufacturerid=`$manufacturer.manufacturerid`&page=`$navigation_page`&" sort_fields=$sort_fields selected=$sort direction=$sort_direction}</div>
<br />
{/if}
{ include file="customer/main/navigation.tpl" }
{include file="customer/main/products.tpl" products=$products}
{else}
{$lng.txt_no_products_in_man}
{/if}
{/capture}
{include file="dialog.tpl" title=$manufacturer.manufacturer content=$smarty.capture.dialog extra='width="100%"'}
{ include file="customer/main/navigation.tpl" }



thank you,
Kara

Quote:

Originally Posted by Danielle
Oh sure...lol! I always forget that it would be good to post the solution!

OK, go to Modules/Manufacturers/customer_manufacturer_products.tpl.

I am just going to cut and paste my code and bold the changes, I think that is the easiest way to show what I did...


buck 07-09-2007 06:45 PM

Re: Need manufacturer link to open in new window
 
I found the solution: The following HTML code will enable you to open all of your links in a new window. Place this code between your <HEAD> and </HEAD> tags in your /customer/home.tpl
<base target="main">


All times are GMT -8. The time now is 01:19 PM.

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