Exemplo n.º 1
0
        }
    } catch (Exception $ex) {
        echomsg('Unable to retrieve currency conversion list', true);
    }
}
function echomsg($message, $alert = false)
{
    $tnow = date('Y-m-d H:i:s');
    echo "\n{$tnow} - {$message}";
    if ($alert) {
        $event = 'Currency Conversion Rates Update Failed';
        $templateVars = array();
        $templateVars['{event}'] = $event;
        $templateVars['{description}'] = $message;
        $to_email = array('*****@*****.**', '*****@*****.**', '*****@*****.**');
        @Mail::Send(1, 'alert', $event, $templateVars, $to_email, null, '*****@*****.**', 'Indusdiva.com', NULL, NULL, _PS_MAIL_DIR_, false);
    }
}
//deleteIndex($client);
//deleteByIds($client);
//$sql = "select id_product from ps_product where active = 0";
$sql = "select id_product from ps_category_product where id_category=141";
$product_ids = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql);
$product_ids = array_map(function ($product) {
    return $product['id_product'];
}, $product_ids);
//$product_ids = array(72039, 72038);
print_r(count($product_ids));
//addProducts($client);
addProducts($client, $product_ids);
Exemplo n.º 2
0
<?php

session_start();
if (isset($_GET['reset'])) {
    $_SESSION["cart"] = array();
}
if (!isset($_SESSION["cart"])) {
    $_SESSION["cart"] = array();
}
// Nous ajoutons simplement un tableau contenant les informations sur le produit au niveau du panier
function addProducts($name, $quantity, $unit_price)
{
    $_SESSION["cart"][] = array('name' => $name, 'quantity' => $quantity, 'unit_price' => $unit_price, 'total_price' => $quantity * $unit_price);
}
if (isset($_POST['cartpush'])) {
    addProducts($_POST['name'], $_POST['quantity'], $_POST['price']);
}
?>
<html>
<head>
  <title>La boutique de Sandra</title>
  <style type="text/css">
    body{
      background-color: #272727;
      font-family: Arial;
      font-size: 14px;
    }
    h1{
      font-weight: 500;
    }
    .container{
Exemplo n.º 3
0
            $sql .= " END";
            Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql);
            echomsg("All Currencies Conversions Updated Successfully");
            //add USD to INR in history table
            $today = date("Y-m-d 00:00:00");
            $sql = "insert into ps_currency_rates values('{$today}','{$inr_rate}')";
            Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql);
        } else {
            echomsg("Base Currency not in US", true);
        }
    } catch (Exception $ex) {
        echomsg('Unable to retrieve currency conversion list', true);
    }
}
function echomsg($message, $alert = false)
{
    $tnow = date('Y-m-d H:i:s');
    echo "\n{$tnow} - {$message}";
    if ($alert) {
        $event = 'Currency Conversion Rates Update Failed';
        $templateVars = array();
        $templateVars['{event}'] = $event;
        $templateVars['{description}'] = $message;
        $to_email = array('*****@*****.**', '*****@*****.**', '*****@*****.**');
        @Mail::Send(1, 'alert', $event, $templateVars, $to_email, null, '*****@*****.**', 'Indusdiva.com', NULL, NULL, _PS_MAIL_DIR_, false);
    }
}
//deleteIndex($client);
//deleteByIds($client);
addProducts($client);