本文整理汇总了PHP中Modules::checkZone方法的典型用法代码示例。如果您正苦于以下问题:PHP Modules::checkZone方法的具体用法?PHP Modules::checkZone怎么用?PHP Modules::checkZone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Modules
的用法示例。
在下文中一共展示了Modules::checkZone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output
public function output($step = 0)
{
global $temp_orders_id;
$html = '';
if (isset(Checkout::$errors[$this->type])) {
$html .= '<div class="alert alert-error"><strong>' . Translate('Opgelet!') . '</strong> ' . Translate(Checkout::$errors[$this->type]) . '</div>';
unset(Checkout::$errors[$this->type]);
}
//select payment method if orders_id is known
//also get billing country
if (!empty($temp_orders_id)) {
$selected_query = tep_db_query('SELECT payment_method, billing_country FROM temp_orders WHERE orders_id = "' . $temp_orders_id . '"');
$selected = tep_db_fetch_array($selected_query);
}
foreach ($this->instances as $id => $data) {
if ($data['status'] == 'true') {
//check is active for zones and choosen shipping module
if (parent::checkZone($data['zone'], $selected['billing_country']) && parent::checkShippingMethod($data['shipping_module'])) {
if (isset(Checkout::$errors[$id])) {
$html .= '<div class="alert alert-error"><strong>' . Translate('Opgelet!') . '</strong> ' . Translate(Checkout::$errors[$id]) . '</div>';
}
$html .= '<label class="control-label" for="' . $this->type . '_' . $id . '" style="display:block;">';
$html .= '<div class="' . $this->type . '_item clearfix">';
$html .= '<input type="radio" name="' . $this->type . '" value="' . $id . '" id="' . $this->type . '_' . $id . '"' . ($selected['payment_method'] == $id ? ' checked=checked' : '') . ' />';
$html .= '<div class="' . $this->type . '_title"> ' . Translate($data['title']) . '</div>';
if (!empty($data['description'])) {
$html .= '<div class="' . $this->type . '_description"> ' . Translate($data['description']) . '</div>';
}
$html .= '</div>';
$html .= '</label>';
}
}
}
return $html;
}
示例2: output
public function output($step = 0)
{
global $temp_orders_id;
$html = '';
if (isset(Checkout::$errors[$this->type])) {
$html .= '<div class="alert alert-error"><strong>' . Translate('Opgelet!') . '</strong> ' . Translate(Checkout::$errors[$this->type]) . '</div>';
unset(Checkout::$errors[$this->type]);
}
foreach ($this->instances as $id => $data) {
if ($data['status'] == 'true') {
//check is active for zones and choosen shipping module
if (parent::checkZone($data['zone'], $this->temp_data[$temp_orders_id]['orders']['billing_country']) && parent::checkShippingMethod($data['shipping_module'])) {
if (isset(Checkout::$errors[$id])) {
$html .= '<div class="alert alert-error"><strong>' . Translate('Opgelet!') . '</strong> ' . Translate(Checkout::$errors[$id]) . '</div>';
}
$html .= '<label class="control-label" for="' . $this->type . '_' . $id . '" style="display:block;">';
$html .= '<div class="' . $this->type . '_item clearfix">';
$html .= '<input type="radio" name="' . $this->type . '" value="' . $id . '" id="' . $this->type . '_' . $id . '"' . ($this->temp_data[$temp_orders_id]['orders']['payment_method'] == $id ? ' checked=checked' : '') . ' />';
$paymentMethods = array();
foreach ($this->paymentmethods as $name => $value) {
$payment = new $value();
//Store the issuers for this paymentmethod into an array
$issuers = $payment->getSupportedIssuers();
foreach ($issuers as $issuer => $issuerData) {
if (isset($issuerData['name'])) {
$paymentMethods[] = array('value' => $value . '__' . $issuer, 'name' => $issuerData['name']);
} else {
$paymentMethods[] = array('value' => $value . '__' . $issuer, 'name' => $name);
}
}
}
if (count($paymentMethods) > 1) {
$html .= '<select name="' . $this->type . '_paymentmethod">';
foreach ($paymentMethods as $key => $value) {
$html .= '<option value="' . $value['value'] . '">' . $value['name'] . '</option>';
}
$html .= '</select>';
} else {
$html .= '<input type="hidden" name="' . $this->type . '_paymentmethod" value="' . $paymentMethods[0]['value'] . '" />';
}
$html .= '<div class="' . $this->type . '_title"> ' . $data['title'] . '</div>';
if (!empty($data['description'])) {
$html .= '<div class="' . $this->type . '_description"> ' . $data['description'] . '</div>';
}
$html .= '</div>';
$html .= '</label>';
}
}
}
return $html;
}
示例3: output_array
public function output_array($country = 0)
{
global $currencies, $temp_orders_id;
$array = array();
foreach ($this->instances as $id => $data) {
if ($data['status'] == 'true') {
if (parent::checkZone($data['zone'], $country)) {
$array[] = array('title' => Translate($data['title']), 'description' => Translate($data['description']), 'quote' => $data['quote']);
}
}
}
return $array;
}
示例4: calculate_credit
//.........这里部分代码省略.........
/* RESTRICT TO PRODUCTS */
/****************************/
$pr_ids = preg_split("/[,]/", $coupon_result['restrict_to_products']);
for ($ii = 0; $ii < count($pr_ids); $ii++) {
//Loop through restricted products_ids
if ($pr_ids[$ii] == $products_data['products_id']) {
if ($coupon_result['coupon_type'] == 'P') {
//Percent
$pr_c = $products_data['final_price'] * $products_data['products_quantity'];
$pod_amount = round($pr_c * 10) / 10 * $coupon_result['coupon_amount'] / 100;
$return['coupon_amount'] = $return['coupon_amount'] + $pod_amount;
$return['coupon_text'] .= $products_data['products_name'] . ', ';
} else {
//fixed amount
$return['coupon_text'] .= $products_data['products_name'] . ', ';
$return['coupon_amount'] = $coupon_result['coupon_amount'];
//No shipping costs
if ($coupon_result['coupon_type'] == 'S') {
$return['coupon_text'] = Translate('Gratis verzending');
$return['coupon_amount'] = $shipping_cost;
}
if ($coupon_result['coupon_type'] == 'S' && $coupon_result['coupon_amount'] > 0) {
$return['coupon_amount'] = $shipping_cost + $coupon_result['coupon_amount'];
}
}
}
}
}
if ($coupon_result['restrict_to_zones'] != '') {
/************************/
/* RESTRICT TO ZONES */
/************************/
$zones_ids = preg_split("/[,]/", $coupon_result['restrict_to_zones']);
for ($ii = 0; $ii < count($zones_ids); $ii++) {
//Loop through restricted zone_ids
if (parent::checkZone($zones_ids[$ii], $temp_data[$temp_orders_id]['orders']['delivery_country'])) {
if ($coupon_result['coupon_type'] == 'P') {
//Percent
$pr_c = $products_data['final_price'] * $products_data['products_quantity'];
$pod_amount = round($pr_c * 10) / 10 * $coupon_result['coupon_amount'] / 100;
$return['coupon_amount'] = $return['coupon_amount'] + $pod_amount;
} else {
//fixed amount
$return['coupon_amount'] = $coupon_result['coupon_amount'];
//No shipping costs
if ($coupon_result['coupon_type'] == 'S') {
$return['coupon_text'] = Translate('Gratis verzending');
$return['coupon_amount'] = $shipping_cost;
}
if ($coupon_result['coupon_type'] == 'S' && $coupon_result['coupon_amount'] > 0) {
$return['coupon_amount'] = $shipping_cost + $coupon_result['coupon_amount'];
}
}
}
}
}
}
$used_restricted_categories = array_unique($used_restricted_categories);
foreach ($used_restricted_categories as $cat_id) {
$return['coupon_text'] .= tep_get_categories_name($cat_id) . ', ';
}
} else {
//not restricted to products, categories or zones
//percent
if ($coupon_result['coupon_type'] == 'P') {
$return['coupon_amount'] = $amount * ($coupon_result['coupon_amount'] / 100);
}
//No shipping costs
if ($coupon_result['coupon_type'] == 'S') {
$return['coupon_text'] = Translate('Gratis verzending');
$return['coupon_amount'] = $shipping_cost;
}
if ($coupon_result['coupon_type'] == 'S' && $coupon_result['coupon_amount'] > 0) {
$return['coupon_amount'] = $shipping_cost + $coupon_result['coupon_amount'];
}
//fixed amount
if ($coupon_result['coupon_type'] == 'G') {
$return['coupon_amount'] = $amount;
}
}
if ($coupon_result['coupon_type'] == 'P' && ($coupon_result['restrict_to_products'] || $coupon_result['restrict_to_categories'])) {
$return['coupon_text'] = substr($return['coupon_text'], 0, -2);
} else {
if (strlen($return['coupon_text']) > 2 && ($coupon_result['restrict_to_products'] || $coupon_result['restrict_to_categories'])) {
$return['coupon_text'] = substr($return['coupon_text'], 0, -2);
}
}
} else {
//coupon minimum order is more then order total
$return['errors'] = Translate('Om de kortingscode te gebruiken moet uw bestelling een minimum bedrag hebben van') . ' ' . $currencies->format($coupon_result['coupon_minimum_order']);
}
if ($coupon_result['coupon_type'] != 'S') {
if ($return['coupon_amount'] > $amount) {
$return['coupon_amount'] = $amount;
}
}
}
$return['coupon_amount'] = tep_round($return['coupon_amount'], $currencies->currencies[$currency]['decimal_places']);
return $return;
}