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)

donavichi 04-20-2009 12:39 AM

Re: More Effective Manufacturer view on Product Detail Page
 
Quote:

Originally Posted by micromedia
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" }



This is such an excellent mod - works perfectly in 4.1.11 - great work!

donavichi 10-25-2009 08:39 AM

Re: More Effective Manufacturer view on Product Detail Page
 
definately works in 4.1.12... Great mod, thanks again OP

JWait 11-06-2009 04:46 AM

Re: More Effective Manufacturer view on Product Detail Page
 
Works fine in 4.2.3.

I am having a little problem with the formatting though. If the product title length varies from product to product it throws the "boxes" and the images off, making the "boxes" different sizes, and the images are not aligned, all depending on whether the product title is 1 line, 2 lines, or 3 lines. Any ideas?

JWait 11-06-2009 06:21 AM

Re: More Effective Manufacturer view on Product Detail Page
 
I have noticed one "issue". I'm using the clean URLs from x-cart and the product url is appended with ".html?manufacturerinfo=" instead of just ".html". Is this going to make any difference with SEO?

JWait 11-18-2009 05:52 PM

Re: More Effective Manufacturer view on Product Detail Page
 
I "fixed" the clean URL issue. I just removed the highlighted text from the code in manufacturerinfo.tpl
Code:

<a href="product.php?productid={$manufacturerinfo.productid}&amp;cat={$cat}&amp;manufacturerinfo">
so that it is
Code:

<a href="product.php?productid={$manufacturerinfo.productid}&amp;cat={$cat}">

There are 2 instances of it. I removed them and the URLs are clean now.

anandat 11-19-2009 10:09 AM

Re: More Effective Manufacturer view on Product Detail Page
 
This module working for me till now but as soon as I replaced the products with new description (through csv file upload)it stopped showing the "random 5 products from manufacturer with image, price, name" in the product detail page!!!

I double checked that manufacturers has been alloted to each product correctly & I can browse the products through manufacturer. But on product detail page it's not showing random 5 product of respective manufacturer for that product !!

Can any one please help me to resolve this issue ?

anandat 11-20-2009 03:36 AM

Re: More Effective Manufacturer view on Product Detail Page
 
Quote:

Originally Posted by anandat
This module working for me till now but as soon as I replaced the products with new description (through csv file upload)it stopped showing the "random 5 products from manufacturer with image, price, name" in the product detail page!!!

I double checked that manufacturers has been alloted to each product correctly & I can browse the products through manufacturer. But on product detail page it's not showing random 5 product of respective manufacturer for that product !!

Can any one please help me to resolve this issue ?

OK...I just resolved this issue. I don't know but there was some problem with CSV file. I tried to upload old csv file & again it's showing random 5 products from manufacturers. :)

JWait 12-08-2009 09:13 AM

Re: More Effective Manufacturer view on Product Detail Page
 
Has anyone figured out how to not display the current product in the "other products from this manufacturer" display?

Has anyone figured out how to not display duplicates of the same product in the "other products from this manufacturer" display?

Other than this, the mod works great, and we will probably use it anyway, but it would be nice if these quirks were eliminated.

Dan.roh 12-26-2009 02:58 AM

Re: More Effective Manufacturer view on Product Detail Page
 
Thanks Micromedia,

Please help, I can't get it to work. The error I am getting is:

Warning: Smarty error: unable to read resource: "modules/Manufacturers/manufacturerinfo.tpl" in /home/custom/public_html/Smarty-2.6.19/Smarty.class.php on line 1092

Your help would be very much appreciated

Thanks




Quote:

Originally Posted by micromedia
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" }



JWait 12-31-2009 05:54 AM

Re: More Effective Manufacturer view on Product Detail Page
 
Is the manufacturerinfo.tpl where it is supposed to be? It should be at(x-cart root)/skin1/modules/Manufacturers/manufacturerinfo.tpl


All times are GMT -8. The time now is 01:51 PM.

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