當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。