Why is that so good?
What customers mostly need is in popups
What features are here in the Customer area
What features are here in the Admin area
First is meta tags on all pages are customizable. Next is all pages has own configurable clean URLs. Another is that each feature has many other options. And the last one is the WYSIWYG editor to customize all descriptions.
What is good on backend
Who made this E-Commerce CMS
This is just a quick overview of SPA-Cart.
Thank you for reading this article. More things are to come.
It has just few main folders
All functions are with the includes/ folder.
All pages we see are in the pages/ folder. The file to process them is only one - index.php. It parse URL for example the /help url will load the pages/help.php script. So it makes all pages clean URLs.
Templates are grouped in the templates folder under folders same names as scripts under the pages/ folder.
Mobile version is very similar scripts under the templates/mobile/ folder.
Templates engine support PHP tags. Also it has own tags.
Supported tags are
a. Any template variable can be {$var} - it's like <?php echo $var; ?>. If it's array or object - use same way as PHP, for example {$var['var']}
b.
{foreach $array as $k=>$v}
{/foreach}
will be
<?php
foreach ($array as $k=>$v) {
}
?>
You still can insert {$v} tag
And so on. So instead of <?php CODE ?> you simple write {CODE}, similar what saves you time. Look below to learn more(no PHP tags in examples).
c. {if $tmp == '1' or $var == '2'} {/if}
will be
if ($tmp == '1' or $var == '2') {
}
Same is
{elseif [CODE]}
and
{else}
d.
{php $var = 1+2;}
It's just to wrap to the inside content.
e. {price $var}
It will ouput currency symbol and price with .00 at the end.
f. {weight $var}
It will ouput weight symbol and weight with .00 at the end.
g. {include="TEMPALTE PATH"}
for example {include="common/products.php"}
h. {lng[Hello world]} - language variable. Useful if you translate or use multi-lingual site.
All tags and {lng..} stored in cache and not processed on every page load.
{lng[Hello|lower]} - lowcase.
{lng[Hello|js]} - replace line breaks and " character with \".
{lng[Hello|escape]} - replace " character with \".
You can also use {lng} in JavaScript - they are processed as well. JavaScrpt already do all the work so it does not support additonal modifiers like "lower".
i. Easier than {php } for assignments
{assign $var=1+2}
Output
$var = 1+2;
Full templates engine is in the includes/func/func.core.php file
function get_template_contents
Easy to customize or add new template tags for even new developer.
Here I write how to use MySQL syntaxes with SPA-Cart. MySQL or MySQLi - it is same functions.
As you know PHP function is simple mysql_query. But it makes complicated to work with data.
SPA-Cart MySQL connection is wrote in $db variable.
Here are functions list
1.
$db->all("SELECT * FROM table");
It will output array of table.
2.
$db->row(SELECT * FROM table WHERE field='$value'");
It will output just a line as array. No need to add "LIMIT 1".
3.
$db->field("SELET field FROM table WHERE ...");
It returns single variable. It's not like $result['field'] - it's like $result just.
4.
$db->array2insert("table", $array);
Array is like
$array = array(
'field' => $value,
...
);
No need to put "addslashes" in that case.
To get recent inserted ID
$inserted_id = $db->insert_id();
5.
$db->array2update("table", $array, "id='$value'");
same as above, third field is where to update.
6.
$db->query("ANY QUERY");
just mysql_query.