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

How do I change parts of the skin for mobile browsers only?

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 10-22-2014, 11:55 AM
  Dr. Bogger's Avatar 
Dr. Bogger Dr. Bogger is offline
 

Member
  
Join Date: Oct 2014
Location: Saratoga Springs, NY
Posts: 16
 

Default How do I change parts of the skin for mobile browsers only?

Hello,

I am looking to edit the default skin, to change the look on mobile devices only.

Is there a way I can detect if the browser being used is desktop or mobile?

Example:
PHP Code:
if (Mobile Browser) {
Do 
this
} else {
Do 
this

__________________
X-Cart Version: 5.2.3
Reply With Quote
  #2  
Old 10-22-2014, 03:41 PM
  Dr. Bogger's Avatar 
Dr. Bogger Dr. Bogger is offline
 

Member
  
Join Date: Oct 2014
Location: Saratoga Springs, NY
Posts: 16
 

Default Re: How do I change parts of the skin for mobile browsers only?

Can I use this inside a template file?
PHP Code:
if (\XLite\Core\Request::isMobileDevice()) 
__________________
X-Cart Version: 5.2.3
Reply With Quote
  #3  
Old 10-22-2014, 08:36 PM
 
elmirage001 elmirage001 is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,964
 

Default Re: How do I change parts of the skin for mobile browsers only?

Use CSS media queries
https://developers.google.com/web/fundamentals/layouts/rwd-fundamentals/use-media-queries?hl=en
https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries

Good luck!

Paul
__________________
X-Cart GoldPlus v4.7.12 | reBOOT (reDUX) Template v4.7.12.9 | Always The Best
Reply With Quote
  #4  
Old 10-22-2014, 09:19 PM
  Dr. Bogger's Avatar 
Dr. Bogger Dr. Bogger is offline
 

Member
  
Join Date: Oct 2014
Location: Saratoga Springs, NY
Posts: 16
 

Default Re: How do I change parts of the skin for mobile browsers only?

Is it possible to move/remove <div> sections using CSS?
If so, using what code?
__________________
X-Cart Version: 5.2.3
Reply With Quote
  #5  
Old 10-22-2014, 09:38 PM
 
elmirage001 elmirage001 is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,964
 

Default Re: How do I change parts of the skin for mobile browsers only?

Sorry, I missed that you were using x-cart 5...

I don't have any experience with xc5...
__________________
X-Cart GoldPlus v4.7.12 | reBOOT (reDUX) Template v4.7.12.9 | Always The Best
Reply With Quote
  #6  
Old 10-23-2014, 05:32 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: How do I change parts of the skin for mobile browsers only?

Quote:
Originally Posted by Dr. Bogger
Can I use this inside a template file?
PHP Code:
if (\XLite\Core\Request::isMobileDevice()) 

Yes, this is correct code.

Quote:
Is it possible to move/remove <div> sections using CSS?
If so, using what code?

Well, if CSS code can accomplish what you need, then you can do this. In order to register CSS code for mobile skin, you can use the condition mentioned earlier (if (\XLite\Core\Request::isMobileDevice())) in the method described here:
http://kb.x-cart.com/display/XDD/Adding+CSS+and+JS+files
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #7  
Old 10-23-2014, 06:02 AM
  Dr. Bogger's Avatar 
Dr. Bogger Dr. Bogger is offline
 

Member
  
Join Date: Oct 2014
Location: Saratoga Springs, NY
Posts: 16
 

Default Re: How do I change parts of the skin for mobile browsers only?

I'm not using mobile skin. I just want to modify the default responsive skin to look better on mobile devices.

I will even share the mods that I do if somebody is willing to help point me in the right direction.
__________________
X-Cart Version: 5.2.3
Reply With Quote
  #8  
Old 10-23-2014, 06:03 AM
  Dr. Bogger's Avatar 
Dr. Bogger Dr. Bogger is offline
 

Member
  
Join Date: Oct 2014
Location: Saratoga Springs, NY
Posts: 16
 

Default Re: How do I change parts of the skin for mobile browsers only?

Quote:
Originally Posted by tony_sologubov
Yes, this is correct code.

Also, I tried using that code inside the template files, and it didn't work. It just displayed the code on the screen.
__________________
X-Cart Version: 5.2.3
Reply With Quote
  #9  
Old 10-23-2014, 06:23 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: How do I change parts of the skin for mobile browsers only?

Quote:
Originally Posted by Dr. Bogger
Also, I tried using that code inside the template files, and it didn't work. It just displayed the code on the screen.

OK. Could you please explain what you are trying to achieve then? I need a bit more details in order to help.

Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #10  
Old 10-23-2014, 06:51 AM
  Dr. Bogger's Avatar 
Dr. Bogger Dr. Bogger is offline
 

Member
  
Join Date: Oct 2014
Location: Saratoga Springs, NY
Posts: 16
 

Default Re: How do I change parts of the skin for mobile browsers only?

Quote:
Originally Posted by tony_sologubov
OK. Could you please explain what you are trying to achieve then? I need a bit more details in order to help.

Tony.

I need to edit the files:

- skins/default/en/checkout/steps/shipping/parts/subsection.shipping.tpl
- skins/default/en/checkout/steps/shipping/parts/subsection.payment.tpl

But I need the changes I make to only display on mobile devices.

I wish there was a "mobile override" skin area, kinda like "custom skin", but one that only works if being viewed from a mobile device.
__________________
X-Cart Version: 5.2.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


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 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:59 PM.

   

 
X-Cart forums © 2001-2020