Exemple #1
0
<?php

include '../model/mCart.php';
include '../model/mCategory.php';
include '../model/mProductLister.php';
if (isset($_POST['added'])) {
    mCart::add_to_cart($_POST['product_id'], $_POST['name'], $_POST['quantity'], $_POST['price']);
    /*
    echo '<pre>';
    print_r($_POST);
    print_r($_SESSION);
    echo '</pre>';
    */
}
if (mCart::is_empty()) {
    $cart_count = 0;
} else {
    $cart_count = mCart::get_cart_products_number();
}
$categories = mCategory::get_categories(0);
$products = mProductLister::get_product($_GET['p']);