Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/wbs24.ozonexport/lib/ |
Upload File : |
<?php namespace Wbs24\Ozonexport; class ExtendPrice extends Price { public function getPrice($minPrice, $fullPrice) { $ignoreSale = $this->param['ignoreSale'] ?? false; $basePrice = $ignoreSale ? $fullPrice : $minPrice; $plusPercent = intval($this->param['plusPercent'] ?? 0); $plusAdditionalSum = intval($this->param['plusAdditionalSum'] ?? 0); $price = $basePrice * (1 + ($plusPercent / 100)) + $plusAdditionalSum; $roundPrice = round($price); return $this->getPriceWithPackagingRatio($roundPrice); } public function getOldPrice($minPrice, $fullPrice) { $oldPricePlusPercent = intval($this->param['oldPricePlusPercent'] ?? 0); $oldPrice10kPlusPercent = intval($this->param['oldPrice10kPlusPercent'] ?? 0); $plusPercent = $oldPricePlusPercent; if ($minPrice > 10000) $plusPercent = $oldPrice10kPlusPercent; $oldPrice = (100 * $minPrice) / (100 - $plusPercent); if ($minPrice > 10000) { if ($minPrice + 500 >= $oldPrice) $oldPrice = 0; } else { if ($minPrice * 1.05 > $oldPrice) $oldPrice = 0; } return round($oldPrice); } public function getPremiumPrice($minPrice, $fullPrice) { $premiumPriceMinusPercent = intval($this->param['premiumPriceMinusPercent'] ?? 0); $premiumPrice = $minPrice * ((100 - $premiumPriceMinusPercent) / 100); if ($premiumPrice >= $minPrice) $premiumPrice = 0; return round($premiumPrice); } public function getMinPrice($minPrice, $fullPrice) { $newMinPriceMinusPercent = intval($this->param['newMinPriceMinusPercent'] ?? 0); $newMinPrice = $minPrice * ((100 - $newMinPriceMinusPercent) / 100); if ( !$this->validateMinPrice($minPrice, round($newMinPrice)) ) $newMinPrice = 0; return round($newMinPrice); } }