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

More Effective Manufacturer view on Product Detail Page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 03-18-2007, 08:04 PM
 
micromedia micromedia is offline
 

Member
  
Join Date: Feb 2005
Posts: 27
 

Default More Effective Manufacturer view on Product Detail Page

This is more effective manufatucrer modul for product detail page. It is working on x-cart gold 4.1.6

manufacturer image,
manufacturer name,
link on this manufacturer page,

random 5 products from manufacturer with image, price, name


Create
modules/Manufacturers/manufacturerinfo.php

Code:
<? if ( !defined('XCART_SESSION_START') ) { header("Location: ../../"); die("Access denied"); } $query = "SELECT $sql_tbl[products].productid, $sql_tbl[products].product, $sql_tbl[products].descr, $sql_tbl[pricing].price FROM $sql_tbl[products],$sql_tbl[pricing] WHERE $sql_tbl[products].forsale='Y' AND $sql_tbl[products].avail > 0 AND $sql_tbl[products].productid = $sql_tbl[pricing].productid AND $sql_tbl[products].manufacturerid = '$product_info[manufacturerid]' ORDER BY RAND() LIMIT 5" ; $manufacturerinfos = func_query($query); $smarty->assign("manufacturerinfos",$manufacturerinfos); ?>



Create
modules/Manufacturers/manufacturerinfo.tpl


Code:
{* $Id: manufacturerinfo.tpl,v 1.8.2.1 2007/03/19 13:12:29 max Exp $ *} {if $product.manufacturer ne ""} {if $manufacturerinfos} {capture name=dialog } <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td align="left" style="padding:5px;" valign="top"><a href="manufacturers.php?manufacturerid={$product.manufacturerid}"><img src="image.php?id={$product.manufacturerid}&type=M " alt="{$manufacturer}" border="0" /></a></td> <td align="left" style="padding:5px;" valign="top" width="100%"><a href="manufacturers.php?manufacturerid={$product.manufacturerid}"><b>{$product.manufacturer}</b></a><br /> {$product.manudescr|truncate:250:"...":true} <br /> <br /> <a href="manufacturers.php?manufacturerid={$product.manufacturerid}"><u>See All Products</u></a></td> </tr> </table> <hr/> <table width="100%" cellpadding="0" cellspacing="0"> <tr > {foreach from=$manufacturerinfos item=manufacturerinfo } <td width="20%" valign="top"><div style="border:1px solid #ccc;padding:5px;margin:5px; text-align:center"> <a href="product.php?productid={$manufacturerinfo.productid}&amp;cat={$cat}&amp;manufacturerinfo"> <font class="ProductTitle">{$manufacturerinfo.product}</font></a><br /> <a href="product.php?productid={$manufacturerinfo.productid}&amp;cat={$cat}&amp;manufacturerinfo"> {include file="product_thumbnail.tpl" image_x=75 productid=$manufacturerinfo.productid product=$manufacturerinfo.product} </a><br /> <font class="ProductPrice"> Our Price:&nbsp; {include file="currency.tpl" value=$manufacturerinfo.price}</font><br /> {if $manufacturerinfo.list_price gt 0} <font class="MarketPrice"> Market Price:&nbsp;<s>{include file="currency.tpl" value=$manufacturerinfo.list_price}</s> </font> <br /> {/if} <font size="1"> {$manufacturerinfo.descr|truncate:50:"...":true}</font><br /> </div></td> {/foreach} </tr> </table> {/capture} {include file="dialog.tpl" title=$lng.lbl_manufacturers content=$smarty.capture.dialog extra='width="100%"'} {/if} {/if}



EDIT product.php

After:
Code:
if ($active_modules["Manufacturers"]) include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php";


Add
Code:
if ($active_modules["Manufacturers"]) include $xcart_dir."/modules/Manufacturers/manufacturerinfo.php";


EDIT skin1/customer/main/product.tpl

Add

Code:
{include file="modules/Manufacturers/manufacturerinfo.tpl" }
Attached Thumbnails
Click image for larger version

Name:	manufacturer.gif
Views:	1044
Size:	26.4 KB
ID:	287  
__________________
X Cart Gold Ver. 4.1.6
Reply With Quote

The following 3 users thank micromedia for this useful post:
am2003 (01-01-2011), donavichi (04-20-2009), JWait (11-06-2009)
  #2  
Old 03-21-2007, 09:23 PM
 
YINIA YINIA is offline
 

Member
  
Join Date: Dec 2006
Posts: 20
 

Default Re: More Effective Manufacturer view on Product Detail Page

Is this able to be used with XCart Pro?
__________________
YINIA.com
----
version 4.1
using Mac OS X
Reply With Quote
  #3  
Old 04-04-2007, 07:27 AM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

Question Re: More Effective Manufacturer view on Product Detail Page

Very nice mod micromedia...thanks a lot for sharing

Is there anyway I we can add number of products just after the name of manufacturer in same page ?

For example:
manufacturer XYZ <112 products) SEE ALL Products


I guess it's possible since in admin it shows how many product every manufacturer has but I can't figuer out what excatly require to change to display number of products .

I hope some x-cart guru here will help us.
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------

Last edited by anandat : 04-04-2007 at 07:29 AM. Reason: spelling mistake
Reply With Quote
  #4  
Old 04-04-2007, 12:53 PM
 
micromedia micromedia is offline
 

Member
  
Join Date: Feb 2005
Posts: 27
 

Default Re: More Effective Manufacturer view on Product Detail Page

Quote:
Originally Posted by anandat
Very nice mod micromedia...thanks a lot for sharing

Is there anyway I we can add number of products just after the name of manufacturer in same page ?

For example:
manufacturer XYZ <112 products) SEE ALL Products


I guess it's possible since in admin it shows how many product every manufacturer has but I can't figuer out what excatly require to change to display number of products .

I hope some x-cart guru here will help us.

Ok anadat.

lets add those code:

modules/Manufacturers/manufacturerinfo.php

Code:
<? if ( !defined('XCART_SESSION_START') ) { header("Location: ../../"); die("Access denied"); } $query = "SELECT $sql_tbl[products].productid, $sql_tbl[products].product, $sql_tbl[products].descr, $sql_tbl[pricing].price FROM $sql_tbl[products],$sql_tbl[pricing] WHERE $sql_tbl[products].forsale='Y' AND $sql_tbl[products].avail > 0 AND $sql_tbl[products].productid = $sql_tbl[pricing].productid AND $sql_tbl[products].manufacturerid = '$product_info[manufacturerid]' ORDER BY RAND() LIMIT 5" ; $manufacturerinfos = func_query($query); $smarty->assign("manufacturerinfos",$manufacturerinfos); $totalmanuprod = "SELECT COUNT(*) FROM $sql_tbl[products] WHERE $sql_tbl[products].forsale='Y' AND $sql_tbl[products].avail > 0 AND $sql_tbl[products].manufacturerid = '$product_info[manufacturerid]' " ; $totalmanuprods = func_query_first_cell($totalmanuprod); $smarty->assign("totalmanuprods",$totalmanuprods); ?>
modules/Manufacturers/manufacturerinfo.tpl
Code:
{* $Id: manufacturerinfo.tpl,v 1.8.2.1 2007/03/19 13:12:29 max Exp $ *} {if $product.manufacturer ne ""} {if $manufacturerinfos} {capture name=dialog } <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td align="left" style="padding:5px;" valign="top"><a href="manufacturers.php?manufacturerid={$product.manufacturerid}"><img src="image.php?id={$product.manufacturerid}&type=M " alt="{$manufacturer}" border="0" /></a></td> <td align="left" style="padding:5px;" valign="top" width="100%"><a href="manufacturers.php?manufacturerid={$product.manufacturerid}"><b>{$product.manufacturer}</b></a> ( {$totalmanuprods} products)<br /> {$product.manudescr|truncate:250:"...":true} <br /> <br /> <a href="manufacturers.php?manufacturerid={$product.manufacturerid}"><u>See All Products</u></a></td> </tr> </table> <hr/> <table width="100%" cellpadding="0" cellspacing="0"> <tr > {foreach from=$manufacturerinfos item=manufacturerinfo } <td width="20%" valign="top"><div style="border:1px solid #ccc;padding:5px;margin:5px; text-align:center"> <a href="product.php?productid={$manufacturerinfo.productid}&amp;cat={$cat}&amp;manufacturerinfo"> <font class="ProductTitle">{$manufacturerinfo.product}</font></a><br /> <a href="product.php?productid={$manufacturerinfo.productid}&amp;cat={$cat}&amp;manufacturerinfo"> {include file="product_thumbnail.tpl" image_x=75 productid=$manufacturerinfo.productid product=$manufacturerinfo.product} </a><br /> <font class="ProductPrice"> Our Price:&nbsp; {include file="currency.tpl" value=$manufacturerinfo.price}</font><br /> {if $manufacturerinfo.list_price gt 0} <font class="MarketPrice"> Market Price:&nbsp;<s>{include file="currency.tpl" value=$manufacturerinfo.list_price}</s> </font> <br /> {/if} <font size="1"> {$manufacturerinfo.descr|truncate:50:"...":true}</font><br /> </div></td> {/foreach} </tr> </table> {/capture} {include file="dialog.tpl" title=$lng.lbl_manufacturers content=$smarty.capture.dialog extra='width="100%"'} {/if} {/if}

It will be work. it shows number of product next to manufacturer name
like : manufacturer xyz (23 products)
__________________
X Cart Gold Ver. 4.1.6
Reply With Quote
  #5  
Old 04-04-2007, 01:30 PM
 
aslater aslater is offline
 

Advanced Member
  
Join Date: Jun 2005
Location: UK
Posts: 54
 

Default Re: More Effective Manufacturer view on Product Detail Page

Thanks micromedia just what we needed and looks great
__________________
Version: 4.4.5 Gold
www.bitzdirectcomputers.co.uk
Reply With Quote
  #6  
Old 04-04-2007, 09:39 PM
  flyclothing's Avatar 
flyclothing flyclothing is offline
 

eXpert
  
Join Date: Aug 2004
Location: Gilbert, AZ
Posts: 357
 

Talking Re: More Effective Manufacturer view on Product Detail Page

Micromedia,

Definitely one of the best additions I have seen! I think this mod would be a great replacement for the upselling or related mod because your mod automatically pulls all products under that manufacturer or category and the related mod has to be done manually.

I have a few questions. The image for the manufacturer is not showing up, even though I have an image when I go under the category. What do you think might be the issue here?

If I did want to replace the related mod, where I could put the code you provided?

Thanks again. Excellent mod!
__________________
Jonathan
Flyclothing, LLC
PO Box 1490
Gilbert, AZ 85299-1571
P 480.422.7350
F 888.359.2568
www.flysportsgear.com?MMCF_xcartforum (X-Cart 4.5.2) FOR SALE
Reply With Quote
  #7  
Old 04-05-2007, 11:11 PM
  flyclothing's Avatar 
flyclothing flyclothing is offline
 

eXpert
  
Join Date: Aug 2004
Location: Gilbert, AZ
Posts: 357
 

Default Re: More Effective Manufacturer view on Product Detail Page

So I have been trying to match the "Customers who bought this..." mod to the format of the "Manufacturer's mod" and cant figure it out for the life of me.

Here is the code:

Quote:
{if $also_bought_products|@count gt 0} {capture name=also_bought}
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
{section name=i loop=$also_bought_products}
{* SAFETYNET DSEFU MOD *}
{if $enable_seo_links == "Y"}
<td width="20%" valign="top"><div style="border:1px solid #ccc;padding:5px;margin:5px; text-align:center">
<p style="margin-top: 0; margin-bottom: 0"><b><A href="{seo_link prod_name=$also_bought_products[i].product prod_id=$also_bought_products[i].productid}" target="{$targetwin}">{$also_bought_products[i].product}</a></b></p>
<p style="margin-top: 0; margin-bottom: 0"><A href="{seo_link prod_name=$also_bought_products[i].product prod_id=$also_bought_products[i].productid}" target="{$targetwin}">{include file="product_thumbnail.tpl" image_x=100 productid=$also_bought_products[i].productid product=$also_bought_products[i].product tmbn_url=$also_bought_products[i].tmbn_url}</a></div></td>
{else}
{/if}
{* END SAFETYNET DSEFU MOD *}
</tr>
{/section}
</table>
{/capture} {include file="dialog.tpl" title="Customers who bought this also bought..." content=$smarty.capture.also_bought extra="width=100%"}{/if}

What would need to be changed to make this match the manufacturer's mod format with 5 products in a row? Is it simply a "for each" argument or something more?
__________________
Jonathan
Flyclothing, LLC
PO Box 1490
Gilbert, AZ 85299-1571
P 480.422.7350
F 888.359.2568
www.flysportsgear.com?MMCF_xcartforum (X-Cart 4.5.2) FOR SALE
Reply With Quote
  #8  
Old 04-17-2007, 06:25 PM
 
ProMuscles ProMuscles is offline
 

Advanced Member
  
Join Date: Apr 2007
Posts: 45
 

Default Re: More Effective Manufacturer view on Product Detail Page

Great mod but in addition to more info can you add a button buy now
__________________
4.7.5 Gold Glory be to God!
Reply With Quote
  #9  
Old 04-21-2007, 01:17 PM
 
ProMuscles ProMuscles is offline
 

Advanced Member
  
Join Date: Apr 2007
Posts: 45
 

Default Re: More Effective Manufacturer view on Product Detail Page

I can not get it to work. Is it confirmed working?
__________________
4.7.5 Gold Glory be to God!
Reply With Quote
  #10  
Old 04-21-2007, 02:28 PM
 
aslater aslater is offline
 

Advanced Member
  
Join Date: Jun 2005
Location: UK
Posts: 54
 

Default Re: More Effective Manufacturer view on Product Detail Page

Quote:
Originally Posted by ProMuscles
I can not get it to work. Is it confirmed working?


Works for me and i am using 4.1.6 as well

http://www.bitzdirect.com/product.php?productid=6&cat=0&page=1
__________________
Version: 4.4.5 Gold
www.bitzdirectcomputers.co.uk
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:43 AM.

   

 
X-Cart forums © 2001-2020