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