I installed OpenCart CMS and wanted to modify some option in the admin panel mainly the look and feel of the template. I also added the jpicker script for color picking. Also i created the css file with the standard php code and it works fine
<?php header("Content-type: text/css; charset: UTF-8"); ?>
<?php
$headerColor;
$menuColor = '#121212';
$bodyColor = '#fffaaa';
?>
#header {
background-color: <?=$headerColor; ?>;
}
In order to create the color picker view you need to add the id of the div in a script
$(document).ready(function(){
$('#Expandable').jPicker(
{
window:
{
expandable: true
}
});
});
And here is the standard code for the html
<div id="Expandable"></div>
I am not very good at JQuery but i know that it can be done either with .ajax or post. What i want to do is send the hex value from the jpicker to a php variable in the css file so it can change the color. Here is the link to jpicker http://www.digitalmagicpro.com/jPicker/. I also found an example
var colorValue = '#ababab';
$.post("view/stylesheet/stylesheet-template.css", {var_value: colorValue}, function(data) {
alert(colorValue);
});
It only sends alert and the colorValue from the variable, but i still don't know how to send the colorValue to php from the jpicker.
Thanks