![]() |
Ok I got it:
instead of Quote:
It should be: Quote:
|
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 |
This is the way it works for me:
In product.php before the smarty assigns Quote:
In product.tpl you have to play different positions that you'll like to see it display You can use this one: Quote:
or you can use yours. Forget about the func.php |
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 |
You mean:
http://www.your-domain.com/manufacturers.php |
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? |
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. |
Re: Manfacturer Name and Link in Products List
Quote:
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:
# in products.php before this line: Code:
$smarty->assign("products",$products); add Code:
# 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 *} Example is here: http://www.reach4life.com/store/home.php?cat=554 |
Hey 27stars, I'm glad that you convinced them to change to x-cart. I used to have their old shopping cart too.
|
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 |
All times are GMT -8. The time now is 11:46 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.