X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   More Effective Manufacturer view on Product Detail Page (https://forum.x-cart.com/showthread.php?t=29776)

micromedia 03-18-2007 08:04 PM

More Effective Manufacturer view on Product Detail Page
 
1 Attachment(s)
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" }


YINIA 03-21-2007 09:23 PM

Re: More Effective Manufacturer view on Product Detail Page
 
Is this able to be used with XCart Pro?

anandat 04-04-2007 07:27 AM

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.

micromedia 04-04-2007 12:53 PM

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)

aslater 04-04-2007 01:30 PM

Re: More Effective Manufacturer view on Product Detail Page
 
Thanks micromedia just what we needed and looks great

flyclothing 04-04-2007 09:39 PM

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!

flyclothing 04-05-2007 11:11 PM

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?

ProMuscles 04-17-2007 06:25 PM

Re: More Effective Manufacturer view on Product Detail Page
 
Great mod but in addition to more info can you add a button buy now

ProMuscles 04-21-2007 01:17 PM

Re: More Effective Manufacturer view on Product Detail Page
 
I can not get it to work. Is it confirmed working?

aslater 04-21-2007 02:28 PM

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


All times are GMT -8. The time now is 07:41 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.