• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Basket类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Basket的典型用法代码示例。如果您正苦于以下问题:PHP Basket类的具体用法?PHP Basket怎么用?PHP Basket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Basket类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: basket

 function basket()
 {
     if ($_POST) {
         $basket = new Basket();
         $basket->toOrder();
         $this->redirect('/cabinet/basket/thanks/');
     } else {
         if (Funcs::$uri[2] == 'delivery') {
             $seo['seo_title'] = 'Условия доставки';
             Funcs::setMeta($seo);
             $basket = new Basket();
             $data['order'] = $basket->getOrder();
             $data['delivery'] = $basket->getDelivery($data['order']);
             View::render('cabinet/delivery', $data);
         } elseif (Funcs::$uri[2] == 'thanks') {
             $seo['seo_title'] = 'Благодарим вас за заказ!';
             Funcs::setMeta($seo);
             View::render('basket/thanks');
         } else {
             $data['seo_title'] = 'Корзина';
             Funcs::setMeta($data);
             $basket = new Basket();
             $data['order'] = $basket->getOrder();
             //$data['delivery']=$basket->getDelivery($data['order']);
             //$data['payment']=$basket->getOrder($data['order']);
             View::render('cabinet/basket', $data);
         }
     }
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:29,代码来源:CabinetController.php


示例2: products

 /**
  * Process the Products
  *
  * @param Basket $basket
  * @return array
  */
 public function products(Basket $basket)
 {
     $products = [];
     foreach ($basket->products() as $product) {
         $products[] = ['sku' => $product->sku, 'name' => $product->name, 'price' => $product->price, 'rate' => $product->rate, 'quantity' => $product->quantity, 'freebie' => $product->freebie, 'taxable' => $product->taxable, 'delivery' => $product->delivery, 'coupons' => $product->coupons, 'tags' => $product->tags, 'discount' => $product->discount, 'category' => $product->category, 'total_value' => $this->reconciler->value($product), 'total_discount' => $this->reconciler->discount($product), 'total_delivery' => $this->reconciler->delivery($product), 'total_tax' => $this->reconciler->tax($product), 'subtotal' => $this->reconciler->subtotal($product), 'total' => $this->reconciler->total($product)];
     }
     return $products;
 }
开发者ID:janusnic,项目名称:basket,代码行数:14,代码来源:Processor.php


示例3: add

 public function add()
 {
     $this->template->title = 'Cart :: Add';
     $this->template->metaDescription = '';
     $this->template->content = View::factory('cart')->bind('cart', $cart);
     $p_id = $_POST['p_id'];
     $this->cart = $this->session->get('Basket');
     $cart = new Basket();
     $item = new Item();
     $item->id = $p_id;
     $cart->add($item);
     url::redirect('/cart');
 }
开发者ID:VinceOmega,项目名称:mcb-nov-build,代码行数:13,代码来源:cart.php


示例4: getPrice

 /**
  * 
  * @return float
  */
 public function getPrice(Basket $basket)
 {
     $items = $basket->getItems();
     $sumPrice = 0;
     /* @var $item Item */
     foreach ($items as $item) {
         $discount = $item->getProductDiscount();
         $discountPrice = $discount->getDiscountPrice($item);
         $discountAmount = $discount->getDiscountAmount($item);
         $sumPrice += $discountPrice * $discountAmount;
     }
     return $sumPrice;
 }
开发者ID:csiz0,项目名称:kata-base-php,代码行数:17,代码来源:Cashier.php


示例5: __construct

 public function __construct(Service $service)
 {
     $this->db = $db;
     //Выборка всех категорий для меню т.к. используются на всех страницах публичной части
     $this->category = $service->get('category_mapper')->getAll();
     $this->basket_info = Basket::getBasketInfo();
 }
开发者ID:lexdss,项目名称:shop,代码行数:7,代码来源:View.php


示例6: buildContent

 function buildContent()
 {
     $harmoni = Harmoni::Instance();
     $basket = Basket::instance();
     $basket->removeAllItems();
     RequestContext::locationHeader($harmoni->request->quickURL("basket", "view"));
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:7,代码来源:empty.act.php


示例7: indexAction

 public function indexAction()
 {
     $basket = Basket::getBasket();
     //При удалении товара
     if ($_GET['del_item']) {
         Basket::deleteProductFromBasket($_GET['del_item']);
     }
     //Подтверждеение заказа
     if ($_POST['confirm_order']) {
         //Для получеения общей суммы заказа
         $basket_info = Basket::getBasketInfo();
         //Создаем и заполняем доменный объект заказа
         $order = new Order();
         $order->id = uniqid();
         //ID (Primary Key) для заказов генерируем сами
         $order->user_id = intval($_SESSION['user_id']);
         $order->delivery = $_POST['delivery'];
         $order->pay = $_POST['pay'];
         $order->total_sum = $basket_info['total_sum'];
         $order->status = 'processing';
         //Статус по-умолчанию, "В обработке"
         $order->date = date('Y-m-d H:i:s', time());
         $order->products = $basket;
         //Сохраняем заказ
         $this->service->get('order_mapper')->save($order);
         //Очищаем корзину и редиректим
         Basket::cleanBasket();
         $_SESSION['message'] = 'Спасибо за покупку. Ваш заказ принят в обработку. Данные отправлены на почту';
         header('Location: /basket');
         exit;
     }
     $view_data['basket'] = $basket;
     $view_data['title'] = 'Корзина покупателя';
     $this->service->get('view')->render('basket.tpl.php', $view_data);
 }
开发者ID:lexdss,项目名称:shop,代码行数:35,代码来源:BasketController.php


示例8: execute

 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 5/5/06
  */
 function execute()
 {
     $harmoni = Harmoni::Instance();
     $basket = Basket::instance();
     $basket->removeAllItems();
     print $basket->getSmallBasketHtml();
     exit;
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:15,代码来源:emptyAjax.act.php


示例9: loadBasket

 public function loadBasket($id)
 {
     $model = Basket::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'Запись не найдена.');
     }
     if ($model->user_id !== Yii::app()->user->id) {
         $this->error403();
     }
     return $model;
 }
开发者ID:postfx,项目名称:fermion,代码行数:11,代码来源:BasketController.php


示例10: process

 public function process()
 {
     $sql = 'INSERT INTO finance_transactions (amount, description, timestamp, account) VALUES (:amount, :title, now(), :account) ';
     $stmt = DatabaseFactory::getInstance()->prepare($sql);
     foreach (Basket::getContents() as $basketItem) {
         $stmt->bindValue(':amount', $basketItem['cost']);
         $stmt->bindValue(':title', '(given cash) ' . $basketItem['title'] . ' ticket for ' . $basketItem['username']);
         $stmt->bindValue(':account', $this->getElementValue('username'));
         $stmt->execute();
         Events::setSignupStatus($basketItem['userId'], $basketItem['eventId'], 'CASH_IN_POST');
     }
 }
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:12,代码来源:FormPayTicketCash.php


示例11: actionView

 public function actionView($id)
 {
     self::validateAdmin();
     $order = Order::getOrderById($id);
     $productQuantity = json_decode($order['products'], true);
     $productId = array_keys($productQuantity);
     $products = Products::getProductlistById($productId);
     $totalPrice = Basket::getTotalPrice($products, $productQuantity);
     $total = array_sum($totalPrice);
     require_once ROOT . '/views/admin_order/view.php';
     return true;
 }
开发者ID:Evkazolinium,项目名称:Eshop_for_example,代码行数:12,代码来源:AdminOrderController.php


示例12: getAssets

 /**
  * Answer the assets to display in the slideshow
  * 
  * @return object AssetIterator
  * @access public
  * @since 5/4/06
  */
 function getAssets()
 {
     $assets = array();
     $repositoryManager = Services::getService("Repository");
     $basket = Basket::instance();
     $basket->clean();
     $basket->reset();
     while ($basket->hasNext()) {
         $assets[] = $repositoryManager->getAsset($basket->next());
     }
     $iterator = new HarmoniIterator($assets);
     return $iterator;
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:20,代码来源:browse_xml.act.php


示例13: buildContent

 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     $harmoni->request->startNamespace("basket");
     $idManager = Services::getService("Id");
     $authZ = Services::getService("AuthZ");
     $basket = Basket::instance();
     $assetId = $idManager->getId(RequestContext::value("asset_id"));
     $basket->moveUp($assetId);
     $harmoni->request->endNamespace();
     RequestContext::locationHeader($harmoni->request->quickURL("basket", "view"));
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:20,代码来源:up.act.php


示例14: isAuthorizedToExecute

 /**
  * Check Authorizations
  * 
  * @return boolean
  * @access public
  * @since 9/27/05
  */
 function isAuthorizedToExecute()
 {
     $harmoni = Harmoni::instance();
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     $basket = Basket::instance();
     $basket->reset();
     $view = $idManager->getId("edu.middlebury.authorization.view");
     $this->_exportList = array();
     while ($basket->hasNext()) {
         $id = $basket->next();
         if ($authZ->isUserAuthorized($view, $id)) {
             $this->_exportList[] = $id;
         }
     }
     if (count($this->_exportList) > 0) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:28,代码来源:export.act.php


示例15: update

 /**
  * Tells the wizard component to update itself - this may include getting
  * form post data or validation - whatever this particular component wants to
  * do every pageload. 
  * @param string $fieldName The field name to use when outputting form data or
  * similar parameters/information.
  * @access public
  * @return boolean - TRUE if everything is OK
  */
 function update($fieldName)
 {
     $idManager = Services::getService("Id");
     $ok = parent::update($fieldName);
     // then, check if any "buttons" or anything were pressed to add/remove elements
     $this->_addFromBasketButton->update($fieldName . "_addfrombasket");
     if ($this->_addFromBasketButton->getAllValues()) {
         $basket = Basket::instance();
         $basket->reset();
         while ($basket->hasNext()) {
             $assetId = $basket->next();
             $element =& $this->_addElement();
             $element['_assetId'] = new AssetComponent();
             $element['_assetId']->setParent($this);
             $element['_assetId']->setValue($assetId);
         }
         $basket->removeAllItems();
         $this->rebuildPositionSelects();
     }
     return $ok;
 }
开发者ID:adamfranco,项目名称:concerto,代码行数:30,代码来源:SlideOrderedRepeatableComponentCollection.class.php


示例16: buildContent

 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     $harmoni->request->startNamespace("basket");
     $idManager = Services::getService("Id");
     $authZ = Services::getService("AuthZ");
     $basket = Basket::instance();
     $viewAZ = $idManager->getId("edu.middlebury.authorization.view");
     $assetIdList = RequestContext::value("assets");
     $assetIdArray = explode(",", trim($assetIdList));
     foreach ($assetIdArray as $id) {
         $assetId = $idManager->getId($id);
         try {
             if ($authZ->isUserAuthorized($viewAZ, $assetId)) {
                 $basket->addItem($assetId);
             }
         } catch (UnknownIdException $e) {
             $basket->addItem($assetId);
         }
     }
     $harmoni->request->endNamespace();
     $harmoni->history->goBack("polyphony/basket");
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:31,代码来源:add.act.php


示例17: execute

 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function execute()
 {
     $harmoni = Harmoni::instance();
     $harmoni->request->startNamespace("basket");
     $idManager = Services::getService("Id");
     $authZ = Services::getService("AuthZ");
     $basket = Basket::instance();
     $viewAZ = $idManager->getId("edu.middlebury.authorization.view");
     $assetIdList = RequestContext::value("assets");
     $assetIdArray = explode(",", trim($assetIdList));
     foreach ($assetIdArray as $id) {
         $assetId = $idManager->getId($id);
         try {
             if ($authZ->isUserAuthorized($viewAZ, $assetId)) {
                 $basket->addItem($assetId);
             }
         } catch (UnknownIdException $e) {
             $basket->addItem($assetId);
         }
     }
     $harmoni->request->endNamespace();
     print $basket->getSmallBasketHtml();
     exit;
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:31,代码来源:addAjax.act.php


示例18: step4

    public function step4()
    {
        $tree = array('name' => $_SESSION['iuser']['upload']['title']);
        $id = Tree::addTree($_SESSION['iuser']['upload']['spec'], $tree, 'catalog');
        if (file_exists($_SESSION['iuser']['upload']['filecover']['path']) && file_exists($_SESSION['iuser']['upload']['filepages']['path'])) {
            $dir = $_SERVER['DOCUMENT_ROOT'] . IUSER_DIR . md5('fotouser' . $_SESSION['iuser']['id']) . '/';
            if (!file_exists($dir)) {
                mkdir($dir, 0777);
            }
            $dir = $dir . md5('fotobook' . $id) . '/';
            mkdir($dir, 0777);
            for ($file2i = 0; $file2i < 2; $file2i++) {
                if ($file2i == 0) {
                    $filename = explode('.', $_SESSION['iuser']['upload']['filecover']['name']);
                    $filesource = $_SESSION['iuser']['upload']['filecover']['path'];
                } else {
                    $filename = explode('.', $_SESSION['iuser']['upload']['filepages']['name']);
                    $filesource = $_SESSION['iuser']['upload']['filepages']['path'];
                }
                $raz = $filename[count($filename) - 1];
                unset($filename[count($filename) - 1]);
                $filename = implode('', $filename);
                $filenameraz = Funcs::Transliterate($filename) . '.' . $raz;
                $dirfile = $dir . $filenameraz;
                $x = 0;
                $i = 1;
                while ($x == 0) {
                    if (file_exists($dirfile)) {
                        $filenameraz = Funcs::Transliterate($filename) . $i . '.' . $raz;
                        $dirfile = $dir . md5($filename) . '/' . $filenameraz;
                    } else {
                        $x = 1;
                    }
                    $i++;
                }
                copy($filesource, $dirfile);
                chmod($dirfile, 0777);
                unlink($filesource);
                if ($file2i == 0) {
                    $filename1 = $filenameraz;
                } else {
                    $filename2 = $filenameraz;
                }
            }
        }
        $price = Basket::getPrice('session');
        $sql = '
			INSERT INTO {{catalog}}
			SET
				tree=' . $id . ',
				description=\'' . $_SESSION['iuser']['upload']['description'] . '\',
				phrase=\'' . $_SESSION['iuser']['upload']['phrase'] . '\',
				author=\'' . $_SESSION['iuser']['upload']['author'] . '\',
				private=' . $_SESSION['iuser']['upload']['private'] . ',
				booksize=' . $_SESSION['iuser']['upload']['booksize'] . ',
				countpage=' . $_SESSION['iuser']['upload']['countpage'] . ',
				binding=' . $_SESSION['iuser']['upload']['binding'] . ',
				paper=' . $_SESSION['iuser']['upload']['paper'] . ',
				price=' . $price . ',
				filecover=\'' . $filename1 . '\',
				filepages=\'' . $filename2 . '\',
				vendor=' . $_SESSION['iuser']['id'] . '
		';
        DB::exec($sql);
        unset($_SESSION['iuser']['upload']);
        $_SESSION['iuser']['upload']['id'] = $id;
        $_SESSION['iuser']['upload']['price'] = $price;
        Upload::addGallery($id, $filename1, $filename2, $dir);
        Email::uploadSend();
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:70,代码来源:UploadModel.php


示例19: mt_rand

<?php

Login::restrictFront();
$token1 = mt_rand();
$token2 = Login::string2hash($token1);
Session::setSession('token2', $token2);
$objBasket = new Basket();
$out = array();
$session = Session::getSession('basket');
if (!empty($session)) {
    $objCatalogue = new Catalogue();
    foreach ($session as $key => $value) {
        $out[$key] = $objCatalogue->getProduct($key);
    }
}
require_once "_header.php";
?>

<h1>Order summary</h1>

<?php 
if (!empty($out)) {
    ?>

<div id="big_basket">

	<form action="" method="post" id="frm_basket">
		
		<table cellpadding="0" cellspacing="0" border="0" class="tbl_repeat">
		
			<tr>
开发者ID:sydorenkovd,项目名称:e-com.loc,代码行数:31,代码来源:summary.php


示例20: defined

<?php

defined('SYSPATH') or die('No direct access allowed.');
?>

<?php 
$db = new Database();
$id = $this->uri->segment(3);
$order = Order::getOrderByID($id);
$_order = ORM::factory('order', $id);
$user = ORM::factory('user')->where('id', $order->user_id)->find();
$shipping = ORM::factory('user_shipping_info')->where('id', $order->shippingID)->find();
$billing = ORM::factory('user_billing_info')->where('id', $order->billingID)->find();
//$user = User::getUserByID($order->user_id);
$order_products = Basket::getBasketContentForOrder($id);
//var_dump($order_products[0]);
$order_statuses = Order::getOrderStatusByID($id);
$order_id = $_order->getOrderId();
function order_status()
{
    $status = array(1 => "Pending", 2 => "Processed", 3 => "Denied", 4 => "Shipped", 5 => "Delivered", 6 => "Canceled", 7 => "Refund");
    return $status;
}
function status_filter($id)
{
    switch ($id) {
        case 1:
            return "Pending";
        case 2:
            return "Processed";
        case 3:
开发者ID:VinceOmega,项目名称:mcb-nov-build,代码行数:31,代码来源:order_content.php



注:本文中的Basket类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Batch类代码示例发布时间:2022-05-23
下一篇:
PHP BasicPermission类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap