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


PHP Sessions::resetOnlinePaymentOffer方法代码示例

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


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

示例1: validOffers


//.........这里部分代码省略.........
							} else {
								$discount_freeN = $discount_freeN;
							}
							if ($discount_freeN > 0) {
								$offerAvailable = true;
							}
							$offerAmount = $tot_pay - ($discount_freeN * $no_of_rooms);
						}
						//Custom
						if ($this->disType() == "3") {
	//                        $custom = $this->des(); //if appilicable with custom other offers :)
	//                        if ($custom != "") {
	//                            $customOffer = true;
	//                            $offerAvailable = true;

							if ($f_validity == "on") { //if appilicable with custom other offers :)
								$custom_cus_array[] = array("id" => $this->id(), "title" => $this->title(), "des" => $this->des());
							} else {
								$c = 1;
								if ($c == 1) {
									$custom_cus_array1[] = array("id" => $this->id(), "title" => $this->title(), "des" => $this->des());
									$c++;
								}
							}
							$customOffer = true;
	//                        $offerAvailable = true;
						}
					}
				} else {
					//echo "no offers available";
					$offerAvailable = false;
				}
				if ($offerAmount != "") {
					$offerAmtArray[$f_id] = $offerAmount;
				}
			}
	//        if($customOffer==true){
	//            $entitled_offer
	//        }else{
	//            $entitled_offer
	//        }
			$entitled_offer = array_search(min($offerAmtArray), $offerAmtArray);
			$this->setId($entitled_offer);
			$data = $this->getById();
			$this->extractor($data);
			$offer_title=$this->title();
			$description = $this->des();
			if (empty($offerAmtArray)) { //if you only have custom offers
				$custom_array = array_merge($custom_cus_array, $custom_cus_array1);
				//$discount_price = $tot_pay - min($offerAmtArray);
			} else { //if you found good offers :) -- adding on custom offers to thta
				$custom_array = $custom_cus_array;
				//$discount_price = $tot_pay - min($offerAmtArray);
				$discount_price = min($offerAmtArray);
			}
			$discounted_total=min($offerAmtArray);
			//$discounted_total=$tot_pay - min($offerAmtArray);

	//        $tot_pay_lkr = Common::currencyConvert("USD", "LKR", $tot_pay);
	//        $discounted_total_lkr = Common::currencyConvert("USD", "LKR", $discounted_total);

			if ($_SESSION['display_rate_in'] == "LKR") {
				$tot_pay_lkr = $tot_pay;
			} else {
				$tot_pay_lkr = $tot_pay;
			}

			if ($_SESSION['display_rate_in'] == "LKR") {
				$discounted_total_lkr = $discounted_total;
			} else {
				$discounted_total_lkr = $discounted_total; //Common::currencyConvert($_SESSION['display_rate_in'], "LKR", $discounted_total);
			}


			$off_array = array("Total" => $tot_pay, "TotalLKR" => $tot_pay_lkr, "OfferAvailable" => $offerAvailable, "CustomOffer" => $customOffer, "DiscountedTotal" => $discounted_total, "DiscountedTotalLKR" => $discounted_total_lkr, "Discount" => $discount_price, "CurrencyType" => $_SESSION['display_rate_in'], "offer_id" => $entitled_offer, "Title" => $offer_title, "Description" => $description, "Custom" => $custom_array);
			if($offerAvailable==true || $customOffer==true ){
				Sessions::setOnlinePaymentOffer(urlencode(serialize($off_array)));
				if($customOffer==false) {
					if ($_SESSION['display_rate_in'] == "LKR") {
						Sessions::setOnlinePaymentRate($discounted_total_lkr);
					} else {
						Sessions::setOnlinePaymentRate($discounted_total);
					}
				}else{
					if ($_SESSION['display_rate_in'] == "LKR") {
						Sessions::setOnlinePaymentRate($tot_pay_lkr);
					}else if($customOffer==true){
						Sessions::setOnlinePaymentRate($tot_pay);
					}
				}
			}else {
				Sessions::resetOnlinePaymentOffer();
				if ($_SESSION['display_rate_in'] == "LKR") {
					Sessions::setOnlinePaymentRate($tot_pay_lkr);
				}else{
					Sessions::setOnlinePaymentRate($tot_pay);
				}
			}
			return $off_array;
		}
开发者ID:jcodesdotme,项目名称:pp,代码行数:101,代码来源:Offer.php


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