X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Post html instead of detailed images (https://forum.x-cart.com/showthread.php?t=7548)

KiDD 05-12-2004 07:49 AM

Post html instead of detailed images
 
I want to post html in where the detailed images appear on the product page, instead of the images. Any idea of where to start the mod?

KiDD
http://store.sturgisrally.net (Live)
X-Cart Gold Ver. 3.3.4

Emerson 05-12-2004 08:09 AM

You'll need to edit /modules/Detailed_Product_Images/product_images.tpl

The best bet here, in my opinion, would be to use extra fields to accomplish this.

KiDD 05-12-2004 09:08 AM

Ok i modified the product_images.tpl to read

{* $Id: product_images.tpl,v 1.6 2002/05/20 06:55:24 lucky Exp $ *}
{if $images ne ""}
{capture name=dialog}
{section name=image loop=$images}
{if $images[image].avail eq "Y"}
<src="../details.php">




{/if}
{/section}
{/capture}
{if $smarty.capture.dialog ne ""}
{include file="/home/store/www/detailed_pages/16290.htm" title=Variations
content=$smarty.capture.dialog extra="width=100%"}
{/if}
{/if}

and created a file called details.php which reads

<?
# $Id: details.php, 2004/05/12
#
# Show details page by productid
#

require "./smarty.php";
require "./config.php";

$result = db_query("select image,image_type from $sql_tbl[thumbnails] where productid='$productid'");
if (db_num_rows($result))
list($image, $image_type) = db_fetch_row($result);

db_free_result($result);

if (!empty($image)) {
header("Content-type: $image_type");
echo $image;
} else {
header("Content-type: text/html");
readfile(/home/store/www/detailed_pages/16290.htm);
}
?>

made the folder detailed_pages and uploaded 16290.htm

this is working fine. How would i set the
readfile(/home/store/www/detailed_pages/16290.htm);

to call the page by {productid}.htm?

Then I could just create a product page for each item and upload it to that directory and it could call the appropriate page for the item.

Thanks in advance,

KiDD
http://store.sturgisrally.net (Live)
X-Cart Gold Ver. 3.3.4

Emerson 05-12-2004 09:32 AM

Try {$product.productid}

KiDD 05-12-2004 11:10 AM

ok most of what I was trying was not doing anything.

Modded

product_images.tpl to read simply and got rid of the details.php.


{include file="/home/store/www/detailed_pages/16290.htm"}

when I make it

{include file="/home/store/www/detailed_pages/{$product.productid}.htm"}

I get:


Parse error: parse error, expecting `'}'' in /home/store/www/templates_c/%%-15/%%-1564588823/product_images.tpl.php on line 5


When i try:

{include file="/home/store/www/detailed_pages/{'$product.productid'}.htm"}

I get:


Warning: filemtime(): Stat failed for /home/store/www/detailed_pages/{'Array.productid' (errno=2 - No such file or directory) in /home/store/www/Smarty-2.3.0/Smarty.class.php on line 1031
.htm"}

Am I writing the line wrong? Or do i need to assign a variable somehow?

Thanks in advance,

KiDD
http://store.sturgisrally.net (Live)
X-Cart Gold Ver. 3.3.4

Emerson 05-12-2004 02:02 PM

Honestly I don't know what might be causing that problem.

Why don't you just use extra fields instead?

All you'd have to do is add {$product.param00} (or whatever extrafield it is) and that should do it for you.

You will need to enable html in extra fields which is pretty easy to do.

B00MER 05-13-2004 07:01 AM

Quote:

Originally Posted by KiDD
{include file="/home/store/www/detailed_pages/16290.htm"}

when I make it

{include file="/home/store/www/detailed_pages/{$product.productid}.htm"}

I get:

Parse error: parse error, expecting `'}'' in /home/store/www/templates_c/%%-15/%%-1564588823/product_images.tpl.php on line 5



Try this instead:

Code:

{capture name="htmldetailed"}{strip}/home/store/www/detailed_pages/{$product.productid}.htm{/strip}{/capture}
{include file=$smarty.capture.htmldetailed}



All times are GMT -8. The time now is 04:13 AM.

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