diff --git a/bin/frontend/controls/ShippingInfo.js b/bin/frontend/controls/ShippingInfo.js index f47e74300763ddde7b5c15d24d994a6ed1a59265..45aabeca215c36b4c152f3ccaffcf2f3d9a30d8d 100644 --- a/bin/frontend/controls/ShippingInfo.js +++ b/bin/frontend/controls/ShippingInfo.js @@ -48,16 +48,16 @@ define('package/quiqqer/shipping/bin/frontend/controls/ShippingInfo', [ require([ 'qui/controls/windows/Popup' - ], function (QUIConfirm) { - - new QUIConfirm({ + ], function (QUIPopup) { + new QUIPopup({ 'maxWidth' : 700, 'maxHeight': 600, - 'icon' : false, - 'title' : false, + 'icon' : 'fa fa-truck', + 'title' : QUILocale.get('quiqqer/shipping', 'frontend.shippingInfo.popup.title'), 'content' : QUILocale.get('quiqqer/shipping', 'frontend.shippingInfo.popup.content'), draggable : false, - resizable : false + resizable : false, + buttons : false }).open(); }); } diff --git a/locale.xml b/locale.xml index 1d60a7a313ae64d430706dc28bab6a05dc0d6aa2..54c1865474d120661e00e678d5d6e99399b2ebbe 100644 --- a/locale.xml +++ b/locale.xml @@ -269,6 +269,10 @@ <de><![CDATA[zzgl. Versand]]></de> <en><![CDATA[plus shipping]]></en> </locale> + <locale name="frontend.shippingInfo.popup.content"> + <de><![CDATA[Versandinformationen]]></de> + <en><![CDATA[Shipping information]]></en> + </locale> <locale name="frontend.shippingInfo.popup.content" html="true"> <de><![CDATA[<h2>Kostenloser Versand in Deutschland</h2> <p>Bei uns sind alle Bestellungen innerhalb Deutschlands versandkostenfrei! Wir versenden innerhalb Deutschlands per <strong>DHL Warenpost</strong> oder <strong>Deutsche Post Warenpost</strong>.</p> diff --git a/src/QUI/ERP/Shipping/Types/ShippingEntry.php b/src/QUI/ERP/Shipping/Types/ShippingEntry.php index 103f22051af6781992ffc94529503df01f20ca21..3a047731b5a1822f090b4e24e2199cb315d2a1ca 100644 --- a/src/QUI/ERP/Shipping/Types/ShippingEntry.php +++ b/src/QUI/ERP/Shipping/Types/ShippingEntry.php @@ -50,9 +50,9 @@ public function __construct($id, Factory $Factory) // delete locale $id = $this->getId(); - QUI\Translator::delete('quiqqer/shipping', 'shipping.'.$id.'.title'); - QUI\Translator::delete('quiqqer/shipping', 'shipping.'.$id.'.description'); - QUI\Translator::delete('quiqqer/shipping', 'shipping.'.$id.'.workingTitle'); + QUI\Translator::delete('quiqqer/shipping', 'shipping.' . $id . '.title'); + QUI\Translator::delete('quiqqer/shipping', 'shipping.' . $id . '.description'); + QUI\Translator::delete('quiqqer/shipping', 'shipping.' . $id . '.workingTitle'); try { QUI\Translator::publish('quiqqer/shipping'); @@ -76,8 +76,8 @@ public function toArray() $lg = 'quiqqer/shipping'; $id = $this->getId(); - $attributes = $this->getAttributes(); - $Locale = QUI::getLocale(); + $attributes = $this->getAttributes(); + $Locale = QUI::getLocale(); $currentLang = $Locale->getCurrent(); $availableLanguages = QUI\Translator::getAvailableLanguages(); @@ -86,24 +86,24 @@ public function toArray() $attributes['title'][$language] = $Locale->getByLang( $language, $lg, - 'shipping.'.$id.'.title' + 'shipping.' . $id . '.title' ); $attributes['description'][$language] = $Locale->getByLang( $language, $lg, - 'shipping.'.$id.'.description' + 'shipping.' . $id . '.description' ); $attributes['workingTitle'][$language] = $Locale->getByLang( $language, $lg, - 'shipping.'.$id.'.workingTitle' + 'shipping.' . $id . '.workingTitle' ); if ($language === $currentLang) { - $attributes['currentTitle'] = $attributes['title'][$language]; - $attributes['currentDescription'] = $attributes['description'][$language]; + $attributes['currentTitle'] = $attributes['title'][$language]; + $attributes['currentDescription'] = $attributes['description'][$language]; $attributes['currentWorkingTitle'] = $attributes['workingTitle'][$language]; } } @@ -118,11 +118,11 @@ public function toArray() } // icon - $attributes['icon'] = ''; + $attributes['icon'] = ''; $attributes['icon_path'] = ''; try { - $attributes['icon'] = $this->getIcon(); + $attributes['icon'] = $this->getIcon(); $attributes['icon_path'] = $this->getAttribute('icon'); } catch (QUI\Exception $Exception) { QUI\System\Log::writeDebugException($Exception); @@ -183,17 +183,17 @@ public function getPriceDisplay() { $PriceFactor = $this->toPriceFactor(); - $Order = $this->Order; + $Order = $this->Order; $isNetto = false; /* @var $Order QUI\ERP\Order\Order */ if ($Order) { $Customer = $Order->getCustomer(); - $isNetto = $Customer->isNetto(); + $isNetto = $Customer->isNetto(); } // display is incl vat - $vat = $PriceFactor->getVat(); + $vat = $PriceFactor->getVat(); $price = $this->getPrice(); if (!$isNetto && $vat) { @@ -205,7 +205,7 @@ public function getPriceDisplay() QUI\ERP\Defaults::getCurrency() ); - return '+'.$Price->getDisplayPrice(); + return '+' . $Price->getDisplayPrice(); } /** @@ -222,7 +222,7 @@ public function getPrice() foreach ($rules as $Rule) { $discount = $Rule->getAttribute('discount'); - $type = $Rule->getDiscountType(); + $type = $Rule->getDiscountType(); if ($type === QUI\ERP\Shipping\Rules\Factory::DISCOUNT_TYPE_ABS) { $price = $price + $discount; @@ -232,15 +232,15 @@ public function getPrice() if ($type === QUI\ERP\Shipping\Rules\Factory::DISCOUNT_TYPE_PC_ORDER && $Order) { try { /* @var $Order QUI\ERP\Order\Order */ - $Order = $this->Order; + $Order = $this->Order; $Calculation = $Order->getPriceCalculation(); - $nettoSum = $Calculation->getNettoSum()->get(); + $nettoSum = $Calculation->getNettoSum()->get(); if (!$nettoSum) { continue; } - $pc = \round($nettoSum * ($discount / 100)); + $pc = \round($nettoSum * ($discount / 100)); $price = $price + $pc; continue; @@ -249,7 +249,7 @@ public function getPrice() } } - $pc = \round($price * ($discount / 100)); + $pc = \round($price * ($discount / 100)); $price = $price + $pc; } @@ -299,7 +299,7 @@ public function canUsedBy( public function canUsedInOrder(QUI\ERP\Order\OrderInterface $Order) { if ($this->isActive() === false) { - Debug::addLog($this->getTitle().' is not active'); + Debug::addLog($this->getTitle() . ' is not active'); return false; } @@ -367,7 +367,7 @@ public function getTitle($Locale = null) return $Locale->get( 'quiqqer/shipping', - 'shipping.'.$this->getId().'.title' + 'shipping.' . $this->getId() . '.title' ); } @@ -385,7 +385,7 @@ public function getDescription($Locale = null) return $Locale->get( 'quiqqer/shipping', - 'shipping.'.$this->getId().'.description' + 'shipping.' . $this->getId() . '.description' ); } @@ -403,7 +403,7 @@ public function getWorkingTitle($Locale = null) return $Locale->get( 'quiqqer/shipping', - 'shipping.'.$this->getId().'.workingTitle' + 'shipping.' . $this->getId() . '.workingTitle' ); } @@ -444,7 +444,7 @@ public function getIcon() public function setTitle(array $titles) { $this->setShippingLocale( - 'shipping.'.$this->getId().'.title', + 'shipping.' . $this->getId() . '.title', $titles ); } @@ -457,7 +457,7 @@ public function setTitle(array $titles) public function setDescription(array $descriptions) { $this->setShippingLocale( - 'shipping.'.$this->getId().'.description', + 'shipping.' . $this->getId() . '.description', $descriptions ); } @@ -470,7 +470,7 @@ public function setDescription(array $descriptions) public function setWorkingTitle(array $titles) { $this->setShippingLocale( - 'shipping.'.$this->getId().'.workingTitle', + 'shipping.' . $this->getId() . '.workingTitle', $titles ); } @@ -513,8 +513,8 @@ protected function setShippingLocale($var, $title) continue; } - $data[$language] = $title[$language]; - $data[$language.'_edit'] = $title[$language]; + $data[$language] = $title[$language]; + $data[$language . '_edit'] = $title[$language]; } $exists = Translator::getVarData('quiqqer/shipping', $var, 'quiqqer/shipping'); @@ -586,7 +586,7 @@ public function getShippingRules() return []; } - $debugging = QUI\ERP\Shipping\Shipping::getInstance()->debuggingEnabled(); + $debugging = QUI\ERP\Shipping\Shipping::getInstance()->debuggingEnabled(); $debuggingLog = []; // get rules @@ -762,7 +762,8 @@ public function toPriceFactor( 'calculation' => QUI\ERP\Accounting\Calc::CALCULATION_COMPLEMENT, 'basis' => QUI\ERP\Accounting\Calc::CALCULATION_BASIS_CURRENTPRICE, 'value' => $this->getPrice(), - 'visible' => true + 'visible' => true, + 'currency' => $Order->getCurrency()->getCode() ]); $isEuVatUser = QUI\ERP\Tax\Utils::isUserEuVatUser( @@ -776,10 +777,10 @@ public function toPriceFactor( /* @var $Article QUI\ERP\Accounting\Article */ $Articles = $Order->getArticles(); - $vats = []; + $vats = []; foreach ($Articles as $Article) { - $vat = $Article->getVat(); + $vat = $Article->getVat(); $price = $Article->getPrice()->getValue(); if (!isset($vats[$vat])) {