4 replies [Last post]
diegohermes's picture
Offline
Joined: 09/12/2007
Juice: 147
Was this information Helpful?

Hi

My question is more related to theming than ubercart but since im trying to theme the cart, i came to ask here.

In my theme, i put a picture in front of every title of the site, i'm using $node->nid to create a swith, when is 1, use picture 1, when is two......

But how can i do that with the cart, checkout, etc.. pages? They don't have an id like that, so the switch don't work.

I attach a screen of my site to be more clear.

Again, sorry for the bad english.

thanks

PreviewAttachmentSize
singular.jpgsingular.jpg85.14 KB
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Cart node id??

The theme looks fun. Smiling

Instead of basing it on node ID for those pages, use the URL. So check something like:

<?php
 
if ($_GET['q'] == 'cart') {
   
// show picture x
 
}
?>
diegohermes's picture
Offline
Joined: 09/12/2007
Juice: 147
Re: Re: Cart node id??

Thanks, glad you liked, wait to see my other project that is almost ready, a sexyshop rsrs.

And thanks for the answer, works fine, the site will be online very soon.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Cart node id??

You have to go by the URL path since there isn't any other ID.

I'm assuming you're figuring out which image to use in your page.tpl.php file. If you make an identical file called page-cart.tpl.php, you can use just the cart image, and all of the pages that start at the cart (cart, cart/checkout, cart/checkout/review...) will use that file instead of the default one.

diegohermes's picture
Offline
Joined: 09/12/2007
Juice: 147
Re: Re: Cart node id??

Thats right Lyle, thanks, it works just fine.

Thanks again