クラス
WelcartEntries
$_SESSION['usces_entry']ソース ソース
ファイル: src/API/WelcartEntries.php
class WelcartEntries
{
/**
* Returns `$_SESSION['usces_entry']['order']` with extra `formatted_*` fields
*
* @author Evan D Shaw <evandanielshaw@gmail.com>
* @return array
*/
public function getOrder() {
$order = $_SESSION['usces_entry']['order'];
$order['shipping_charge'] = isset($order['shipping_charge']) ? (int)$order['shipping_charge'] : 0;
$order['total_full_price'] = isset($order['total_full_price']) ? (int)$order['total_full_price'] : 0;
$order['usedpoint'] = isset($order['usedpoint']) ? (int)$order['usedpoint'] : 0;
$order['discount'] = isset($order['discount']) ? $order['discount'] : 0;
$delmethod = isset($order['delivery_method']) ? $order['delivery_method'] : 0;
$order['delivery_method_name'] = usces_delivery_method_name($delmethod, 'return');
$order['formatted_shipping_charge'] = usces_crform($order['shipping_charge'], true, false, 'return');
$order['formatted_total_full_price'] = usces_crform($order['total_full_price'], true, false, 'return');
$order['formatted_usedpoint'] = number_format($order['usedpoint']);
$order['formatted_discount'] = usces_crform($order['discount'], true, false, 'return');
$order['formatted_tax'] = usces_tax($_SESSION['usces_entry'], 'return');
return $order;
}
/**
* Populates `$_SESSION['usces_entry']` with `$_SESSION` and `$_POST` data
*
* @author Evan D Shaw <evandanielshaw@gmail.com>
* @global \usc_e_shop $usces
* @return void
*/
public function setEntry() {
global $usces;
$usces->cart->entry();
}
}