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

MultiSkin

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-10-2003, 12:44 PM
 
buster buster is offline
 

Newbie
  
Join Date: Feb 2003
Posts: 7
 

Default MultiSkin

When you go to http://www.x-cart.com/shopping_cart_demo.html you have a choice to demo different schemes. It adds ?multiskin=skin# to the end of the url and you get the corresponding skin.

Are they using the Skin Swap mod? Or something else?

Thanks
Reply With Quote
  #2  
Old 10-13-2003, 08:44 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

been looking at that - they have a slightly modified version of the xcart there for the demo - this includes a session/cookie that sets the skin to use.

nice mod - shame they haven't released it
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 10-13-2003, 09:19 AM
 
jpsowin jpsowin is offline
 

X-Adept
  
Join Date: Sep 2002
Posts: 459
 

Default

Isn't that false advertising?
__________________
Joshua Sowin
...taking things one TPL at a time.
Reply With Quote
  #4  
Old 10-13-2003, 09:22 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

be nice if this was the exact code that was released
__________________
ex x-cart guru
Reply With Quote
  #5  
Old 10-13-2003, 12:04 PM
 
buster buster is offline
 

Newbie
  
Join Date: Feb 2003
Posts: 7
 

Default

Would be nice... Even if it was an add-on (that way I know updates would work).

It would really solve the problem that I have with personalized pages.


Mabey it is unstable and that is why they haven't released it?
Reply With Quote
  #6  
Old 10-13-2003, 12:09 PM
 
jpsowin jpsowin is offline
 

X-Adept
  
Join Date: Sep 2002
Posts: 459
 

Default

Mabey it is unstable and that is why they haven't released it?

I doubt that's the reason. No further comment on why I think that...
__________________
Joshua Sowin
...taking things one TPL at a time.
Reply With Quote
  #7  
Old 10-13-2003, 12:10 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

it wouldn't be unstable - just want to keep it to themselves maybe

come on rrf - how about releasing it???
__________________
ex x-cart guru
Reply With Quote
  #8  
Old 10-13-2003, 12:11 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

promise we wouldn't tell anyone
__________________
ex x-cart guru
Reply With Quote
  #9  
Old 10-13-2003, 12:37 PM
 
buster buster is offline
 

Newbie
  
Join Date: Feb 2003
Posts: 7
 

Default

Ok.. so first off i'm not the php wiz (or smarty wiz at that) but I was/am screwing around with this.

What about going into smarty.php and putting in an if statement:
Code:
if( $HTTP_GET_VARS['skin'] == 2){ $smarty->template_dir = BASEDIR.DIRECTORY_SEPARATOR."skin2"; $smarty->compile_dir = BASEDIR.DIRECTORY_SEPARATOR."templates2_c"; $smarty->config_dir = BASEDIR.DIRECTORY_SEPARATOR."skin2"; $smarty->cache_dir = BASEDIR.DIRECTORY_SEPARATOR."cache2"; $smarty->secure_dir = BASEDIR.DIRECTORY_SEPARATOR."skin2"; $smarty->debug_tpl="file:debug_templates.tpl"; } else { $smarty->template_dir = BASEDIR.DIRECTORY_SEPARATOR."skin1"; $smarty->compile_dir = BASEDIR.DIRECTORY_SEPARATOR."templates_c"; $smarty->config_dir = BASEDIR.DIRECTORY_SEPARATOR."skin1"; $smarty->cache_dir = BASEDIR.DIRECTORY_SEPARATOR."cache"; $smarty->secure_dir = BASEDIR.DIRECTORY_SEPARATOR."skin1"; $smarty->debug_tpl="file:debug_templates.tpl"; }
And
Code:
if( $HTTP_GET_VARS['skin'] == 2){ $smarty->assign("ImagesDir","../skin2/images"); $smarty->assign("SkinDir","../skin2"); } else { $smarty->assign("ImagesDir","../skin1/images"); $smarty->assign("SkinDir","../skin1"); }


It seems to work, but I know 0 (<-- thats a zero) about cookies.

Will this break anything???


[Edit] I guess it would help if i finish a thought.

I know 0 about putting this in a cookie, so the url doesn't always have ?skin=# in it
[/Edit]
Reply With Quote
  #10  
Old 10-13-2003, 12:57 PM
 
buster buster is offline
 

Newbie
  
Join Date: Feb 2003
Posts: 7
 

Default

Ok.. I'm about to go home from work and wont be able to play with this for awhile but:
Code:
if( $HTTP_GET_VARS['skin']){ setcookie('skin', $HTTP_GET_VARS['skin']); } if(( $HTTP_COOKIE_VARS['skin'] == 2) || ( $HTTP_GET_VARS['skin'] == 2)){ $smarty->template_dir = BASEDIR.DIRECTORY_SEPARATOR."skin2"; $smarty->compile_dir = BASEDIR.DIRECTORY_SEPARATOR."templates2_c"; $smarty->config_dir = BASEDIR.DIRECTORY_SEPARATOR."skin2"; $smarty->cache_dir = BASEDIR.DIRECTORY_SEPARATOR."cache2"; $smarty->secure_dir = BASEDIR.DIRECTORY_SEPARATOR."skin2"; $smarty->debug_tpl="file:debug_templates.tpl"; $smarty->assign("ImagesDir","../skin2/images"); $smarty->assign("SkinDir","../skin2"); } else { $smarty->template_dir = BASEDIR.DIRECTORY_SEPARATOR."skin1"; $smarty->compile_dir = BASEDIR.DIRECTORY_SEPARATOR."templates_c"; $smarty->config_dir = BASEDIR.DIRECTORY_SEPARATOR."skin1"; $smarty->cache_dir = BASEDIR.DIRECTORY_SEPARATOR."cache"; $smarty->secure_dir = BASEDIR.DIRECTORY_SEPARATOR."skin1"; $smarty->debug_tpl="file:debug_templates.tpl"; $smarty->assign("ImagesDir","../skin1/images"); $smarty->assign("SkinDir","../skin1"); }

Not being a php guru is there a way to use a switch statement to make this cleaner/add more skins easier?

Also, there is the problem of switching back to the 1st skin, when the cookie is set to skin2 and you put a ?skin=1, the cookie is updated but skin2 shoews till you hit refresh because of :
Code:
if(( $HTTP_COOKIE_VARS['skin'] == 2) || ( $HTTP_GET_VARS['skin'] == 2)){
I assume it reads the cookie (2) before it sets the cookie (1)? Or it reads the cookie (2) caches the value then the page runs?
Again, this just shows how little I know of php.


Going to do some looking, but any help is apprecieated.
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 07:50 AM.

   

 
X-Cart forums © 2001-2020