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

get manufacture in products.php

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 10-26-2004, 09:10 AM
  jds580s's Avatar 
jds580s jds580s is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 38
 

Default

For anyone else reading this I made one other small change and it is working like a charm

in products(_t).tpl I change the code to
Code:
{*** ########## Lines below to display manufacture name ########## ***} {assign var="manid" value=$products[product].manufacturerid} {if $manufacturers[$manid].manufacturerid ne "0"} {$manufacturers[$manid].manufacturer} {/if} {*** ########## End display manufacture name ########## ***}

Before it was returning manufacture name based on the current loop number. And not it doesn't display anything if there is no manufacture set for a product.

Thanks pmstudios for all the help!
__________________
animator for hire
onthez.com
------------------------
x-cart v4.0.5 Linux
_________________
Reply With Quote
  #12  
Old 10-27-2004, 06:31 AM
 
TheComputerGuy TheComputerGuy is offline
 

Member
  
Join Date: Aug 2004
Posts: 21
 

Default

Ok, i'm also interested to display the Manufacture, but instead of the Products (customer/main/products.tpl) I want to display it on the actual Product Page (customer/main/product.tpl).

All I want to do is have is something as simple as:

Manufacture: Sony

Can some please help with what code to insert into the template file?

Thank you...
__________________
Chris Dildy
Reply With Quote
  #13  
Old 10-27-2004, 07:10 AM
 
pmstudios pmstudios is offline
 

Senior Member
  
Join Date: May 2004
Posts: 133
 

Default

Quote:
Originally Posted by TheComputerGuy
Ok, i'm also interested to display the Manufacture, but instead of the Products (customer/main/products.tpl) I want to display it on the actual Product Page (customer/main/product.tpl).

In product.php, near the bottom (add lines marked with +)
Code:
$smarty->assign("product",$product_info); + $manufacturer = func_query_first("SELECT manufacturer FROM $sql_tbl[manufacturers] WHERE manufacturerid='$product_info[manufacturerid]'"); + $smarty->assign("manufacturer", $manufacturer);

In customer/product.tpl, use {$manufacturer.manufacturer} to display it...
__________________
X-Cart 4.0.5
MySQL: 3.23.58
PHP 4.3.2
Reply With Quote
  #14  
Old 10-27-2004, 11:33 PM
 
TheComputerGuy TheComputerGuy is offline
 

Member
  
Join Date: Aug 2004
Posts: 21
 

Default

thank you very much! Works a charm

i just don't understand why that option wasn't standard.
__________________
Chris Dildy
Reply With Quote
  #15  
Old 10-29-2004, 10:37 AM
 
genekurtz genekurtz is offline
 

eXpert
  
Join Date: Jun 2003
Location: US
Posts: 223
 

Default

In customer/product.tpl, use {$manufacturer.manufacturer} to display it...


Where do I place {$manufacturer.manufacturer} within the code of the customer/main/product.tpl page? Do I need to put it within any other code?
__________________
Gene Kurtz
The Perfect Game
http://www.perfectgame.biz
866-318-BOWL
Reply With Quote
  #16  
Old 10-29-2004, 10:42 AM
  jds580s's Avatar 
jds580s jds580s is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 38
 

Default

That shouldn't need to go any place in particular.

Typically it would be between the {capture} and {/capture} near the top and bottom of the file
__________________
animator for hire
onthez.com
------------------------
x-cart v4.0.5 Linux
_________________
Reply With Quote
  #17  
Old 10-29-2004, 10:48 AM
 
pmstudios pmstudios is offline
 

Senior Member
  
Join Date: May 2004
Posts: 133
 

Default

Quote:
Originally Posted by genekurtz
Where do I place {$manufacturer.manufacturer} within the code of the customer/main/product.tpl page? Do I need to put it within any other code?

You can put it anywhere. The product info page is product specific, so the script selects the manufacturer of that product.
__________________
X-Cart 4.0.5
MySQL: 3.23.58
PHP 4.3.2
Reply With Quote
  #18  
Old 10-29-2004, 10:51 AM
 
genekurtz genekurtz is offline
 

eXpert
  
Join Date: Jun 2003
Location: US
Posts: 223
 

Default

OK

You have to place it within the template at the spot on the page where you want it to show up. If you place it at the bottom of product.tpl it will show up after all of the other tables on the page.

It works great!

Thanks
__________________
Gene Kurtz
The Perfect Game
http://www.perfectgame.biz
866-318-BOWL
Reply With Quote
  #19  
Old 10-29-2004, 11:04 AM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default

That did work great. Just what I wanted.....except.. I would like to also add the SKU in the same place...product.tpl.

Can anyone give me the code to add?

Thanks,

Dalmuti
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
  #20  
Old 10-29-2004, 11:20 AM
 
pmstudios pmstudios is offline
 

Senior Member
  
Join Date: May 2004
Posts: 133
 

Default

Quote:
Originally Posted by dalmuti
That did work great. Just what I wanted.....except.. I would like to also add the SKU in the same place...product.tpl.

Can anyone give me the code to add?

Thanks,

Dalmuti

You should be able to reference it by just using {$product.productcode} as it's already included in the select product query.
__________________
X-Cart 4.0.5
MySQL: 3.23.58
PHP 4.3.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:38 PM.

   

 
X-Cart forums © 2001-2020