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
  #31  
Old 05-15-2005, 12:56 PM
  august's Avatar 
august august is offline
 

Senior Member
  
Join Date: Jul 2003
Posts: 178
 

Default

Ok I got it:
instead of

Quote:
[img]mlogo.php?manufacturerid={$manufacturerid.manufact urerid}[/img]

It should be:

Quote:
[img]{$xcart_web_dir}/mlogo.php?manufacturerid={$product.manufacturerid} [/img]
__________________
"The point is, to make so much money, that money isn't the point anymore."

Pro Version 4.0.19
Gold Version 4.1.3
Linux
Reply With Quote
  #32  
Old 05-15-2005, 04:59 PM
 
dmr8448 dmr8448 is offline
 

Senior Member
  
Join Date: Jun 2003
Posts: 123
 

Default Manfacturer Name and Link in Products List

I am trying to get the manfucturer name to display on the products listing page. I have done the following:

==========================================

Make a new function in func.php
Code:
function func_get_manufacturers($manufacturerid) {
global $sql_tbl;

return func_query("SELECT $sql_tbl[manufacturers].* FROM $sql_tbl[manufacturers] WHERE manufacturerid='$manufacturerid'");
}


In products.php
Code:
if ($products) {
foreach ($products as $k => $v)
$manufacturers[] = func_get_manufacturers($v["manufacturerid"]);
}

$smarty->assign("manufacturers", $manufacturers);


In products.tpl just use
Code:
{*** ########## Lines below to display manufacture name ########## ***}
{assign var="manid" value=$products[product].manufacturerid}
{if $manufacturers[$manid].manufacturerid ne "0"}
<FONT class="ItemsList">{$manufacturers[$manid].manufacturer}</FONT>

{/if}
{*** ########## End display manufacture name ########## ***}

==========================================

The problem I am having is the the link shows the incorrect manufacturer name, but when I click on the link it takes me to the correct manufacturer page.

Thanks
David

X-Cart version 4.0.12
PHP 4.3.10
MySQL server 4.0.23-nt-max
MySQL client 3.23.49
Web server Microsoft-IIS/6.0
Operation system Windows
XML parser (expat) 1.95.6
Reply With Quote
  #33  
Old 05-15-2005, 07:36 PM
  august's Avatar 
august august is offline
 

Senior Member
  
Join Date: Jul 2003
Posts: 178
 

Default

This is the way it works for me:

In product.php before the smarty assigns

Quote:
$thisManufactorer = $product_info["manufacturerid"];
$manufacturer = func_query("SELECT * FROM $sql_tbl[manufacturers] WHERE manufacturerid = $thisManufactorer");
$smarty->assign("manufacturer", $manufacturer[0]["manufacturer"]);

In product.tpl you have to play different positions that you'll like to see it display
You can use this one:
Quote:
<tr><TD align="left" valign="top">
Producer:

</td>
<TD align="left" valign="top">
{$manufacturer}
<font size=1 face=Arial>(click to get all products from this brand)</font>

</td>
</tr>

or you can use yours.

Forget about the func.php
__________________
"The point is, to make so much money, that money isn't the point anymore."

Pro Version 4.0.19
Gold Version 4.1.3
Linux
Reply With Quote
  #34  
Old 05-16-2005, 07:08 AM
 
davros davros is offline
 

Newbie
  
Join Date: May 2005
Location: Bristol
Posts: 8
 

Default

Hello
I've been working my way through this thread and managed to get the manufacturer displaying items on the product page (product.tpl) and the product list (products.tpl) - thanks very much to pmstudios and jds580s for that. You've helped me get my head round xcart quite a bit with your posts.

However, I can only get the manufacturer to display per product. In fact I want to display all the products for a manufacturer. I think this might need to be done in products_t.tpl but I can't really work out what's going on in there.

In fact I really want the manufacturer to be a subcategory but that doesn't seem to be an option. Any help with this would be greatly appreciated.

Davros
Reply With Quote
  #35  
Old 05-16-2005, 09:12 AM
  august's Avatar 
august august is offline
 

Senior Member
  
Join Date: Jul 2003
Posts: 178
 

Default

You mean:
http://www.your-domain.com/manufacturers.php
__________________
"The point is, to make so much money, that money isn't the point anymore."

Pro Version 4.0.19
Gold Version 4.1.3
Linux
Reply With Quote
  #36  
Old 05-16-2005, 09:54 AM
 
davros davros is offline
 

Newbie
  
Join Date: May 2005
Location: Bristol
Posts: 8
 

Default

No - manufacturers.php just gives a list of _all_ manufacturers. I want to list the items by manufacturer for each category.
So when I go to home.php?cat=1
I want
Category 1
Manufacturer 1
item 1
item 3
Manufacturer 2
item 2
item 4
item 5
etc

At the moment I get
Category 1
item 1 - manufacturer 1
item 2 - manufacturer 2
item 3 - manufacturer 1
item 4 - manufacturer 2
item 5 - manufacturer 2

Does that make sense?
Reply With Quote
  #37  
Old 05-17-2005, 01:06 PM
  august's Avatar 
august august is offline
 

Senior Member
  
Join Date: Jul 2003
Posts: 178
 

Default

You can do that manually, you create the category, your subcategories will be the name of the manufacturers or brands, and then you assign the products to each one, also you can put a logo to each of the subcategories(brands). Also you can use one of the mod's that handle subcategories for your products presentation.
Hope this help.
__________________
"The point is, to make so much money, that money isn't the point anymore."

Pro Version 4.0.19
Gold Version 4.1.3
Linux
Reply With Quote
  #38  
Old 05-25-2005, 07:39 AM
  finestshops's Avatar 
finestshops finestshops is offline
 

eXpert
  
Join Date: Oct 2002
Location: Toronto, Canada
Posts: 335
 

Default Re: Manfacturer Name and Link in Products List

Quote:
Originally Posted by dmr8448
The problem I am having is the the link shows the incorrect manufacturer name, but when I click on the link it takes me to the correct manufacturer page.

Just a summary of things we did to show manufacturer name in the list of products (thanks to pmstudios and jds580s)

add to include/func.php

Code:
# # Function to get manufacturers into product list # function func_get_manufacturers($manufacturerid) { global $sql_tbl; return func_query("SELECT $sql_tbl[manufacturers].* FROM $sql_tbl[manufacturers] WHERE manufacturerid='$manufacturerid'"); }


in products.php

before this line:

Code:
$smarty->assign("products",$products);

add

Code:
# # Get products manufacturers # if ($products) { foreach ($products as $k => $v) $manufacturers[] = func_get_manufacturers($v["manufacturerid"]); } $smarty->assign("manufacturers", $manufacturers); # # Get products manufacturers


in customer/main/products.tpl or customer/main/products_t.tpl:

after

Code:
<FONT class="ProductTitle">{$products[product].product}</FONT></A>

add

Code:
{* show Manufacturer name *} <FONT class="sitesmall">Manufacturer: {assign var="manid" value=$products[product].manufacturerid} {if $manufacturers[$manid].manufacturerid ne "0"} {$manufacturers[$manid].manufacturer} {/if} {* show Manufacturer name *}

Example is here:

http://www.reach4life.com/store/home.php?cat=554
__________________
Best regards,

Anton Pachkine
finestshops.com/x-cart
Reply With Quote
  #39  
Old 05-26-2005, 01:35 PM
  august's Avatar 
august august is offline
 

Senior Member
  
Join Date: Jul 2003
Posts: 178
 

Default

Hey 27stars, I'm glad that you convinced them to change to x-cart. I used to have their old shopping cart too.
__________________
"The point is, to make so much money, that money isn't the point anymore."

Pro Version 4.0.19
Gold Version 4.1.3
Linux
Reply With Quote
  #40  
Old 06-26-2005, 06:15 PM
 
btomasie btomasie is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 80
 

Default

I cannot get this code to work for me. I have followed all the different variations that many of you have placed in this thread, but can't any of them to work.

Here is my thread, any help would be appreciated!
http://forum.x-cart.com/viewtopic.php?t=20524

Brian
__________________
X-Cart Gold v4.0.18 [unix]
- Easy Checkout module
- ezUpsell module
- CDSEO module

X-Cart Gold v4.1.11 [unix]
***38,000+ active products!
- CDSEO module
- Address Book module
- Reorder module
- Smart Search module

X-Cart Gold v4.4.2 [unix]
- in development now!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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:44 PM.

   

 
X-Cart forums © 2001-2020