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)
-   -   Cart template (https://forum.x-cart.com/showthread.php?t=33483)

scoobie 08-26-2007 12:26 AM

Cart template
 
Hi,

I am interested in removing my dialog look in this template and I started off making a simple change.

I want to display a product image (not the thumbnail size image) at the top of the page and I used the following syntax:-

<img src="{$xcart_web_dir}/image.php?productid="{$products[product].productid} />

This didn't work. Can someone tell me what I should have used?

Many thanks,
Kylie

inebriate 08-26-2007 02:49 AM

Re: Cart template
 
your quotations are off...it should be
<img src="{$xcart_web_dir}/image.php?productid={$products[product].productid}" />

scoobie 08-26-2007 03:47 AM

Re: Cart template
 
I copied the line you typed and I get a no image available displayed. I checked the product and I have both a thumbnail and an image for the product.

Any ideas what could be wrong?

Regards,
Kylie

PhilJ 08-26-2007 04:58 AM

Re: Cart template
 
Code:

<img src="{$xcart_web_dir}/image.php?id={$products[product].productid}&type=P" />

scoobie 08-26-2007 07:48 PM

Re: Cart template
 
That line didn't work either. Should there be a type= before the &type variable or something?

wjbrewer 08-26-2007 09:27 PM

Re: Cart template
 
The code you posted will only work after this line in the template:

Code:

{section name=product loop=$products}

Are you adding the <img> HTML above this line?

scoobie 08-26-2007 10:14 PM

Re: Cart template
 
Great stuff Bill. I unfortunately had my code above the section tag. I am still getting my feet wet with all of this stuff. I put a section tag around my code and it worked.

Just one other question if I can, if I have my own continue shopping image and I want the customer to be redirected back to the category they selected, how would I code it? I noticed when the current continue shopping gets clicked on, the customer gets sent back to the home page.

Thanks,
Kylie

wjbrewer 08-29-2007 06:45 PM

Re: Cart template
 
Quote:

Originally Posted by scoobie
Just one other question if I can, if I have my own continue shopping image and I want the customer to be redirected back to the category they selected, how would I code it? I noticed when the current continue shopping gets clicked on, the customer gets sent back to the home page.


Add this to the cart.php page near the top after a group of about ten items that all start with x_session_register...

PHP Code:

$smarty->assign('link_catid'func_query_first_cell("SELECT categoryid FROM xcart_products_categories WHERE productid='".intval($cart['products'][count($cart['products'])-1]['productid'])."' LIMIT 1")); 


Then you can use this link anywhere in the cart.tpl to go back to the previous category:

Code:

<a href="home.php?cat={$link_catid}>LINK OR IMG HERE </a>

scoobie 09-01-2007 10:46 PM

Re: Cart template
 
Thanks Bill. It worked a treat.

Regards,
Kylie


All times are GMT -8. The time now is 09:25 AM.

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