How to set/switch the template color permanently from the back-end?

Hi, Support,

There is the Color menu item on your Quickstart through which on can change template color, but could you tell me how can one set the template color permanently for the site through the admin interface please? Basically there must be a way of switching colors from the administrator!

Thanks.

10 answers

Profile photo of Sherlock 0.00 $tone March 6, 2013
Public

Hi susanp,

The Jm wall theme does not support to change the theme color in back-end yet, this feature is added for newer themes since the Jm flannel, For the jm wall you have to mofify a little bit in code as following
Open the file of app\design\frontend\default\jm_walltemplate\page\ ja_vars.php you would see this line of code

PHP Code:

$_params->set('jm_color','default');//default, red 




you can switch color for your site to other colors, For example red, just change the above to

PHP Code:

$_params->set('jm_color','red');//default, red 




I hope it helps !

#1
Profile photo of Susan Proctor 0.00 $tone April 18, 2013
Public

Hi, Sherlock,

I modified the ja_var.php as you have instructed and set the color to ‘green’, but the website stopped loading all together! I had to restore the code to get the site loading again!

#2
Profile photo of Susan Proctor 0.00 $tone July 25, 2013
Public

Hi, Sherlock,

Yes, thanks for your comment. I am also very happy that finally bright daylight can be viewed at the end of the long tunnel of my first but not least(!) Magento project!

I am getting back to you on this thread, as I would like to set the color of the Wholesale store to be different from the Retail. Any ideas how this could be achieved please?

#6
Profile photo of Sherlock 0.00 $tone July 29, 2013
Public

Hi susan,

Sorry for this late !
you can open the file of app\design\frontend\default\jm_walltemplate\page\ ja_vars.php there above this line of code

PHP Code:

 $_params->set('jm_color','default');//default, red 




you can add this

PHP Code:

 $storecode Mage::app()->getWebsite(true)->getDefaultStore()->getCode(); 




the $storecode variable store the current store code and now you can add an if statement here to decide which color would be used according the store code, For example

PHP Code:

 #Color
if($storecode == "retail"){
    
$_params->set('jm_color','default');//default, red
}else if($storecode == "wholesale"){
    
$_params->set('jm_color','red');//default, red





I hope you get the ideal !

#7
Profile photo of Susan Proctor 0.00 $tone July 30, 2013
Public

Hi, Sherlock,

Thanks for your reply. My Store view codes are ‘default’ for the Retail and ‘wholesale’ for the Wholesale, so I have the following lines of code in the program:

Code:

 $storecode = Mage::app()->getWebsite(true)->getDefaultStore()->getCode();  
 if($storecode == "default"){
    $_params->set('jm_color','green');
}elseif($storecode == "wholesale"){
    $_params->set('jm_color','blue');
}

It still renders color Green however for both stores!

#8
Profile photo of Sherlock 0.00 $tone July 31, 2013
Public

okay Sussan, it’s my mistake there, the code should be

PHP Code:

 $storecode Mage::app()->getStore()->getCode();  
 if(
$storecode == "default"){
    
$_params->set('jm_color','green');
}elseif(
$storecode == "wholesale"){
    
$_params->set('jm_color','blue');





this would help

#9

This question is now closed

Written By

Comments