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

Editing /skin1/customer/main/cart.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-22-2006, 06:56 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Editing /skin1/customer/main/cart.tpl

X-Cart Gold 4.0.18

I am trying to tighten up the display of the shopping cart, and I am focusing on editing

/skin1/customer/main/cart.tpl
/skin1/modules/Product_Options/display_options.tpl

My goal is to make the cart look like this: [image removed]
I have already edited the language file ("Selected options" was changed to "Color/Shade";

I have already edited /skin1/customer/main/cart.tpl to remove some
's that in my opinion were not required.

I need to figure out 2 things:

1. Move the "Color: the_selected_color" to the same line as "Color/Shade:"
2. Delete (or disable print output) of the var, {$v.class}:

I deleted {$v.class}: and now the output is how I want it, HOWEVER, I would like it formatted on the same line.

My questions:

1. Did I do a Bad Thing by removing the {$v.class} variable from /skin1/modules/Product_Options/display_options.tpl ? Will this bite me later on?

2. WHERE in /skin1/customer/main/cart.tpl is the line break to put {$v.option_name} on its own line?

Code:
{if $products[product].product_options ne ""} {$lng.lbl_selected_options}:{include file="modules/Product_Options/display_options.tpl" options=$products[product].product_options} {/if}

I don't see a line break in there! What am I missing?

I am a neewbie when it comes to Smarty/PHP (but not to html or css) - so any wisdom from the community is MUCH appreciated.

Thanks!

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #2  
Old 07-23-2006, 06:49 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Editing /skin1/customer/main/cart.tpl

Quote:
Originally Posted by carpeperdiem
X-Cart Gold 4.0.18

I have already edited the language file ("Selected options" was changed to "Color/Shade";

The title you changed is meant to introduce the list of options not a specific option. I guess if 100% of your products will always have Color/Shade as the only option its OK to change it here but you really should just delete the title if you don't want it to say "Selected options" and deal with the color/shade option separately - see below.

Quote:
1. Move the "Color: the_selected_color" to the same line as "Color/Shade:"
2. Delete (or disable print output) of the var, {$v.class}:

I deleted {$v.class}: and now the output is how I want it, HOWEVER, I would like it formatted on the same line.

My questions:

1. Did I do a Bad Thing by removing the {$v.class} variable from /skin1/modules/Product_Options/display_options.tpl ? Will this bite me later on?

2. WHERE in /skin1/customer/main/cart.tpl is the line break to put {$v.option_name} on its own line?
Its on a separate line because in display_options.tpl a table is used to display all the options. The title you changed above is outside the table.

Taking {$v.class} out will bite you later if you ever have options other than Color/Shade. If 100% of your products always have only one option called color you will be OK but its just as easy to do it right.

What you really should do is delete the title (Selected options) as I said above, leave {$v.class}:$nbsp in and change the name of your option from Color to Color/Shade. That way if you ever have options other than color they will display properly. This will change the product page option from Color to Color/Shade as well. But is't that what you want - have it say the same thing on the product page and in the cart?
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #3  
Old 07-23-2006, 07:43 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Editing /skin1/customer/main/cart.tpl

Quote:
Originally Posted by geckoday
What you really should do is delete the title (Selected options) as I said above, leave {$v.class}:$nbsp in and change the name of your option from Color to Color/Shade. That way if you ever have options other than color they will display properly. This will change the product page option from Color to Color/Shade as well. But is't that what you want - have it say the same thing on the product page and in the cart?

Bingo. Thanks for the suggestion.

1. I restored the language, "Selected options" back to "Selected options"
2. I restored the {$v.class} variable from /skin1/modules/Product_Options/display_options.tpl , per your suggestion (also made v.class [b];
Code:
<TR> <TD>{$v.class}:</TD> <TD>{$v.option_name}</TD> </TR>
3. I renamed the color option to "Color/Shade"
4. in /skin1/customer/main.cart.tpl - I changed the following:

Code:
{if $products[product].product_options ne ""} {$lng.lbl_selected_options}:{include file="modules/Product_Options/display_options.tpl" options=$products[product].product_options} {/if}

to look like

Code:
{if $products[product].product_options ne ""} {include file="modules/Product_Options/display_options.tpl" options=$products[product].product_options} {/if}

That seemed to do the trick...

Is there a better way to do this?

I DO NOT need to see the "Selected options" label -- the variant label (in bold) is all that I need to see... I think the code will give me this now.

Thanks a zillion for pointing this newb in the right direction. I WILL get it one of these days, and I am grateful to the community for being here. Someday I hope to give back as much as I get from reading everyone's posts.

Thanks!

Jeremy

PS -- is there a way to COMMENT OUT these kinds of edits, as opposed to saving a backup, labeling the backup, etc... ?

I tried using {* and *} but that didn't seem to work for this -- is this because we're deep into Smarty territory? I need to learn more about Smarty, I know... baby steps....
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #4  
Old 07-23-2006, 08:21 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default

Looks like you got it perfect Jeremy. Smarty comments work for me:

Code:
{if $products[product].product_options ne ""} {*{$lng.lbl_selected_options}:*}{include file="modules/Product_Options/display_options.tpl" options=$products[product].product_options} {/if}
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #5  
Old 07-23-2006, 08:35 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default

Quote:
Originally Posted by geckoday
Smarty comments work for me

Wow. Thanks. I didn't know you could comment out within a statement. (I'm a smarty newb -- i have lots to learn!)

Ralph, thanks for your expertise and suggestions.

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 10:59 AM.

   

 
X-Cart forums © 2001-2020