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

Cart template

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-26-2007, 12:26 AM
  scoobie's Avatar 
scoobie scoobie is offline
 

Advanced Member
  
Join Date: Dec 2006
Location: Sydney
Posts: 84
 

Default 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
__________________
X-CART 4.1.8 (Add-Ons: onSale, CDSEO, AOM, Thickbox)
PHP 4.4.4
SQL 4.1.21
Linux O/S
Reply With Quote
  #2  
Old 08-26-2007, 02:49 AM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Cart template

your quotations are off...it should be
<img src="{$xcart_web_dir}/image.php?productid={$products[product].productid}" />
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #3  
Old 08-26-2007, 03:47 AM
  scoobie's Avatar 
scoobie scoobie is offline
 

Advanced Member
  
Join Date: Dec 2006
Location: Sydney
Posts: 84
 

Default 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
__________________
X-CART 4.1.8 (Add-Ons: onSale, CDSEO, AOM, Thickbox)
PHP 4.4.4
SQL 4.1.21
Linux O/S
Reply With Quote
  #4  
Old 08-26-2007, 04:58 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Cart template

Code:
<img src="{$xcart_web_dir}/image.php?id={$products[product].productid}&type=P" />
__________________
xcartmods.co.uk
Reply With Quote
  #5  
Old 08-26-2007, 07:48 PM
  scoobie's Avatar 
scoobie scoobie is offline
 

Advanced Member
  
Join Date: Dec 2006
Location: Sydney
Posts: 84
 

Default Re: Cart template

That line didn't work either. Should there be a type= before the &type variable or something?
__________________
X-CART 4.1.8 (Add-Ons: onSale, CDSEO, AOM, Thickbox)
PHP 4.4.4
SQL 4.1.21
Linux O/S
Reply With Quote
  #6  
Old 08-26-2007, 09:27 PM
  wjbrewer's Avatar 
wjbrewer wjbrewer is offline
Banned
 

X-Adept
  
Join Date: Feb 2005
Location: Pittsburgh, PA
Posts: 504
 

Default 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?
Reply With Quote
  #7  
Old 08-26-2007, 10:14 PM
  scoobie's Avatar 
scoobie scoobie is offline
 

Advanced Member
  
Join Date: Dec 2006
Location: Sydney
Posts: 84
 

Default 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
__________________
X-CART 4.1.8 (Add-Ons: onSale, CDSEO, AOM, Thickbox)
PHP 4.4.4
SQL 4.1.21
Linux O/S
Reply With Quote
  #8  
Old 08-29-2007, 06:45 PM
  wjbrewer's Avatar 
wjbrewer wjbrewer is offline
Banned
 

X-Adept
  
Join Date: Feb 2005
Location: Pittsburgh, PA
Posts: 504
 

Default 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>
Reply With Quote
  #9  
Old 09-01-2007, 10:46 PM
  scoobie's Avatar 
scoobie scoobie is offline
 

Advanced Member
  
Join Date: Dec 2006
Location: Sydney
Posts: 84
 

Default Re: Cart template

Thanks Bill. It worked a treat.

Regards,
Kylie
__________________
X-CART 4.1.8 (Add-Ons: onSale, CDSEO, AOM, Thickbox)
PHP 4.4.4
SQL 4.1.21
Linux O/S
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:22 PM.

   

 
X-Cart forums © 2001-2020