本文整理汇总了PHP中ShoppingCart::all方法的典型用法代码示例。如果您正苦于以下问题:PHP ShoppingCart::all方法的具体用法?PHP ShoppingCart::all怎么用?PHP ShoppingCart::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShoppingCart
的用法示例。
在下文中一共展示了ShoppingCart::all方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Confirm
/**
*
*/
public function Confirm()
{
$auth = new Auth();
$shop = new ShoppingCart();
$user = $auth->id();
$myShop = $shop->all();
$objDetails = new DetalleCompra();
$total = 0;
if (empty($myShop)) {
return false;
}
foreach ($myShop as $key => $val) {
$total += $val->precio * $val->cantidad;
}
$result_insert = $this->create($user, $total);
if ($result_insert->success) {
foreach ($myShop as $k => $v) {
try {
$objDetails->create($result_insert->id, $v->id_prod, $v->name, $v->cantidad, $v->precio, $v->talle, $v->color);
//$stock = new TempStock();
//echo $stock->removeTempStock($user,$v->id_prod,$v->id_talle,$v->id_color,$v->type);
} catch (Exception $e) {
echo $e->getMessage();
}
}
$auth->restPoints($total);
$auth->sumConsumed($total);
$shop->removeAll();
return true;
}
}
示例2: checkPoints
public function checkPoints()
{
$user = Auth::User();
$ShoppingCart = new ShoppingCart();
$ShoppingCart->all();
$credit = $user->dblCredito;
$total = $ShoppingCart->getTotal();
if ($credit - $total < 0) {
return false;
} else {
return true;
}
}
示例3: ShoppingCart
<?php
require 'inc/header.php';
$carrito = new ShoppingCart();
$items = $carrito->all();
?>
<!-- Header -->
<!--detalle productos-->
<div class="carrito-productos col-xs-12 col-sm-12 col-md-12 ol-lg-12">
<!--head-page-->
<div class="head-page col-xs-12 col-sm-12 col-md-12 ol-lg-12">
<h3><?php
$carrito->cantidad();
?>
productos agregados</h3>
</div>
<!--end / head-page-->
<!-- tabla-detalle -->
<table class="tabla-detalle col-xs-12 col-sm-12 col-md-12 ol-lg-12">
<thead >
<tr>
<th class="col-D text-uppercase">productos</th>
<th class="col-B text-uppercase">talle</th>
<th class="col-C text-uppercase">color</th>
<th class="col-B text-uppercase">unidades</th>
<th class="col-B text-uppercase">puntos</th>
<th class="col-A text-uppercase"></th>
示例4: ShoppingCart
ini_set('display_errors', 'On');
/**
* Verifico los puntos disponibles
*/
if (!Usuario::sCheckPoints()) {
@header('Location: carrito.php');
exit;
}
/**
* Seteo datos para el envio del email
*/
$user = Auth::User();
$seller = Vendedor::EmailById($user->vendedor);
$shop = new ShoppingCart();
$image_url = "http://nufarm-maxx.com/marketingNet/images-clientes/";
$template = new Template('pedido', array("nombre" => $user->strNombre, "apellido" => $user->strApellido, "empresa" => $user->strEmpresa, "fecha" => date('d/m/Y'), "items" => Template::itemPedido($shop->all()), "total" => $shop->getTotal(), "direccion" => !empty($user->domicilio_entrega) ? "Domicilio de entrega: " . $user->domicilio_entrega : "", "ciudad" => !empty($user->ciudad) ? "Ciudad: " . $user->ciudad : "", "codigo_postal" => !empty($user->cp) ? "Codigo Postal: " . $user->cp : "", "telefono" => !empty($user->telefono) ? "Telefono: " . $user->telefono : "", "logo" => !empty($user->logo) ? $image_url . $user->logo : ""));
/**
* Checkeo el vencimiento
* @var TempStock
*/
$checkVencimiento = new TempStock();
$can = $checkVencimiento->fechaVencimiento($_SESSION['MM_IdUsuario']);
if ($can) {
header('Location: catalogo.php');
}
/**
* Confirmo la compra
*/
if (!(new Compra())->confirm()) {
header('Location: catalogo.php');
}