Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Display manufacturer logo in product.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-24-2006, 02:49 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,471
 

Default Display manufacturer logo in product.tpl

Hello ...

Is it possible to display the manufacturers logo within the product details page (product.tpl) for the selected product.

Thanks & Regards

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #2  
Old 05-24-2006, 02:50 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

http://forum.x-cart.com/viewtopic.php?t=11767
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 05-24-2006, 07:22 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,471
 

Default

Thanks ...

I got around it .. but required a little tweaking for it to work in version 4.1.0:


Added the following code within product.php:
Quote:
$thisManufactorer = $product_info["manufacturerid"];
$manufacturer = func_query("SELECT xcart_manufacturers.*, xcart_images_m.image_path, xcart_images_m.filename FROM xcart_manufacturers, xcart_images_m WHERE xcart_manufacturers.manufacturerid = xcart_images_m.id AND manufacturerid = $thisManufactorer");
$smarty->assign("manufacturer", $manufacturer[0]["manufacturer"]);
$smarty->assign("m_image_path", $manufacturer[0]["image_path"]);

And then added the following within product.tpl
Quote:
{if $m_image_path ne ""}
[img]{$m_image_path}[/img]{/if}
{/if}

Regards


Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #4  
Old 08-20-2008, 03:38 AM
  version's Avatar 
version version is offline
 

Member
  
Join Date: Aug 2008
Posts: 23
 

Default Re: Display manufacturer logo in product.tpl

can this be done easily in 4.1.10 ?

Is there a nice free module or some additional core function available?
__________________
SouqBazaar
Reply With Quote
  #5  
Old 08-20-2008, 04:00 AM
  Piotr M.'s Avatar 
Piotr M. Piotr M. is offline
 

Senior Member
  
Join Date: Aug 2008
Posts: 134
 

Default Re: Display manufacturer logo in product.tpl

Quote:
Originally Posted by version
can this be done easily in 4.1.10 ?

Is there a nice free module or some additional core function available?
Yes. This can be done in 4.1.10 the same way as shown above.
__________________
Regards,
Piotr Markushin

X-Cart PDF Catalog Generator NEW
Professional X-Cart Skins Store (7 new skins added in August 2008!)

ahedOffice.com - Web 2.0 Online Groupware
Reply With Quote
  #6  
Old 08-20-2008, 04:21 AM
  version's Avatar 
version version is offline
 

Member
  
Join Date: Aug 2008
Posts: 23
 

Default Re: Display manufacturer logo in product.tpl

Do you think it's not working for me because of the typo ?

$thisManufactorer <-

$thisManufacturer ?? how are we supposed to use code with variable variables?
__________________
SouqBazaar
Reply With Quote
  #7  
Old 08-20-2008, 04:38 AM
  Piotr M.'s Avatar 
Piotr M. Piotr M. is offline
 

Senior Member
  
Join Date: Aug 2008
Posts: 134
 

Default Re: Display manufacturer logo in product.tpl

Quote:
Originally Posted by version
Do you think it's not working for me because of the typo ?

$thisManufactorer <-

$thisManufacturer ?? how are we supposed to use code with variable variables?

There is the same variable name in SQL query.
But table name is case sensitive.
So right php code is
PHP Code:
$thisManufactorer $product_info["manufacturerid"];
$manufacturer func_query("SELECT xcart_manufacturers.*, xcart_images_M.image_path, xcart_images_M.filename FROM xcart_manufacturers, xcart_images_M WHERE xcart_manufacturers.manufacturerid = xcart_images_M.id AND manufacturerid = $thisManufactorer");
$smarty->assign("manufacturer"$manufacturer[0]["manufacturer"]);
$smarty->assign("m_image_path"$manufacturer[0]["image_path"]); 

tpl code to show manufacturer logo
Code:
{if $m_image_path ne ""} <img src="{$m_image_path}" />{/if}
__________________
Regards,
Piotr Markushin

X-Cart PDF Catalog Generator NEW
Professional X-Cart Skins Store (7 new skins added in August 2008!)

ahedOffice.com - Web 2.0 Online Groupware
Reply With Quote
  #8  
Old 08-20-2008, 05:08 AM
  version's Avatar 
version version is offline
 

Member
  
Join Date: Aug 2008
Posts: 23
 

Default Re: Display manufacturer logo in product.tpl

couldn't someone add a function to the core of X-Cart like:

get_manufacturers_image();

these functions are pretty standard in most free systems - eg wordpress, which is so easy to customise compared to X-Cart

why are these convenient functions noticably absent from x-cart?

also the manufacturers module is not really worthy of the term module is it?

shouldn't there be a few more options like:
• show manufacturers logo on product pages √
• show next / previous product navigation by same manufacturer √
• show related manufacturers √ (if part of same parent company)
• show plain word link below logo √
etc...

Where are these options? - why aren't they standard?
__________________
SouqBazaar
Reply With Quote
  #9  
Old 08-20-2008, 05:58 AM
  version's Avatar 
version version is offline
 

Member
  
Join Date: Aug 2008
Posts: 23
 

Default Re: Display manufacturer logo in product.tpl

I don't know much php but this looks like relevant code?

$manufacturer['image_path'] = func_get_image_url($manufacturerid, "M", $manufacturer['image_path']);


So can anyone tell me how to get the url to the manufacturer for a given product?

I've got the logo displaying - but i want it to be an active link (why wouldn't I????)

I just need to get the $manufacturerid variable to work (this example below is for a plain text link - not the logo version / but easily transferable)

HTML Code:
<a href="manufacturers.php?manufacturerid={$manufacturerid}">{$manufacturer}</a><br />

what am i doing wrong here?

Thanks
__________________
SouqBazaar
Reply With Quote
  #10  
Old 08-20-2008, 06:24 AM
  Piotr M.'s Avatar 
Piotr M. Piotr M. is offline
 

Senior Member
  
Join Date: Aug 2008
Posts: 134
 

Default Re: Display manufacturer logo in product.tpl

The code below shows manufacturer logo as active link. If there is no logo, it shows manufacturer name.
Modified PHP:
PHP Code:
$thisManufactorer $product_info["manufacturerid"]; 
$manufacturer func_query("SELECT xcart_manufacturers.*, xcart_images_M.image_path, xcart_images_M.filename FROM xcart_manufacturers, xcart_images_M WHERE xcart_manufacturers.manufacturerid = xcart_images_M.id AND manufacturerid = $thisManufactorer"); 
$smarty->assign("manufacturer"$manufacturer[0]); 
$smarty->assign("m_image_path"$manufacturer[0]["image_path"]); 
TPL
Code:
<a href="manufacturers.php?manufacturerid={$manufacturer.manufacturerid}"> {if $m_image_path ne ""} <img src="{$m_image_path}" />{else}{$manufacturer.manufacturer}{/if}</a>
__________________
Regards,
Piotr Markushin

X-Cart PDF Catalog Generator NEW
Professional X-Cart Skins Store (7 new skins added in August 2008!)

ahedOffice.com - Web 2.0 Online Groupware
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:26 AM.

   

 
X-Cart forums © 2001-2020