当前位置: 首页>>代码示例>>PHP>>正文


PHP order::load方法代码示例

本文整理汇总了PHP中order::load方法的典型用法代码示例。如果您正苦于以下问题:PHP order::load方法的具体用法?PHP order::load怎么用?PHP order::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在order的用法示例。


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

示例1: returnsuccess

 function returnsuccess()
 {
     // mandatory function
     $orderid = JRequest::getVar("custom");
     // orderid coming back from PP
     $txn_id = JRequest::getVar("txn_id");
     // pp transaction ID
     $cfg = new sc_configuration();
     $statuses = explode("\r\n", $cfg->get("ostatus"));
     $status = $statuses[count($statuses) - 1];
     // set the status to the last one in the list
     $scorder = new order();
     $scorder->load($orderid);
     $scorder->ordercode = $txn_id;
     $scorder->status = $status;
     $scorder->store();
     return;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:18,代码来源:scpaypal.class.php

示例2: explode

 function store_new_order($cart, $ship)
 {
     if (count($cart) == 0) {
         return;
     }
     //   	$db	=& JFactory::getDBO();
     //get statuses
     $cfg = new sc_configuration();
     $statuses = explode("\n", trim($cfg->get("ostatus")));
     // get the first status from the list
     $status = isset($statuses[0]) ? trim($statuses[0]) : JText::_('SC_NO_STATUS');
     $juser = JFactory::getUser();
     //create order info from the details page
     $o = new order();
     $o->bind($_POST);
     $o->id = null;
     // ensure a new order is created here
     $o->j_user_id = $juser->id;
     // add the user id
     $o->orderdt = mktime();
     $o->status = $status;
     $o->customfields = serialize($_REQUEST);
     if ($ship['enabled']) {
         $o->shipCost = $ship['cost'];
         $o->shipRegion = $ship['region'];
     }
     $o->store();
     $orderid = $o->_db->insertid();
     $gtotal = 0;
     //create order details from cookie
     foreach ($cart as $key => $product) {
         unset($odet);
         $odet = new orderdetail();
         $odet->id = null;
         $odet->orderid = $orderid;
         $odet->prodcode = $product->prodcode;
         $odet->qty = $product->quantity;
         $odet->unitprice = $product->finalprice;
         $odet->total = $product->quantity * $product->finalprice;
         $odet->shorttext = $product->prodname;
         $odet->option = $product->option;
         $odet->store();
         $gtotal = $gtotal + $odet->total;
         //$db->insertObject("#__sc_odetails", $odet);
     }
     // get taxes based on shipping region (if any)
     $ctax = new taxes();
     $taxrate = $ctax->getTax(@$ship['region']);
     $o = new order();
     $o->load($orderid);
     $o->total = $gtotal;
     $o->tax = $gtotal * $taxrate;
     //		$o->id=$orderid;
     $o->store();
     //		$db->updateObject("#__sc_orders", $o, "id");
     //		echo $db->getErrorMsg();
     return $orderid;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:58,代码来源:caddy.class.php


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