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 Limit { protected $param; function __construct($param = []) { $this->setParam($param); } public function setParam($param) { foreach ($param as $name => $value) { $this->param[$name] = $value; } } public function verifyElementShowing($element, $prices) { $limitPriceOn = $this->param['limitPriceOn'] ?? false; if (!$limitPriceOn) return true; $allowShow = true; $ignoreSale = $this->param['ignoreSale'] ?? false; $extendPrice = $this->param['extendPrice'] ?? false; $limitMinPrice = $this->param['limitMinPrice'] ?: false; $limitMaxPrice = $this->param['limitMaxPrice'] ?: false; $limitPriceBeforeExtPrice = $this->param['limitPriceBeforeExtPrice'] ?? false; $minPrice = $prices['minPrice'] ?? 0; $fullPrice = $prices['fullPrice'] ?? 0; $price = $prices['price'] ?? 0; $verifiedPrice = $price; if ($extendPrice && $limitPriceBeforeExtPrice) { $commonPrice = new CommonPrice(['ignoreSale' => $ignoreSale]); $verifiedPrice = $commonPrice->getPrice($minPrice, $fullPrice); } if ($limitMinPrice !== false && $verifiedPrice < $limitMinPrice) $allowShow = false; if ($limitMaxPrice !== false && $verifiedPrice > $limitMaxPrice) $allowShow = false; return $allowShow; } }