diff --git a/CHANGELOG.md b/CHANGELOG.md index a00a72467d328cf8d1843a468b459dea08429655..2984a09d5135829526e47019483548907161de44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,28 @@ +0.1.0-alpha91 +============= + * Added the following functional tests: + * Action Newsletter Template + * Import Custom Options + * Low Stock Products Report + * Search Terms Report + * Catalog: + * Removed the unused old pricing .phtml templates + * Removed direct dependencies on the Weee and Tax modules + * Tax: + * Added new price renderers for the Weee and Tax modules + * Fixed the @covers annotation in Integration tests + * Fixed bugs: + * Fixed an issue with FPT total line on the Shopping Cart page + * Fixed the Inline translation functionality both in the backend and the storefront + * Fixed an issue with the Translation dialog layout on the storefront + * Fixed an issue where only the first Tier Price row was saved during simple product creation + * Fixed an issue where it was impossible to save more than one group price + * Fixed an issue where it was impossible to create a shipping label + * Fixed an issue where Google Items synchronization resulted in a blank page + * Fixed an issue where a Shopping Cart with a lot of entries did not fit the page + * Fixed an issue where a JavaScript error blocked the checkout with credit cards type “Other†in online payment methods + * Fixed JavaScript error on the Payment Methods tab in System Configuration + 0.1.0-alpha90 ============= * Service layer implementation: diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json index ebd21d9c35d9de685e07957491529fb0557d61c7..e460f773cda4d4ac8d6f59878aa83dd257947988 100644 --- a/app/code/Magento/AdminNotification/composer.json +++ b/app/code/Magento/AdminNotification/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json index a00c08d4b68deaec3e5c9ec8ba1da9b83e8465ec..97243800f890e57ff1ca9b603186530a52f69317 100644 --- a/app/code/Magento/Authorization/composer.json +++ b/app/code/Magento/Authorization/composer.json @@ -3,12 +3,12 @@ "description": "Authorization module provides access to Magento ACL functionality.", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Authorizenet/composer.json b/app/code/Magento/Authorizenet/composer.json index 6b8835ccde63b1859ad7c3b3dae646dbb600aabe..cdb900f8b94c94667ad134167ddbcf4f9322e5c0 100644 --- a/app/code/Magento/Authorizenet/composer.json +++ b/app/code/Magento/Authorizenet/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-payment": "0.1.0-alpha90", - "magento/module-centinel": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-payment": "0.1.0-alpha91", + "magento/module-centinel": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json index 2ff611ae678f27f5ce2ae81b94effa0cc01268ee..263e29d914d1c1feff16a3ab4bc576422c7d2497 100644 --- a/app/code/Magento/Backend/composer.json +++ b/app/code/Magento/Backend/composer.json @@ -3,32 +3,32 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-cron": "0.1.0-alpha90", - "magento/module-sendfriend": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-weee": "0.1.0-alpha90", - "magento/module-reports": "0.1.0-alpha90", - "magento/module-catalog-search": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-user": "0.1.0-alpha90", - "magento/module-cms": "0.1.0-alpha90", - "magento/module-backup": "0.1.0-alpha90", - "magento/module-email": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-url-rewrite": "0.1.0-alpha90", - "magento/module-translation": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-cron": "0.1.0-alpha91", + "magento/module-sendfriend": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-weee": "0.1.0-alpha91", + "magento/module-reports": "0.1.0-alpha91", + "magento/module-catalog-search": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-user": "0.1.0-alpha91", + "magento/module-cms": "0.1.0-alpha91", + "magento/module-backup": "0.1.0-alpha91", + "magento/module-email": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-url-rewrite": "0.1.0-alpha91", + "magento/module-translation": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json index b14d72430261184eebe956aab2769cf7933932e4..e37e10dc9887bb4dde944f55739398fd9b271718 100644 --- a/app/code/Magento/Backup/composer.json +++ b/app/code/Magento/Backup/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-cron": "0.1.0-alpha90", - "magento/module-index": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-cron": "0.1.0-alpha91", + "magento/module-index": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/Price.php b/app/code/Magento/Bundle/Block/Catalog/Product/Price.php index 792c4dcd3571932b5e6efd34a5164b9d847a65ae..9b6e5eb63262c41fe01a5c69667df03bcaf1397e 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/Price.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/Price.php @@ -29,33 +29,38 @@ namespace Magento\Bundle\Block\Catalog\Product; */ class Price extends \Magento\Catalog\Block\Product\Price { + /** + * @var \Magento\Tax\Helper\Data + */ + protected $_taxHelper; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Framework\Registry $registry * @param \Magento\Framework\Stdlib\String $string * @param \Magento\Framework\Math\Random $mathRandom * @param \Magento\Checkout\Helper\Cart $cartHelper + * @param \Magento\Tax\Helper\Data $taxData * @param array $data */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Tax\Helper\Data $taxData, \Magento\Framework\Registry $registry, \Magento\Framework\Stdlib\String $string, \Magento\Framework\Math\Random $mathRandom, \Magento\Checkout\Helper\Cart $cartHelper, + \Magento\Tax\Helper\Data $taxData, array $data = array() ) { + $this->_taxHelper = $taxData; parent::__construct( $context, $jsonEncoder, $catalogData, - $taxData, $registry, $string, $mathRandom, @@ -78,7 +83,7 @@ class Price extends \Magento\Catalog\Block\Product\Price ) { return false; } - return $this->_taxData->displayBothPrices(); + return $this->_taxHelper->displayBothPrices(); } /** diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php index 5db6ad5396e5f5f91e8556fa38702a7cba7804aa..c20dc7bf9be7c1e7984883d9de63fc79c3845554 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php @@ -49,15 +49,25 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price */ protected $_coreHelper; + /** + * @var \Magento\Tax\Helper\Data + */ + protected $_taxHelper; + + /** + * @var \Magento\Catalog\Helper\Data + */ + protected $_catalogHelper; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Framework\Registry $registry * @param \Magento\Framework\Stdlib\String $string * @param \Magento\Framework\Math\Random $mathRandom * @param \Magento\Checkout\Helper\Cart $cartHelper + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Helper\Data $coreHelper * @param array $data * @@ -67,24 +77,26 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Tax\Helper\Data $taxData, \Magento\Framework\Registry $registry, \Magento\Framework\Stdlib\String $string, \Magento\Framework\Math\Random $mathRandom, \Magento\Checkout\Helper\Cart $cartHelper, + \Magento\Tax\Helper\Data $taxData, \Magento\Core\Helper\Data $coreHelper, array $data = array() ) { $this->_coreHelper = $coreHelper; + $this->_catalogHelper = $catalogData; + $this->_taxHelper = $taxData; parent::__construct( $context, $jsonEncoder, $catalogData, - $taxData, $registry, $string, $mathRandom, $cartHelper, + $taxData, $data ); } @@ -294,7 +306,8 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price */ public function formatPriceString($price, $includeContainer = true) { - $taxHelper = $this->_taxData; + $catalogHelper = $this->_catalogHelper; + $taxHelper = $this->_taxHelper; $coreHelper = $this->_coreHelper; $currentProduct = $this->getProduct(); if ($currentProduct->getPriceType() == Price::PRICE_TYPE_DYNAMIC && $this->getFormatProduct()) { @@ -303,8 +316,8 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price $product = $currentProduct; } - $priceTax = $taxHelper->getPrice($product, $price); - $priceIncTax = $taxHelper->getPrice($product, $price, true); + $priceTax = $catalogHelper->getTaxPrice($product, $price); + $priceIncTax = $catalogHelper->getTaxPrice($product, $price, true); $formatted = $coreHelper->currencyByStore($priceTax, $product->getStore(), true, $includeContainer); if ($taxHelper->displayBothPrices() && $priceTax != $priceIncTax) { diff --git a/app/code/Magento/Bundle/Model/Product/Price.php b/app/code/Magento/Bundle/Model/Product/Price.php index 0a06eec93cba82d9aedb0e7b3cb50b2a67aaaf6b..fa90ad6c36da838e9cfb1597ded587f5bbee7f69 100644 --- a/app/code/Magento/Bundle/Model/Product/Price.php +++ b/app/code/Magento/Bundle/Model/Product/Price.php @@ -49,16 +49,11 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price protected $_isPricesCalculatedByIndex; /** - * Is min/max prices have been calculated by index + * Catalog data * - * @return bool + * @var \Magento\Catalog\Helper\Data */ - /** - * Tax data - * - * @var \Magento\Tax\Helper\Data - */ - protected $_taxData = null; + protected $_catalogData = null; /** * Construct @@ -68,7 +63,7 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Tax\Helper\Data $taxData + * @param \Magento\Catalog\Helper\Data $catalogData */ public function __construct( \Magento\CatalogRule\Model\Resource\RuleFactory $ruleFactory, @@ -76,13 +71,15 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Customer\Model\Session $customerSession, \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Tax\Helper\Data $taxData + \Magento\Catalog\Helper\Data $catalogData ) { - $this->_taxData = $taxData; + $this->_catalogData = $catalogData; parent::__construct($ruleFactory, $storeManager, $localeDate, $customerSession, $eventManager); } /** + * Is min/max prices have been calculated by index + * * @return bool */ public function getIsPricesCalculatedByIndex() @@ -196,8 +193,8 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price { // check calculated price index if ($product->getData('min_price') && $product->getData('max_price')) { - $minimalPrice = $this->_taxData->getPrice($product, $product->getData('min_price'), $includeTax); - $maximalPrice = $this->_taxData->getPrice($product, $product->getData('max_price'), $includeTax); + $minimalPrice = $this->_catalogData->getTaxPrice($product, $product->getData('min_price'), $includeTax); + $maximalPrice = $this->_catalogData->getTaxPrice($product, $product->getData('max_price'), $includeTax); $this->_isPricesCalculatedByIndex = true; } else { /** @@ -205,7 +202,7 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price */ $finalPrice = $product->getFinalPrice(); if ($product->getPriceType() == self::PRICE_TYPE_FIXED) { - $minimalPrice = $maximalPrice = $this->_taxData->getPrice($product, $finalPrice, $includeTax); + $minimalPrice = $maximalPrice = $this->_catalogData->getTaxPrice($product, $finalPrice, $includeTax); } else { // PRICE_TYPE_DYNAMIC $minimalPrice = $maximalPrice = 0; @@ -235,7 +232,7 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price $item = $product->getPriceType() == self::PRICE_TYPE_FIXED ? $product : $selection; - $selectionMinimalPrices[] = $this->_taxData->getPrice( + $selectionMinimalPrices[] = $this->_catalogData->getTaxPrice( $item, $this->getSelectionFinalTotalPrice( $product, @@ -247,7 +244,7 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price ), $includeTax ); - $selectionMaximalPrices[] = $this->_taxData->getPrice( + $selectionMaximalPrices[] = $this->_catalogData->getTaxPrice( $item, $this->getSelectionFinalTotalPrice( $product, @@ -303,7 +300,7 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price } if (count($prices)) { if ($customOption->getIsRequire()) { - $minimalPrice += $this->_taxData->getPrice($product, min($prices), $includeTax); + $minimalPrice += $this->_catalogData->getTaxPrice($product, min($prices), $includeTax); } $multiTypes = array( @@ -316,15 +313,15 @@ class Price extends \Magento\Catalog\Model\Product\Type\Price } else { $maximalValue = max($prices); } - $maximalPrice += $this->_taxData->getPrice($product, $maximalValue, $includeTax); + $maximalPrice += $this->_catalogData->getTaxPrice($product, $maximalValue, $includeTax); } } else { $valuePrice = $customOption->getPrice(true); if ($customOption->getIsRequire()) { - $minimalPrice += $this->_taxData->getPrice($product, $valuePrice, $includeTax); + $minimalPrice += $this->_catalogData->getTaxPrice($product, $valuePrice, $includeTax); } - $maximalPrice += $this->_taxData->getPrice($product, $valuePrice, $includeTax); + $maximalPrice += $this->_catalogData->getTaxPrice($product, $valuePrice, $includeTax); } } } diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json index c0a9d91f9b573214144cd68177d600808e4f1f85..1bc4d0b8abc363b946bb9b87127aa3c2fc34159c 100644 --- a/app/code/Magento/Bundle/composer.json +++ b/app/code/Magento/Bundle/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-catalog-rule": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-weee": "0.1.0-alpha90", - "magento/module-gift-message": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", - "magento/module-webapi": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-catalog-rule": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-weee": "0.1.0-alpha91", + "magento/module-gift-message": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", + "magento/module-webapi": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Bundle/view/frontend/templates/rss/catalog/product/price.phtml b/app/code/Magento/Bundle/view/frontend/templates/rss/catalog/product/price.phtml deleted file mode 100644 index 209d6a4c6a3fffcef492788d34ca75eda95567cc..0000000000000000000000000000000000000000 --- a/app/code/Magento/Bundle/view/frontend/templates/rss/catalog/product/price.phtml +++ /dev/null @@ -1,273 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> - -<?php -/** - * Template for displaying bundle product price in RSS feeds - * - * @var $this \Magento\Bundle\Block\Catalog\Product\Price - */ -?> - -<?php $_product = $this->getProduct() ?> -<?php -/** @var \Magento\Bundle\Model\Product\Price $_priceModel */ -$_priceModel = $_product->getPriceModel() -?> -<?php list($_minimalPrice, $_maximalPrice) = $_priceModel->getTotalPrices($_product) ?> -<?php $_id = $_product->getId() ?> - -<?php $_weeeTaxAmount = 0; ?> - -<?php $_minimalPriceTax = $this->helper('Magento\Tax\Helper\Data')->getPrice($_product, $_minimalPrice); ?> -<?php $_minimalPriceInclTax = $this->helper('Magento\Tax\Helper\Data')->getPrice($_product, $_minimalPrice, true); ?> - -<?php -if ($_product->getPriceType() == 1) { - $_weeeTaxAmount = $this->helper('Magento\Weee\Helper\Data')->getAmount($_product); - if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4))) { - $_minimalPriceTax += $_weeeTaxAmount; - $_minimalPriceInclTax += $_weeeTaxAmount; - } - if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)) { - $_minimalPriceInclTax += $_weeeTaxAmount; - } - - if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1,2,4))) { - $_weeeTaxAttributes = $this->helper('Magento\Weee\Helper\Data')->getProductWeeeAttributesForDisplay($_product); - } -} -?> - -<div class="price-box"> - <?php if ($_product->getPriceView()): ?> - <p class="minimal-price"> - <span class="price-label"><?php echo __('As low as') ?>:</span> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayBothPrices()): ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> - <span class="weee">(<small> - <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> - <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> - <?php else: ?> - <?php $amount = $_weeeTaxAttribute->getAmount(); ?> - <?php endif; ?> - - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($amount, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <?php endif; ?> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> - </span> - <?php else: ?> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> - <span class="weee">(<small> - <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> - <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> - <?php else: ?> - <?php $amount = $_weeeTaxAttribute->getAmount(); ?> - <?php endif; ?> - - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($amount, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2) && $_weeeTaxAmount): ?> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> - <?php endif; ?> - <?php endif; ?> - </p> - <?php else: ?> - <?php if ($_minimalPrice <> $_maximalPrice): ?> - <p class="price-from"> - <span class="price-label"><?php echo __('From') ?>:</span> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayBothPrices()): ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> - <span class="weee">(<small> - <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> - <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> - <?php else: ?> - <?php $amount = $_weeeTaxAttribute->getAmount(); ?> - <?php endif; ?> - - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($amount, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <?php endif; ?> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> - </span> - <?php else: ?> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> - <span class="weee">(<small> - <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> - <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> - <?php else: ?> - <?php $amount = $_weeeTaxAttribute->getAmount(); ?> - <?php endif; ?> - - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($amount, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2) && $_weeeTaxAmount): ?> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> - <?php endif; ?> - <?php endif; ?> - </p> - <?php $_maximalPriceTax = $this->helper('Magento\Tax\Helper\Data')->getPrice($_product, $_maximalPrice); ?> - <?php $_maximalPriceInclTax = $this->helper('Magento\Tax\Helper\Data')->getPrice($_product, $_maximalPrice, true); ?> - <?php - if ($_product->getPriceType() == 1) { - if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4))) { - $_maximalPriceTax += $_weeeTaxAmount; - $_maximalPriceInclTax += $_weeeTaxAmount; - } - if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)) { - $_maximalPriceInclTax += $_weeeTaxAmount; - } - } - ?> - <p class="price-to"> - <span class="price-label"><?php echo __('To') ?>:</span> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayBothPrices()): ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_maximalPriceTax) ?> - </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> - <span class="weee">(<small> - <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> - <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> - <?php else: ?> - <?php $amount = $_weeeTaxAttribute->getAmount(); ?> - <?php endif; ?> - - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($amount, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <?php endif; ?> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax') ?></span> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_maximalPriceInclTax) ?> - </span> - <?php else: ?> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_maximalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> - <span class="weee">(<small> - <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> - <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> - <?php else: ?> - <?php $amount = $_weeeTaxAttribute->getAmount(); ?> - <?php endif; ?> - - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($amount, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2) && $_weeeTaxAmount): ?> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_maximalPriceInclTax) ?> - <?php endif; ?> - <?php endif; ?> - </p> - <?php else: ?> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayBothPrices()): ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - </span> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> - <span class="weee">(<small> - <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> - <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> - <?php else: ?> - <?php $amount = $_weeeTaxAttribute->getAmount(); ?> - <?php endif; ?> - - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($amount, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <?php endif; ?> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> - </span> - <?php else: ?> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceTax) ?> - <?php if ($_weeeTaxAmount && $_product->getPriceType() == 1 && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 1, 4))): ?> - <span class="weee">(<small> - <?php $_weeeSeparator = ''; foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(2, 4))): ?> - <?php $amount = $_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(); ?> - <?php else: ?> - <?php $amount = $_weeeTaxAttribute->getAmount(); ?> - <?php endif; ?> - - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($amount, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2) && $_weeeTaxAmount): ?> - <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceInclTax) ?> - <?php endif; ?> - <?php endif; ?> - <?php endif; ?> - <?php endif; ?> -</div> diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index c00bf2b08251e7ae6399bb96602a973bedd73bc8..0a57db0f697e955cfd56cb2faf5454234368d116 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php index 210bae3a109d96e7bdc228c75b5f50c8a79091b8..05d7aed24b640093f43d7cc5156eb24a0259884f 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php @@ -146,15 +146,15 @@ class Attributes extends \Magento\Catalog\Block\Adminhtml\Form implements // Add name attribute to checkboxes that correspond to multiselect elements $nameAttributeHtml = $element->getExtType() === 'multiple' ? 'name="' . $element->getId() . '_checkbox"' : ''; $elementId = $element->getId(); + $dataAttribute = "data-disable='{$elementId}'"; $checkboxLabel = __('Change'); $html = <<<HTML <span class="attribute-change-checkbox"> <label> - <input type="checkbox" $nameAttributeHtml onclick="toogleFieldEditMode(this, '{$elementId}')" /> + <input type="checkbox" $nameAttributeHtml onclick="toogleFieldEditMode(this, '{$elementId}')" $dataAttribute /> {$checkboxLabel} </label> </span> -<script>initDisableFields("{$elementId}")</script> HTML; if ($elementId === 'weight') { $html .= <<<HTML diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php index d1a2a44fcf66eb53d33d1011cfbd66a7b1b6e7d4..b8d09e0cbcc0bc8e43212109b8457e53084af0a4 100644 --- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php @@ -33,18 +33,6 @@ abstract class AbstractProduct extends \Magento\Framework\View\Element\Template */ protected $_priceBlock = array(); - /** - * Default price block - * - * @var string - */ - protected $_block = 'Magento\Catalog\Block\Product\Price'; - - /** - * @var string - */ - protected $_priceBlockDefaultTemplate = 'product/price.phtml'; - /** * Flag which allow/disallow to use link for as low as price * diff --git a/app/code/Magento/Catalog/Block/Product/Price.php b/app/code/Magento/Catalog/Block/Product/Price.php index 5eb7f77d1a6b4e3cdb270449494643354c1554c8..5d0593e5c9bf2d310a19dd0a29855fa28f3e6e0b 100644 --- a/app/code/Magento/Catalog/Block/Product/Price.php +++ b/app/code/Magento/Catalog/Block/Product/Price.php @@ -46,13 +46,6 @@ class Price extends \Magento\Framework\View\Element\Template implements \Magento */ protected $_coreRegistry = null; - /** - * Tax data - * - * @var \Magento\Tax\Helper\Data - */ - protected $_taxData = null; - /** * Catalog data * @@ -84,7 +77,6 @@ class Price extends \Magento\Framework\View\Element\Template implements \Magento * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Framework\Registry $registry * @param \Magento\Framework\Stdlib\String $string * @param \Magento\Framework\Math\Random $mathRandom @@ -95,20 +87,18 @@ class Price extends \Magento\Framework\View\Element\Template implements \Magento \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Tax\Helper\Data $taxData, \Magento\Framework\Registry $registry, \Magento\Framework\Stdlib\String $string, \Magento\Framework\Math\Random $mathRandom, \Magento\Checkout\Helper\Cart $cartHelper, array $data = array() ) { - $this->_cartHelper = $cartHelper; $this->_jsonEncoder = $jsonEncoder; - $this->_coreRegistry = $registry; $this->_catalogData = $catalogData; - $this->_taxData = $taxData; + $this->_coreRegistry = $registry; $this->string = $string; $this->mathRandom = $mathRandom; + $this->_cartHelper = $cartHelper; parent::__construct($context, $data); } diff --git a/app/code/Magento/Catalog/Block/Product/View/Options.php b/app/code/Magento/Catalog/Block/Product/View/Options.php index 7fc9f67cc4ac2655361f48f88a319c352c50038a..982273aa7fcd075db68c2dfcb070e2829f69792c 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options.php @@ -53,13 +53,6 @@ class Options extends \Magento\Framework\View\Element\Template */ protected $_registry = null; - /** - * Tax data - * - * @var \Magento\Tax\Helper\Data - */ - protected $_taxData = null; - /** * Catalog product * @@ -77,11 +70,16 @@ class Options extends \Magento\Framework\View\Element\Template */ protected $_coreData; + /** + * @var \Magento\Catalog\Helper\Data + */ + protected $_catalogData; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Framework\Json\EncoderInterface $jsonEncoder - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Model\Product\Option $option * @param \Magento\Framework\Registry $registry * @param \Magento\Framework\Stdlib\ArrayUtils $arrayUtils @@ -90,18 +88,18 @@ class Options extends \Magento\Framework\View\Element\Template public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Framework\Json\EncoderInterface $jsonEncoder, - \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Model\Product\Option $option, \Magento\Framework\Registry $registry, \Magento\Framework\Stdlib\ArrayUtils $arrayUtils, array $data = array() ) { $this->_coreData = $coreData; + $this->_catalogData = $catalogData; $this->_jsonEncoder = $jsonEncoder; $this->_registry = $registry; $this->_option = $option; - $this->_taxData = $taxData; $this->arrayUtils = $arrayUtils; parent::__construct($context, $data); } @@ -181,8 +179,8 @@ class Options extends \Magento\Framework\View\Element\Template $data['oldPrice'] = $this->_coreData->currency($option->getPrice(false), false, false); $data['priceValue'] = $option->getPrice(false); $data['type'] = $option->getPriceType(); - $data['exclTaxPrice'] = $price = $this->_taxData->getPrice($option->getProduct(), $data['price'], false); - $data['inclTaxPrice'] = $price = $this->_taxData->getPrice($option->getProduct(), $data['price'], true); + $data['exclTaxPrice'] = $price = $this->_catalogData->getTaxPrice($option->getProduct(), $data['price']); + $data['inclTaxPrice'] = $price = $this->_catalogData->getTaxPrice($option->getProduct(), $data['price'], true); return $data; } diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php index fe1bb8360e3e098435deacad35895bfd296c9e7a..817eecc34a839838624136e09369570a7a9c3264 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php @@ -47,31 +47,29 @@ abstract class AbstractOptions extends \Magento\Framework\View\Element\Template protected $_option; /** - * Tax data - * - * @var \Magento\Tax\Helper\Data + * @var \Magento\Core\Helper\Data */ - protected $_taxData = null; + protected $_coreHelper; /** - * @var \Magento\Core\Helper\Data + * @var \Magento\Catalog\Helper\Data */ - protected $_coreHelper; + protected $_catalogHelper; /** * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Helper\Data $coreHelper + * @param \Magento\Catalog\Helper\Data $catalogData, * @param array $data */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Helper\Data $coreHelper, + \Magento\Catalog\Helper\Data $catalogData, array $data = array() ) { $this->_coreHelper = $coreHelper; - $this->_taxData = $taxData; + $this->_catalogHelper = $catalogData; parent::__construct($context, $data); } @@ -181,9 +179,9 @@ abstract class AbstractOptions extends \Magento\Framework\View\Element\Template public function getPrice($price, $includingTax = null) { if (!is_null($includingTax)) { - $price = $this->_taxData->getPrice($this->getProduct(), $price, true); + $price = $this->_catalogHelper->getTaxPrice($this->getProduct(), $price, true); } else { - $price = $this->_taxData->getPrice($this->getProduct(), $price); + $price = $this->_catalogHelper->getTaxPrice($this->getProduct(), $price); } return $price; } diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php index a191249c092e4668a3984486f1b4e457bf4841af..3369bd4238f5bbdff5538bc2663ed122b8bdae4d 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php @@ -48,20 +48,20 @@ class Date extends \Magento\Catalog\Block\Product\View\Options\AbstractOptions /** * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Helper\Data $coreHelper + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Product\Option\Type\Date $catalogProductOptionTypeDate * @param array $data */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Helper\Data $coreHelper, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Product\Option\Type\Date $catalogProductOptionTypeDate, array $data = array() ) { $this->_catalogProductOptionTypeDate = $catalogProductOptionTypeDate; - parent::__construct($context, $taxData, $coreHelper, $data); + parent::__construct($context, $coreHelper, $catalogData, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php index 4baa482fa6331068718f7c02688bfce55ff24000..244891b4f3de1e1955aa1fb05661b2bd00bae0ce 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php @@ -39,18 +39,18 @@ class Select extends \Magento\Catalog\Block\Product\View\Options\AbstractOptions /** * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Helper\Data $coreHelper + * @param \Magento\Catalog\Helper\Data $catalogData * @param array $data */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Helper\Data $coreHelper, + \Magento\Catalog\Helper\Data $catalogData, array $data = array() ) { $this->_coreHelper = $coreHelper; - parent::__construct($context, $taxData, $coreHelper, $data); + parent::__construct($context, $coreHelper, $catalogData, $data); } /** diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php index a1d9f92e29413288ebd509f4f7f5ac9755e9499f..8bcf964d1916d4c0bdd3cc2ac46ca712c394665f 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php @@ -154,8 +154,7 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribut /** @var \Magento\CatalogInventory\Service\V1\StockItemService $stockItemService */ $stockItemService = $this->_objectManager ->create('Magento\CatalogInventory\Service\V1\StockItemService'); - - foreach ($this->_helper->getProductIds() as $productId) { + foreach ($this->attributeHelper->getProductIds() as $productId) { $stockItemDo = $stockItemService->getStockItem($productId); if (!$stockItemDo->getProductId()) { $inventoryData[] = $productId; @@ -165,7 +164,7 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribut $this->stockItemBuilder->mergeDataObjectWithArray($stockItemDo, $inventoryData) ); } - $this->_stockIndexerProcessor->reindexList($this->_helper->getProductIds()); + $this->_stockIndexerProcessor->reindexList($this->attributeHelper->getProductIds()); } if ($websiteAddData || $websiteRemoveData) { diff --git a/app/code/Magento/Catalog/Helper/Data.php b/app/code/Magento/Catalog/Helper/Data.php index 36b8da0aa9b668bd7e4375518b05898bbd5ecf94..1a1bf36b4c521300f31a5fca392d19db715bff53 100644 --- a/app/code/Magento/Catalog/Helper/Data.php +++ b/app/code/Magento/Catalog/Helper/Data.php @@ -24,6 +24,14 @@ namespace Magento\Catalog\Helper; use Magento\Catalog\Model\Product\Attribute\Source\Msrp\Type; +use Magento\Tax\Service\V1\Data\QuoteDetailsBuilder; +use Magento\Tax\Service\V1\Data\QuoteDetails\ItemBuilder as QuoteDetailsItemBuilder; +use Magento\Tax\Service\V1\Data\TaxClassKey; +use Magento\Tax\Service\V1\Data\TaxClassKeyBuilder; +use Magento\Tax\Service\V1\TaxCalculationServiceInterface; +use Magento\Customer\Model\Address\Converter as AddressConverter; +use Magento\Customer\Model\Session as CustomerSession; +use Magento\Tax\Model\Config; /** * Catalog data helper @@ -167,6 +175,53 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper */ protected $_escaper; + /** + * Tax class key builder + * + * @var \Magento\Tax\Service\V1\Data\TaxClassKeyBuilder + */ + protected $_taxClassKeyBuilder; + + /** + * Tax helper + * + * @var \Magento\Tax\Model\Config + */ + protected $_taxConfig; + + /** + * Quote details builder + * + * @var QuoteDetailsBuilder + */ + protected $_quoteDetailsBuilder; + + /** + * Quote details item builder + * + * @var QuoteDetailsItemBuilder + */ + protected $_quoteDetailsItemBuilder; + + /** + * Address converter + * + * @var AddressConverter + */ + protected $_addressConverter; + + /** + * @var CustomerSession + */ + protected $_customerSession; + + /** + * Tax calculation service interface + * + * @var \Magento\Tax\Service\V1\TaxCalculationServiceInterface + */ + protected $_taxCalculationService; + /** * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Catalog\Model\Resource\Eav\AttributeFactory $eavAttributeFactory @@ -182,6 +237,13 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper * @param \Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory * @param \Magento\Framework\Escaper $escaper * @param string $templateFilterModel + * @param \Magento\Tax\Service\V1\Data\TaxClassKeyBuilder $taxClassKeyBuilder + * @param \Magento\Tax\Model\Config $taxConfig + * @param QuoteDetailsBuilder $quoteDetailsBuilder + * @param QuoteDetailsItemBuilder $quoteDetailsItemBuilder + * @param \Magento\Tax\Service\V1\TaxCalculationServiceInterface $taxCalculationService + * @param CustomerSession $customerSession + * @param AddressConverter $addressConverter */ public function __construct( \Magento\Framework\App\Helper\Context $context, @@ -197,7 +259,14 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory, \Magento\Framework\Escaper $escaper, - $templateFilterModel + $templateFilterModel, + \Magento\Tax\Service\V1\Data\TaxClassKeyBuilder $taxClassKeyBuilder, + \Magento\Tax\Model\Config $taxConfig, + QuoteDetailsBuilder $quoteDetailsBuilder, + QuoteDetailsItemBuilder $quoteDetailsItemBuilder, + \Magento\Tax\Service\V1\TaxCalculationServiceInterface $taxCalculationService, + CustomerSession $customerSession, + AddressConverter $addressConverter ) { $this->_eavAttributeFactory = $eavAttributeFactory; $this->_categoryFactory = $categoryFactory; @@ -212,6 +281,13 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper $this->_coreRegistry = $coreRegistry; $this->_templateFilterModel = $templateFilterModel; $this->_escaper = $escaper; + $this->_taxClassKeyBuilder = $taxClassKeyBuilder; + $this->_taxConfig = $taxConfig; + $this->_quoteDetailsBuilder = $quoteDetailsBuilder; + $this->_quoteDetailsItemBuilder = $quoteDetailsItemBuilder; + $this->_taxCalculationService = $taxCalculationService; + $this->_customerSession = $customerSession; + $this->_addressConverter = $addressConverter; parent::__construct($context); } @@ -626,4 +702,113 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper $storeId ); } + + /** + * Get product price with all tax settings processing + * + * @param \Magento\Catalog\Model\Product $product + * @param float $price inputted product price + * @param bool $includingTax return price include tax flag + * @param null|Address $shippingAddress + * @param null|Address $billingAddress + * @param null|int $ctc customer tax class + * @param null|string|bool|int|Store $store + * @param bool $priceIncludesTax flag what price parameter contain tax + * @param bool $roundPrice + * @return float + */ + public function getTaxPrice( + $product, + $price, + $includingTax = null, + $shippingAddress = null, + $billingAddress = null, + $ctc = null, + $store = null, + $priceIncludesTax = null, + $roundPrice = true + ) { + if (!$price) { + return $price; + } + + $store = $this->_storeManager->getStore($store); + if ($this->_taxConfig->needPriceConversion($store)) { + if (is_null($priceIncludesTax)) { + $priceIncludesTax = $this->_taxConfig->priceIncludesTax($store); + } + + $shippingAddressDataObject = null; + if ($shippingAddress instanceof \Magento\Customer\Model\Address\AbstractAddress) { + $shippingAddressDataObject = $this->_addressConverter->createAddressFromModel( + $shippingAddress, + null, + null + ); + } + + $billingAddressDataObject = null; + if ($billingAddress instanceof \Magento\Customer\Model\Address\AbstractAddress) { + $billingAddressDataObject = $this->_addressConverter->createAddressFromModel( + $billingAddress, + null, + null + ); + } + + $item = $this->_quoteDetailsItemBuilder->setQuantity(1) + ->setCode($product->getSku()) + ->setShortDescription($product->getShortDescription()) + ->setTaxClassKey( + $this->_taxClassKeyBuilder->setType(TaxClassKey::TYPE_ID) + ->setValue($product->getTaxClassId())->create() + )->setTaxIncluded($priceIncludesTax) + ->setType('product') + ->setUnitPrice($price) + ->create(); + $quoteDetails = $this->_quoteDetailsBuilder + ->setShippingAddress($shippingAddressDataObject) + ->setBillingAddress($billingAddressDataObject) + ->setCustomerTaxClassKey( + $this->_taxClassKeyBuilder->setType(TaxClassKey::TYPE_ID) + ->setValue($ctc)->create() + )->setItems([$item]) + ->setCustomerId($this->_customerSession->getCustomerId()) + ->create(); + + $storeId = null; + if ($store) { + $storeId = $store->getId(); + } + $taxDetails = $this->_taxCalculationService->calculateTax($quoteDetails, $storeId); + $items = $taxDetails->getItems(); + $taxDetailsItem = array_shift($items); + + if (!is_null($includingTax)) { + if ($includingTax) { + $price = $taxDetailsItem->getPriceInclTax(); + } else { + $price = $taxDetailsItem->getPrice(); + } + } else { + switch ($this->_taxConfig->getPriceDisplayType($store)) { + case Config::DISPLAY_TYPE_EXCLUDING_TAX: + case Config::DISPLAY_TYPE_BOTH: + $price = $taxDetailsItem->getPrice(); + break; + case Config::DISPLAY_TYPE_INCLUDING_TAX: + $price = $taxDetailsItem->getPriceInclTax(); + break; + default: + break; + } + } + } + + if ($roundPrice) { + return $store->roundPrice($price); + } else { + return $price; + } + } } diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json index 76630102310a3ec8463117dc6b70a9134239c2f3..7ab74d258bd02bbbc80d16e130fc6acc7ac07c81 100644 --- a/app/code/Magento/Catalog/composer.json +++ b/app/code/Magento/Catalog/composer.json @@ -3,34 +3,33 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-cms": "0.1.0-alpha90", - "magento/module-index": "0.1.0-alpha90", - "magento/module-indexer": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-log": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-widget": "0.1.0-alpha90", - "magento/module-wishlist": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-bundle": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-catalog-rule": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-catalog-search": "0.1.0-alpha90", - "magento/module-weee": "0.1.0-alpha90", - "magento/module-product-alert": "0.1.0-alpha90", - "magento/module-url-rewrite": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-cms": "0.1.0-alpha91", + "magento/module-index": "0.1.0-alpha91", + "magento/module-indexer": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-log": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-widget": "0.1.0-alpha91", + "magento/module-wishlist": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-bundle": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-catalog-rule": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-catalog-search": "0.1.0-alpha91", + "magento/module-product-alert": "0.1.0-alpha91", + "magento/module-url-rewrite": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Catalog/etc/module.xml b/app/code/Magento/Catalog/etc/module.xml index f9b6b5c0836fea04b2cd45eae300a4f9e486e52f..575f1f91c1807416e1c5f6c36b55c74d66fd7e80 100644 --- a/app/code/Magento/Catalog/etc/module.xml +++ b/app/code/Magento/Catalog/etc/module.xml @@ -53,7 +53,6 @@ <module name="Magento_CatalogRule"/> <module name="Magento_Sales"/> <module name="Magento_CatalogSearch"/> - <module name="Magento_Weee"/> <module name="Magento_ProductAlert"/> <module name="Magento_UrlRewrite"/> </depends> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/price.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/price.phtml deleted file mode 100644 index 9f5f6a91e3a8e1abfaac37801fc9e0f69465952b..0000000000000000000000000000000000000000 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/price.phtml +++ /dev/null @@ -1,381 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> - -<?php -/** - * Template for displaying product price in different places (products grid, product view page etc) - * - * @var $this \Magento\Catalog\Block\Adminhtml\Product\Price - */ -?> -<?php - /** @var $_coreHelper \Magento\Core\Helper\Data */ - $_coreHelper = $this->helper('Magento\Core\Helper\Data'); - /** @var $weeeHelper \Magento\Weee\Helper\Data */ - $weeeHelper = $this->helper('Magento\Weee\Helper\Data'); - /** @var $taxHelper \Magento\Tax\Helper\Data */ - $taxHelper = $this->helper('Magento\Tax\Helper\Data'); - - $_product = $this->getProduct(); - $_id = $_product->getId(); - $_storeId = $_product->getStoreId(); - $_website = $this->getWebsite($_storeId); - - $_weeeSeparator = ''; - $_simplePricesTax = ($taxHelper->displayPriceIncludingTax() || $taxHelper->displayBothPrices()); - $_minimalPriceValue = $_product->getMinimalPrice(); - $_minimalPrice = $taxHelper->getPrice($_product, $_minimalPriceValue, $_simplePricesTax); -?> - - -<?php -$_exclTax = $taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax = null); -$_inclTax = $taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax = true); -?> -<?php $_weeeTaxAmount = $weeeHelper->getAmount($_product, $_website); ?> -<?php if ($weeeHelper->typeOfDisplay(array(1,2,4))): ?> - <?php $_weeeTaxAmount = $weeeHelper->getAmount($_product, $_website); ?> - <?php $_weeeTaxAttributes = $weeeHelper->getProductWeeeAttributesForRenderer($_product, null, null, $_website); ?> -<?php endif; ?> - -<div class="price-box"> -<?php $_price = $taxHelper->getPrice($_product, $_product->getPrice()) ?> -<?php $_regularPrice = $taxHelper->getPrice($_product, $_product->getPrice(), $_simplePricesTax) ?> -<?php $_finalPrice = $taxHelper->getPrice($_product, $_product->getFinalPrice()) ?> -<?php $_finalPriceInclTax = $taxHelper->getPrice($_product, $_product->getFinalPrice(), true) ?> -<?php $_weeeDisplayType = $weeeHelper->getPriceDisplayType(); ?> -<?php if ($_finalPrice == $_price): ?> - <?php if ($taxHelper->displayBothPrices()): ?> - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(0)): // including ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_price+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?> - </span> - </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(1)): // incl. + weee ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_price+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - <span class="weee">( - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currencyByStore($_weeeTaxAttribute->getAmount(), $_storeId, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - )</span> - </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(4)): // incl. + weee ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_price+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - <span class="weee">( - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currencyByStore($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), $_storeId, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - )</span> - </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(2)): // excl. + weee + final ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_price, $_storeId, true, false) ?> - </span> - </span> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <span class="weee"> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currencyByStore($_weeeTaxAttribute->getAmount(), $_storeId, true, true); ?> - </span> - <?php endforeach; ?> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </span> - <?php else: ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_price, $_storeId, true, false) ?> - </span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax, $_storeId, true, false) ?> - </span> - </span> - <?php endif; ?> - <?php else: ?> - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(0)): // including ?> - <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_price+$_weeeTaxAmount, $_storeId, true, true) ?> - </span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(1)): // incl. + weee ?> - <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_price+$_weeeTaxAmount, $_storeId, true, true) ?> - </span> - <span class="weee">( - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currencyByStore($_weeeTaxAttribute->getAmount(), $_storeId, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - )</span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(4)): // incl. + weee ?> - <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_price+$_weeeTaxAmount, $_storeId, true, true) ?> - </span> - <span class="weee">( - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currencyByStore($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), $_storeId, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - )</span> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(2)): // excl. + weee + final ?> - <span class="regular-price"><?php echo $_coreHelper->currencyByStore($_price, $_storeId, true, true) ?></span><br /> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <span class="weee"> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currencyByStore($_weeeTaxAttribute->getAmount(), $_storeId, true, true); ?> - </span> - <?php endforeach; ?> - <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_price+$_weeeTaxAmount, $_storeId, true, true) ?> - </span> - <?php else: ?> - <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_price, $_storeId, true, true) ?> - </span> - <?php endif; ?> - <?php endif; ?> -<?php else: /* if ($_finalPrice == $_price): */ ?> - <?php $_originalWeeeTaxAmount = $weeeHelper->getOriginalAmount($_product); ?> - - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(0)): // including ?> - <p class="old-price"> - <span class="price-label"><?php echo __('Regular Price:') ?></span> - <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_regularPrice+$_originalWeeeTaxAmount, $_storeId, true, false) ?> - </span> - </p> - - <?php if ($taxHelper->displayBothPrices()): ?> - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </span> - </p> - <?php else: ?> - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </p> - <?php endif; ?> - - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(1)): // incl. + weee ?> - <p class="old-price"> - <span class="price-label"><?php echo __('Regular Price:') ?></span> - <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_regularPrice+$_originalWeeeTaxAmount, $_storeId, true, false) ?> - </span> - </p> - - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </span> - <span class="weee">( - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currencyByStore($_weeeTaxAttribute->getAmount(), $_storeId, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - )</span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </span> - </p> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(4)): // incl. + weee ?> - <p class="old-price"> - <span class="price-label"><?php echo __('Regular Price:') ?></span> - <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_regularPrice+$_originalWeeeTaxAmount, $_storeId, true, false) ?> - </span> - </p> - - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </span> - <span class="weee">( - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currencyByStore($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), $_storeId, true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - )</span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </span> - </p> - <?php elseif ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(2)): // excl. + weee + final ?> - <p class="old-price"> - <span class="price-label"><?php echo __('Regular Price:') ?></span> - <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_regularPrice, $_storeId, true, false) ?> - </span> - </p> - - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPrice, $_storeId, true, false) ?> - </span> - </span> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <span class="weee"> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currencyByStore($_weeeTaxAttribute->getAmount(), $_storeId, true, true); ?> - </span> - <?php endforeach; ?> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> - </span> - </span> - </p> - <?php else: // excl. ?> - <p class="old-price"> - <span class="price-label"><?php echo __('Regular Price:') ?></span> - <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_regularPrice, $_storeId, true, false) ?> - </span> - </p> - - <?php if ($taxHelper->displayBothPrices()): ?> - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPrice, $_storeId, true, false) ?> - </span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax, $_storeId, true, false) ?> - </span> - </span> - </p> - <?php else: ?> - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_finalPrice, $_storeId, true, false) ?> - </span> - </p> - <?php endif; ?> - <?php endif; ?> - -<?php endif; /* if ($_finalPrice == $_price): */ ?> - -<?php if ($this->getDisplayMinimalPrice() && $_minimalPriceValue && $_minimalPriceValue < $_product->getFinalPrice()): ?> - - <?php $_minimalPriceDisplayValue = $_minimalPrice; ?> - <?php if ($_weeeTaxAmount && $weeeHelper->typeOfDisplay(array(0, 1, 4))): ?> - <?php $_minimalPriceDisplayValue = $_minimalPrice+$_weeeTaxAmount; ?> - <?php endif; ?> - - <?php if ($this->getUseLinkForAsLowAs()):?> - <a href="<?php echo $_product->getProductUrl(); ?>" class="minimal-price-link"> - <?php else:?> - <span class="minimal-price-link"> - <?php endif?> - <span class="label"><?php echo __('As low as:') ?></span> - <span class="price" id="product-minimal-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currencyByStore($_minimalPriceDisplayValue, $_storeId, true, false) ?> - </span> - <?php if ($this->getUseLinkForAsLowAs()):?> - </a> - <?php else:?> - </span> - <?php endif?> -<?php endif; /* if ($this->getDisplayMinimalPrice() && $_minimalPrice && $_minimalPrice < $_finalPrice): */ ?> -</div> diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product.js index 2ff7ac0fd82e34381874b0f88f411e7da0d98d26..0be24d61481395e8f2115340927553adf942f5f5 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product.js @@ -82,8 +82,6 @@ window.Product = {}; }); })(jQuery); -window.onInitDisableFieldsList = []; - function toogleFieldEditMode(toogleIdentifier, fieldContainer) { if ($(toogleIdentifier).checked) { enableFieldEditMode(fieldContainer); @@ -106,12 +104,9 @@ function enableFieldEditMode(fieldContainer) { } } -function initDisableFields(fieldContainer) { - onInitDisableFieldsList.push(fieldContainer); -} - function onCompleteDisableInited() { - onInitDisableFieldsList.each( function(item) { + jQuery.each(jQuery('[data-disable]'), function() { + var item = jQuery(this).data('disable'); disableFieldEditMode(item); }); } @@ -144,7 +139,6 @@ function onCustomUseParentChanged(element) { window.onCustomUseParentChanged = onCustomUseParentChanged; window.onUrlkeyChanged = onUrlkeyChanged; window.onCompleteDisableInited = onCompleteDisableInited; -window.initDisableFields = initDisableFields; window.enableFieldEditMode = enableFieldEditMode; window.disableFieldEditMode = disableFieldEditMode; window.toogleFieldEditMode = toogleFieldEditMode; diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/price_msrp.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/price_msrp.phtml deleted file mode 100644 index 6cc66fcc4c16c16a184c953ad8c286ba23889a6c..0000000000000000000000000000000000000000 --- a/app/code/Magento/Catalog/view/frontend/templates/product/price_msrp.phtml +++ /dev/null @@ -1,61 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> - -<?php -/** - * Template for displaying product price at catalog and sidebars - * - * @var $this \Magento\Catalog\Block\Product\Price - */ -?> -<?php - /** @var $_product \Magento\Catalog\Model\Product */ - $_product = $this->getProduct(); - $_msrpPrice = ""; - $priceElementIdPrefix = $this->getPriceElementIdPrefix() ? $this->getPriceElementIdPrefix() : 'product-price-'; - $priceElementId = $priceElementIdPrefix . $_product->getId() . $this->getIdSuffix(); -?> - <div class="price-box map info"> - <?php $_price = $this->helper('Magento\Tax\Helper\Data')->getPrice($_product, $_product->getMsrp()) ?> - <?php if ($_product->getMsrp()): ?> - <?php $_msrpPrice = $this->helper('Magento\Core\Helper\Data')->currency($_product->getMsrp(),true,false) ?> - <span class="old price" id="product-price-<?php echo $_product->getId() ?><?php echo $this->getIdSuffix() ?>"><?php echo $_msrpPrice ?></span> - <?php endif; ?> - <?php $popupId = 'msrp-click-' . $_product->getId() . $this->getRandomString(20); ?> - <?php if ($this->helper('Magento\Catalog\Helper\Data')->isShowPriceOnGesture($_product)): ?> - <a href="#" - id="<?php echo($popupId); ?>" - data-mage-init='{"addToCart":{"popupId": "#<?php echo($popupId); ?>", - "productName": "<?php echo $_product->getName() ?>", - "realPrice": <?php echo $this->getRealPriceJs($_product) ?>, - "msrpPrice": "<?php echo $_msrpPrice ?>", - "priceElementId":"<?php echo $priceElementId ?>", - "popupCartButtonId": "#map-popup-button", - "addToCartUrl": "<?php echo $this->getAddToCartUrl($_product) ?>"}}'><?php echo __('Click for price') ?> - </a> - <?php else: ?> - <a href="#" id="<?php echo($popupId);?>" data-mage-init='{"addToCart":{"popupId": "#<?php echo($popupId);?>", "submitUrl": "<?php echo $_product->getProductUrl() ?>"}}'><?php echo __('Click for price') ?></a> - <?php endif; ?> - </div> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/price_msrp_item.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/price_msrp_item.phtml deleted file mode 100644 index 7772285a4e95d68b9bc2d6f0577209ae30dfdaa5..0000000000000000000000000000000000000000 --- a/app/code/Magento/Catalog/view/frontend/templates/product/price_msrp_item.phtml +++ /dev/null @@ -1,75 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -?> - -<?php -/** - * Template for displaying product price at product view page, gift registry and wishlist - * - * @var $this \Magento\Catalog\Block\Product\Price - */ -?> -<?php -/** @var $_coreHelper \Magento\Core\Helper\Data */ -$_coreHelper = $this->helper('Magento\Core\Helper\Data'); -/** @var $_catalogHelper \Magento\Catalog\Helper\Data */ -$_catalogHelper = $this->helper('Magento\Catalog\Helper\Data'); - -/** @var $_product \Magento\Catalog\Model\Product */ -$_product = $this->getProduct(); -$_id = $_product->getId(); -$_msrpPrice = ''; -$priceElementIdPrefix = $this->getPriceElementIdPrefix() ? $this->getPriceElementIdPrefix() : 'product-price-'; -?> -<div class="price-box map info"> - <?php $_price = $this->helper('Magento\Tax\Helper\Data')->getPrice($_product, $_product->getMsrp()) ?> - <?php if ($_product->getMsrp()): ?> - <?php $_msrpPrice = $_coreHelper->currency($_product->getMsrp(), true, true) ?> - <span class="old-price"><?php echo $_msrpPrice ?></span> - <?php endif; ?> - - <?php if ($_catalogHelper->isShowPriceOnGesture($_product)): ?> - <?php $priceElementId = $priceElementIdPrefix . $_id . $this->getIdSuffix(); ?> - <span id="<?php echo $priceElementId ?>" style="display:none"></span> - <?php $popupId = 'msrp-popup-' . $_id . $this->getRandomString(20); ?> - <a href="#" - id="<?php echo($popupId);?>" - data-mage-init='{"addToCart":{"popupId": "#<?php echo($popupId);?>", - "productName": "<?php echo $_product->getName() ?>", - "realPrice": <?php echo $this->getRealPriceJs($_product) ?>, - "msrpPrice": "<?php echo $_msrpPrice ?>", - "priceElementId":"<?php echo $priceElementId ?>", - "popupCartButtonId": "#map-popup-button", - "cartForm": "#product_addtocart_form"}}'><?php echo __('Click for price') ?> - </a> - <?php else: ?> - <span class="msrp message"> - <?php echo $_catalogHelper->getMsrpPriceMessage($_product) ?> - </span> - <?php endif; ?> - - <?php $helpLinkId = 'msrp-help-' . $_id . $this->getRandomString(20); ?> - <a href="#" id="<?php echo($helpLinkId);?>" data-mage-init='{"addToCart":{"helpLinkId": "#<?php echo($helpLinkId);?>", "productName": "<?php echo $_product->getName() ?>"}}' class="action show map"><span><?php echo __("What's this?"); ?></span></a> -</div> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/price_msrp_noform.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/price_msrp_noform.phtml deleted file mode 100644 index b72e92b2ac7e7fcd7f8fe46438ed5e914a37b653..0000000000000000000000000000000000000000 --- a/app/code/Magento/Catalog/view/frontend/templates/product/price_msrp_noform.phtml +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> - -<?php -/** - * Template for displaying product price at catalog and sidebars - * - * @var $this \Magento\Catalog\Block\Product\Price - */ -?> -<?php - /** @var $_product \Magento\Catalog\Model\Product */ - $_product = $this->getProduct(); - $_msrpPrice = ""; - $priceElementId = 'product-price-' . $_product->getId() . $this->getIdSuffix(); -?> - <div class="price-box map-info"> - <?php $_price = $this->helper('Magento\Tax\Helper\Data')->getPrice($_product, $_product->getMsrp()) ?> - <?php if ($_product->getMsrp()): ?> - <?php $_msrpPrice = $this->helper('Magento\Core\Helper\Data')->currency($_product->getMsrp(),true,false) ?> - <span class="old-price" id="product-price-<?php echo $_product->getId() ?><?php echo $this->getIdSuffix() ?>"><?php echo $_msrpPrice ?></span> - <?php endif; ?> - <?php $popupId = 'msrp-click-' . $_product->getId() . $this->getRandomString(20); ?> - <?php if ($this->helper('Magento\Catalog\Helper\Data')->isShowPriceOnGesture($_product)): ?> - <a href="#" - id="<?php echo($popupId); ?>" - data-mage-init='{"addToCart":{"popupId": "#<?php echo($popupId); ?>", - "productName": "<?php echo $_product->getName() ?>", - "realPrice": <?php echo $this->getRealPriceJs($_product) ?>, - "msrpPrice": "<?php echo $_msrpPrice ?>", - "priceElementId":"<?php echo $priceElementId ?>", - "popupCartButtonId": "#map-popup-button", - "addToCartUrl": "<?php echo $this->getAddToCartUrl($_product) ?>"}}'><?php echo __('Click for price') ?> - </a> - <?php else: ?> - <a href="#" id="<?php echo($popupId);?>" data-mage-init='{"addToCart":{"popupId": "#<?php echo($popupId);?>", "submitUrl": "<?php echo $_product->getProductUrl() ?>"}}'><?php echo __('Click for price') ?></a> - <?php endif; ?> - </div> diff --git a/app/code/Magento/Catalog/view/frontend/templates/rss/product/price.phtml b/app/code/Magento/Catalog/view/frontend/templates/rss/product/price.phtml deleted file mode 100644 index 55f0ea599f6d6f11b00af2fa22d21c9e6137e7ff..0000000000000000000000000000000000000000 --- a/app/code/Magento/Catalog/view/frontend/templates/rss/product/price.phtml +++ /dev/null @@ -1,320 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> - -<?php -/** - * Template for displaying product price in RSS feeds - * - * @var $this \Magento\Catalog\Block\Product\Price - */ -?> -<?php $_product = $this->getProduct() ?> -<?php /* @var $taxHelper \Magento\Tax\Helper\Data */ ?> -<?php $_id = $_product->getId() ?> -<?php $taxHelper = $this->helper('Magento\Tax\Helper\Data'); ?> -<?php if ($_product->getCanShowPrice() !== false):?> - - <?php $_weeeSeparator = ''; ?> - <?php $simplePricesTax = ($taxHelper->displayPriceIncludingTax() || $taxHelper->displayBothPrices()); ?> - <?php $_minimalPriceValue = $_product->getMinimalPrice() ?> - <?php $_minimalPrice = $taxHelper->getPrice($_product, $_minimalPriceValue, $simplePricesTax) ?> - - <?php $_weeeTaxAmount = $this->helper('Magento\Weee\Helper\Data')->getAmountForDisplay($_product); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1,2,4))): ?> - <?php $_weeeTaxAmount = $this->helper('Magento\Weee\Helper\Data')->getAmount($_product); ?> - <?php $_weeeTaxAttributes = $this->helper('Magento\Weee\Helper\Data')->getProductWeeeAttributesForDisplay($_product); ?> - <?php endif; ?> - - <div class="price-box"> - <?php $_price = $taxHelper->getPrice($_product, $_product->getPrice()) ?> - <?php $_regularPrice = $taxHelper->getPrice($_product, $_product->getPrice(), $simplePricesTax) ?> - <?php $_finalPrice = $taxHelper->getPrice($_product, $_product->getFinalPrice()) ?> - <?php $_finalPriceInclTax = $taxHelper->getPrice($_product, $_product->getFinalPrice(), true) ?> - <?php $_weeeDisplayType = $this->helper('Magento\Weee\Helper\Data')->getPriceDisplayType(); ?> - <?php if ($_finalPrice == $_price): ?> - <?php if ($taxHelper->displayBothPrices()): ?> - <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0)): // including ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,false) ?></span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?></span> - </span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1)): // incl. + weee ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,false) ?></span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?></span> - <br /> - <span class="weee">(<small> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_weeeTaxAttribute->getAmount(), true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - </span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4)): // incl. + weee ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,false) ?></span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?></span> - <br /> - <span class="weee">(<small> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - </span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)): // excl. + weee + final ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price,true,false) ?></span> - </span> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <span class="weee"> - <small> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_weeeTaxAttribute->getAmount(), true, true); ?> - </small> - </span> - <br /> - <?php endforeach; ?> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?></span> - </span> - <?php else: ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price,true,false) ?></span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax,true,false) ?></span> - </span> - <?php endif; ?> - <?php else: ?> - <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0)): // including ?> - <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,true) ?></span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1)): // incl. + weee ?> - <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,true) ?></span> - <br /> - <span class="weee">(<small> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_weeeTaxAttribute->getAmount(), true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4)): // incl. + weee ?> - <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,true) ?></span> - <br /> - <span class="weee">(<small> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)): // excl. + weee + final ?> - <span class="regular-price"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price,true,true) ?></span><br /> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <span class="weee"> - <small> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_weeeTaxAttribute->getAmount(), true, true); ?> - </small> - </span> - <br /> - <?php endforeach; ?> - <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price+$_weeeTaxAmount,true,true) ?></span> - <?php else: ?> - <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_price,true,true) ?></span> - <?php endif; ?> - <?php endif; ?> - <?php else: /* if ($_finalPrice == $_price): */ ?> - <?php $_originalWeeeTaxAmount = $this->helper('Magento\Weee\Helper\Data')->getOriginalAmount($_product); ?> - - <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(0)): // including ?> - <p class="old-price"> - <span class="price-label"><?php echo __('Regular Price:') ?></span> - <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?></span> - </p> - - <?php if ($taxHelper->displayBothPrices()): ?> - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPrice+$_weeeTaxAmount,true,false) ?></span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?></span> - </span> - </p> - <?php else: ?> - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPrice+$_weeeTaxAmount,true,false) ?></span> - </p> - <?php endif; ?> - - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1)): // incl. + weee ?> - <p class="old-price"> - <span class="price-label"><?php echo __('Regular Price:') ?></span> - <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?></span> - </p> - - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPrice+$_weeeTaxAmount,true,false) ?></span> - </span> - <br /> - <span class="weee">(<small> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_weeeTaxAttribute->getAmount(), true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?></span> - </span> - </p> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4)): // incl. + weee ?> - <p class="old-price"> - <span class="price-label"><?php echo __('Regular Price:') ?></span> - <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_regularPrice+$_originalWeeeTaxAmount,true,false) ?></span> - </p> - - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPrice+$_weeeTaxAmount,true,false) ?></span> - </span> - <br /> - <span class="weee">(<small> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <?php echo $_weeeSeparator; ?> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), true, true); ?> - <?php $_weeeSeparator = ' + '; ?> - <?php endforeach; ?> - </small>)</span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?></span> - </span> - </p> - <?php elseif ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2)): // excl. + weee + final ?> - <p class="old-price"> - <span class="price-label"><?php echo __('Regular Price:') ?></span> - <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_regularPrice,true,false) ?></span> - </p> - - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPrice,true,false) ?></span> - </span> - <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?> - <span class="weee"> - <small> - <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $this->helper('Magento\Core\Helper\Data')->currency($_weeeTaxAttribute->getAmount(), true, true); ?> - </small> - </span> - <br /> - <?php endforeach; ?> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?></span> - </span> - </p> - <?php else: // excl. ?> - <p class="old-price"> - <span class="price-label"><?php echo __('Regular Price:') ?></span> - <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_regularPrice,true,false) ?></span> - </p> - - <?php if ($taxHelper->displayBothPrices()): ?> - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPrice,true,false) ?></span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPriceInclTax,true,false) ?></span> - </span> - </p> - <?php else: ?> - <p class="special-price"> - <span class="price-label"><?php echo __('Special Price:') ?></span> - <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_finalPrice,true,false) ?></span> - </p> - <?php endif; ?> - <?php endif; ?> - - <?php endif; /* if ($_finalPrice == $_price): */ ?> - - <?php if ($this->getDisplayMinimalPrice() && $_minimalPriceValue && $_minimalPriceValue < $_product->getFinalPrice()): ?> - - <?php $_minimalPriceDisplayValue = $_minimalPrice; ?> - <?php if ($_weeeTaxAmount && $this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4))): ?> - <?php $_minimalPriceDisplayValue = $_minimalPrice+$_weeeTaxAmount; ?> - <?php endif; ?> - - <?php if ($this->getUseLinkForAsLowAs()):?> - <a href="<?php echo $_product->getProductUrl(); ?>" class="minimal-price-link"> - <?php else:?> - <span class="minimal-price-link"> - <?php endif?> - <span class="label"><?php echo __('As low as:') ?></span> - <span class="price" id="product-minimal-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_minimalPriceDisplayValue,true,false) ?></span> - <?php if ($this->getUseLinkForAsLowAs()):?> - </a> - <?php else:?> - </span> - <?php endif?> - <?php endif; /* if ($this->getDisplayMinimalPrice() && $_minimalPrice && $_minimalPrice < $_finalPrice): */ ?> - </div> -<?php else: ?> - <?php //echo __('Price is not available');?> -<?php endif; /* if (!$_product->getCanShowPrice()): */?> diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json index 0425996d87d44f8895a1e89cc35fd172d52b37ad..06bd15c68c2aad3cae640ef78d8388c25dfb63d6 100644 --- a/app/code/Magento/CatalogImportExport/composer.json +++ b/app/code/Magento/CatalogImportExport/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-core": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-import-export": "0.1.0-alpha90", - "magento/module-indexer": "0.1.0-alpha90", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-core": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-import-export": "0.1.0-alpha91", + "magento/module-indexer": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "ext-ctype": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/CatalogInventory/composer.json b/app/code/Magento/CatalogInventory/composer.json index f9750651c87b15f7d035d63cceb2e36a27957dee..5721d7045b058bd9d3bf1ea41327983b29e74b8a 100644 --- a/app/code/Magento/CatalogInventory/composer.json +++ b/app/code/Magento/CatalogInventory/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-indexer": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-indexer": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/CatalogRule/composer.json b/app/code/Magento/CatalogRule/composer.json index 6a1e618d3206649ce2cb8e2fd339b44550c81925..28608b1c1fe96547d4e79b69248e46d5b293c704 100644 --- a/app/code/Magento/CatalogRule/composer.json +++ b/app/code/Magento/CatalogRule/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-rule": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-index": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-rule": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-index": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml b/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml index ea5cea28b4db3c910c7a4229c16dbfeeee7ae782..cb7ee134697dde0fdffa684f7a623b520456ee59 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml +++ b/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml @@ -36,7 +36,7 @@ </fieldset> </div> <script type="text/javascript"> -require(["prototype","Magento_Rule/rules"], function(jQuery){ +require(["jquery", "prototype","Magento_Rule/rules"], function(jQuery){ var <?php echo $_element->getHtmlId() ?> = new VarienRulesForm('<?php echo $_element->getHtmlId() ?>', '<?php echo $this->getNewChildUrl() ?>'); <?php if ($_element->getReadonly()): ?> diff --git a/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/js.phtml b/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/js.phtml index 6a7bf107341bacf374068d28a57eb2480e125435..121c084183759f5b82ea168238a40f8138784ea5 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/js.phtml +++ b/app/code/Magento/CatalogRule/view/adminhtml/templates/promo/js.phtml @@ -23,7 +23,7 @@ */ ?> <script type="text/javascript"> -require(["prototype"], function(){ +require(["jquery", "prototype"], function(jQuery){ function hideShowSubproductOptions() { @@ -39,8 +39,7 @@ function hideShowSubproductOptions() return true; } - -document.observe("dom:loaded", hideShowSubproductOptions); +jQuery(document).ready(hideShowSubproductOptions); window.hideShowSubproductOptions = hideShowSubproductOptions; }); </script> diff --git a/app/code/Magento/CatalogSearch/composer.json b/app/code/Magento/CatalogSearch/composer.json index 8942d05ba4e43ec81db959a4786aa313d9ab5eb8..e0fdcebdc80a75eeabae2f984e3e8a8cc9694926 100644 --- a/app/code/Magento/CatalogSearch/composer.json +++ b/app/code/Magento/CatalogSearch/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-index": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-index": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json index 7c65d2df592e38ab326965adfd0c0a1d3bf682d6..69054e6d6ebbd94cf3e137fdb027524107306cef 100644 --- a/app/code/Magento/CatalogUrlRewrite/composer.json +++ b/app/code/Magento/CatalogUrlRewrite/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-store": "0.1.0-alpha90", - "magento/module-url-redirect": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90" + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha91", + "magento/module-url-redirect": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Centinel/composer.json b/app/code/Magento/Centinel/composer.json index d3387325b8f74a06d03e214d97402f48e3a239e7..9de60f403a4afaab5f6ade9de9424f29fd8e2a5b 100644 --- a/app/code/Magento/Centinel/composer.json +++ b/app/code/Magento/Centinel/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php index 9d731deb3b14da2e58f72b5da854aab74dd3505b..1676d1510021e3d9c482c3a0a9afaeac4039f7fa 100644 --- a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php +++ b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php @@ -519,4 +519,102 @@ class Renderer extends \Magento\Framework\View\Element\Template implements \Mage return $store->convertPrice($amount, $format); } + + /** + * Return the unit price html + * + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @return string + */ + public function getUnitPriceHtml(\Magento\Sales\Model\Quote\Item\AbstractItem $item) + { + /** @var Renderer $block */ + $block = $this->getLayout()->getBlock('checkout.item.price.unit'); + $block->setItem($item); + return $block->toHtml(); + } + + /** + * Return row total html + * + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @return string + */ + public function getRowTotalHtml(\Magento\Sales\Model\Quote\Item\AbstractItem $item) + { + /** @var Renderer $block */ + $block = $this->getLayout()->getBlock('checkout.item.price.row'); + $block->setItem($item); + return $block->toHtml(); + } + + /** + * Return item price html for sidebar + * + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @return string + */ + public function getSidebarItemPriceHtml(\Magento\Sales\Model\Quote\Item\AbstractItem $item) + { + /** @var Renderer $block */ + $block = $this->getLayout()->getBlock('checkout.cart.item.price.sidebar'); + $block->setItem($item); + return $block->toHtml(); + } + + /** + * Get unit price excluding tax html + * + * @param Item\AbstractItem $item + * @return string + */ + public function getUnitPriceExclTaxHtml(\Magento\Sales\Model\Quote\Item\AbstractItem $item) + { + /** @var Renderer $block */ + $block = $this->getLayout()->getBlock('checkout.onepage.review.item.price.unit.excl'); + $block->setItem($item); + return $block->toHtml(); + } + + /** + * Get unit price including tax html + * + * @param Item\AbstractItem $item + * @return string + */ + public function getUnitPriceInclTaxHtml(\Magento\Sales\Model\Quote\Item\AbstractItem $item) + { + /** @var Renderer $block */ + $block = $this->getLayout()->getBlock('checkout.onepage.review.item.price.unit.incl'); + $block->setItem($item); + return $block->toHtml(); + } + + /** + * Get row total excluding tax html + * + * @param Item\AbstractItem $item + * @return string + */ + public function getRowtotalExclTaxHtml(\Magento\Sales\Model\Quote\Item\AbstractItem $item) + { + /** @var Renderer $block */ + $block = $this->getLayout()->getBlock('checkout.onepage.review.item.price.rowtotal.excl'); + $block->setItem($item); + return $block->toHtml(); + } + + /** + * Get row total including tax html + * + * @param Item\AbstractItem $item + * @return string + */ + public function getRowtotalInclTaxHtml(\Magento\Sales\Model\Quote\Item\AbstractItem $item) + { + /** @var Renderer $block */ + $block = $this->getLayout()->getBlock('checkout.onepage.review.item.price.rowtotal.incl'); + $block->setItem($item); + return $block->toHtml(); + } } diff --git a/app/code/Magento/Checkout/Block/Cart/Shipping.php b/app/code/Magento/Checkout/Block/Cart/Shipping.php index 3aeb01eaac9b841ad26f3518b81f80eb38fdd6a5..0a09072292aeac4209e6108d9ea7c73e004927f7 100644 --- a/app/code/Magento/Checkout/Block/Cart/Shipping.php +++ b/app/code/Magento/Checkout/Block/Cart/Shipping.php @@ -49,11 +49,6 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart */ protected $_directoryBlock; - /** - * @var \Magento\Tax\Helper\Data - */ - protected $_taxHelper; - /** * @var \Magento\Sales\Model\Quote\Address\CarrierFactoryInterface */ @@ -65,7 +60,6 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Directory\Block\Data $directoryBlock - * @param \Magento\Tax\Helper\Data $taxHelper * @param \Magento\Sales\Model\Quote\Address\CarrierFactoryInterface $carrierFactory * @param array $data */ @@ -75,12 +69,10 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Directory\Block\Data $directoryBlock, - \Magento\Tax\Helper\Data $taxHelper, \Magento\Sales\Model\Quote\Address\CarrierFactoryInterface $carrierFactory, array $data = array() ) { $this->_directoryBlock = $directoryBlock; - $this->_taxHelper = $taxHelper; $this->_carrierFactory = $carrierFactory; parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $data); $this->_isScopePrivate = true; @@ -241,25 +233,6 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart return $this->getQuote()->getStore()->convertPrice($price, true); } - /** - * Get Shipping Price - * - * @param float $price - * @param bool $flag - * @return float - */ - public function getShippingPrice($price, $flag) - { - return $this->formatPrice( - $this->_taxHelper->getShippingPrice( - $price, - $flag, - $this->getAddress(), - $this->getQuote()->getCustomerTaxClassId() - ) - ); - } - /** * Obtain available carriers instances * @@ -325,4 +298,18 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart } return false; } + + /** + * Get shipping price html + * + * @param \Magento\Sales\Model\Quote\Address\Rate $shippingRate + * @return string + */ + public function getShippingPriceHtml(\Magento\Sales\Model\Quote\Address\Rate $shippingRate) + { + /** @var \Magento\Checkout\Block\Shipping\Price $block */ + $block = $this->getLayout()->getBlock('checkout.shipping.price'); + $block->setShippingRate($shippingRate); + return $block->toHtml(); + } } diff --git a/app/code/Magento/Checkout/Block/Cart/Sidebar.php b/app/code/Magento/Checkout/Block/Cart/Sidebar.php index 1daf4dd68cf39ec6b806fae8d2b2a84ab0749ed7..d54530e2f6741f8a5ed25dc3e8fc72987ad781e4 100644 --- a/app/code/Magento/Checkout/Block/Cart/Sidebar.php +++ b/app/code/Magento/Checkout/Block/Cart/Sidebar.php @@ -36,23 +36,11 @@ class Sidebar extends AbstractCart implements IdentityInterface */ const XML_PATH_CHECKOUT_SIDEBAR_COUNT = 'checkout/sidebar/count'; - /** - * Tax data - * - * @var \Magento\Tax\Helper\Data - */ - protected $_taxData; - /** * @var \Magento\Catalog\Model\Resource\Url */ protected $_catalogUrl; - /** - * @var \Magento\Tax\Model\Config - */ - protected $_taxConfig; - /** * @var \Magento\Checkout\Model\Cart */ @@ -68,9 +56,7 @@ class Sidebar extends AbstractCart implements IdentityInterface * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Model\Resource\Url $catalogUrl - * @param \Magento\Tax\Model\Config $taxConfig * @param \Magento\Checkout\Model\Cart $checkoutCart * @param \Magento\Checkout\Helper\Data $checkoutHelper * @param array $data @@ -82,17 +68,13 @@ class Sidebar extends AbstractCart implements IdentityInterface \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, - \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Model\Resource\Url $catalogUrl, - \Magento\Tax\Model\Config $taxConfig, \Magento\Checkout\Model\Cart $checkoutCart, \Magento\Checkout\Helper\Data $checkoutHelper, array $data = array() ) { $this->_checkoutHelper = $checkoutHelper; - $this->_taxData = $taxData; $this->_catalogUrl = $catalogUrl; - $this->_taxConfig = $taxConfig; $this->_checkoutCart = $checkoutCart; parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $data); $this->_isScopePrivate = true; @@ -159,79 +141,18 @@ class Sidebar extends AbstractCart implements IdentityInterface /** * Get shopping cart subtotal. * - * It will include tax, if required by config settings. - * - * @param bool $skipTax flag for getting price with tax or not. Ignored in case when we display just subtotal incl.tax - * @return float + * @return float */ - public function getSubtotal($skipTax = true) + public function getSubtotal() { $subtotal = 0; $totals = $this->getTotals(); if (isset($totals['subtotal'])) { - if ($this->_taxConfig->displayCartSubtotalBoth()) { - if ($skipTax) { - $subtotal = $totals['subtotal']->getValueExclTax(); - } else { - $subtotal = $totals['subtotal']->getValueInclTax(); - } - } elseif ($this->_taxConfig->displayCartSubtotalInclTax()) { - $subtotal = $totals['subtotal']->getValueInclTax(); - } else { - $subtotal = $totals['subtotal']->getValue(); - if (!$skipTax && isset($totals['tax'])) { - $subtotal += $totals['tax']->getValue(); - } - } + $subtotal = $totals['subtotal']->getValue(); } return $subtotal; } - /** - * Get subtotal, including tax. - * Will return > 0 only if appropriate config settings are enabled. - * - * @return float - */ - public function getSubtotalInclTax() - { - if (!$this->_taxConfig->displayCartSubtotalBoth()) { - return 0; - } - return $this->getSubtotal(false); - } - - /** - * Add tax to amount - * - * @param float $price - * @param bool $exclShippingTax - * @return float - */ - private function _addTax($price, $exclShippingTax = true) - { - $totals = $this->getTotals(); - if (isset($totals['tax'])) { - if ($exclShippingTax) { - $price += $totals['tax']->getValue() - $this->_getShippingTaxAmount(); - } else { - $price += $totals['tax']->getValue(); - } - } - return $price; - } - - /** - * Get shipping tax amount - * - * @return float - */ - protected function _getShippingTaxAmount() - { - $quote = $this->getCustomQuote() ? $this->getCustomQuote() : $this->getQuote(); - return $quote->getShippingAddress()->getShippingTaxAmount(); - } - /** * Get shopping cart items qty based on configuration (summary qty or items qty) * @@ -245,18 +166,6 @@ class Sidebar extends AbstractCart implements IdentityInterface return $this->_checkoutCart->getSummaryQty(); } - /** - * Get incl/excl tax label - * - * @param bool $flag - * @return string - */ - public function getIncExcTax($flag) - { - $text = $this->_taxData->getIncExcText($flag); - return $text ? ' (' . $text . ')' : ''; - } - /** * Check if one page checkout is available * @@ -390,4 +299,9 @@ class Sidebar extends AbstractCart implements IdentityInterface } return $identities; } + + public function getTotalsHtml() + { + return $this->getLayout()->getBlock('checkout.cart.minicart.totals')->toHtml(); + } } diff --git a/app/code/Magento/Checkout/Block/Cart/Sidebar/Totals.php b/app/code/Magento/Checkout/Block/Cart/Sidebar/Totals.php new file mode 100644 index 0000000000000000000000000000000000000000..ab13796b39a525f038a964de3d57bad71f6a731e --- /dev/null +++ b/app/code/Magento/Checkout/Block/Cart/Sidebar/Totals.php @@ -0,0 +1,48 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Block\Cart\Sidebar; + +use Magento\Checkout\Block\Cart\AbstractCart; +use Magento\Framework\View\Block\IdentityInterface; + +/** + * Sidebar totals block + */ +class Totals extends AbstractCart +{ + /** + * Get shopping cart subtotal. + * + * @return float + */ + public function getSubtotal() + { + $subtotal = 0; + $totals = $this->getTotals(); + if (isset($totals['subtotal'])) { + $subtotal = $totals['subtotal']->getValue(); + } + return $subtotal; + } +} diff --git a/app/code/Magento/Checkout/Block/Item/Price/Renderer.php b/app/code/Magento/Checkout/Block/Item/Price/Renderer.php new file mode 100644 index 0000000000000000000000000000000000000000..eb3f7c0eb6f40586106e604a1bb0186ab58d0576 --- /dev/null +++ b/app/code/Magento/Checkout/Block/Item/Price/Renderer.php @@ -0,0 +1,61 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Block\Item\Price; + +use Magento\Sales\Model\Quote\Item\AbstractItem; + +/** + * Item price render block + * + * @author Magento Core Team <core@magentocommerce.com> + */ +class Renderer extends \Magento\Framework\View\Element\Template +{ + /** + * @var AbstractItem + */ + protected $item; + + /** + * Set item for render + * + * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item + * @return $this + */ + public function setItem(\Magento\Sales\Model\Quote\Item\AbstractItem $item) + { + $this->item = $item; + return $this; + } + + /** + * Get quote item + * + * @return AbstractItem + */ + public function getItem() + { + return $this->item; + } +} diff --git a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php index 29a280b2cc23a7a2109a5f511dc96ea48f104ad3..f2dd37e7f8e8c446a86a50b1cb9e2edadadb727a 100644 --- a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php +++ b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php @@ -388,4 +388,18 @@ abstract class AbstractOnepage extends \Magento\Framework\View\Element\Template { return true; } + + /** + * Return the html text for shipping price + * + * @param \Magento\Sales\Model\Quote\Address\Rate $rate + * @return string + */ + public function getShippingPriceHtml(\Magento\Sales\Model\Quote\Address\Rate $rate) + { + /** @var \Magento\Checkout\Block\Shipping\Price $block */ + $block = $this->getLayout()->getBlock('checkout.shipping.price'); + $block->setShippingRate($rate); + return $block->toHtml(); + } } diff --git a/app/code/Magento/Checkout/Block/Onepage/Progress.php b/app/code/Magento/Checkout/Block/Onepage/Progress.php index 203705e6386f92e3b157cc09e4a36c7ceecaa828..a82c21b96c1418976e41e5c9b2c86878f286999b 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Progress.php +++ b/app/code/Magento/Checkout/Block/Onepage/Progress.php @@ -35,59 +35,6 @@ use Magento\Sales\Model\Quote\Address; */ class Progress extends \Magento\Checkout\Block\Onepage\AbstractOnepage { - /** - * @var \Magento\Tax\Helper\Data - */ - protected $_taxData; - - /** - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Framework\App\Cache\Type\Config $configCacheType - * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Checkout\Model\Session $resourceSession - * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory - * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory - * @param CustomerAccountService $customerAccountService - * @param CustomerAddressService $customerAddressService - * @param AddressConfig $addressConfig - * @param \Magento\Framework\App\Http\Context $httpContext - * @param \Magento\Tax\Helper\Data $taxData - * @param array $data - */ - public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Framework\App\Cache\Type\Config $configCacheType, - \Magento\Customer\Model\Session $customerSession, - \Magento\Checkout\Model\Session $resourceSession, - \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, - \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory, - CustomerAccountService $customerAccountService, - CustomerAddressService $customerAddressService, - AddressConfig $addressConfig, - \Magento\Framework\App\Http\Context $httpContext, - \Magento\Tax\Helper\Data $taxData, - array $data = array() - ) { - parent::__construct( - $context, - $coreData, - $configCacheType, - $customerSession, - $resourceSession, - $countryCollectionFactory, - $regionCollectionFactory, - $customerAccountService, - $customerAddressService, - $addressConfig, - $httpContext, - $data - ); - $this->_taxData = $taxData; - } - - /** * @return Address */ @@ -162,42 +109,15 @@ class Progress extends \Magento\Checkout\Block\Onepage\AbstractOnepage } /** - * Get selected shipping method price + * Return selected shipping rate * - * @param bool $inclTax - * @return string + * @return false|Address\Rate */ - protected function _getShippingPrice($inclTax) + public function getShippingRate() { $address = $this->getQuote()->getShippingAddress(); $rate = $address->getShippingRateByCode($address->getShippingMethod()); - return $this->formatPrice($this->_taxData->getShippingPrice($rate->getPrice(), $inclTax, $address)); - } - /** - * Get quote shipping price including tax - * - * @return float - */ - public function getShippingPriceInclTax() - { - return $this->_getShippingPrice(true); - } - - /** - * @return string - */ - public function getShippingPriceExclTax() - { - return $this->_getShippingPrice(false); - } - - /** - * @param float $price - * @return string - */ - public function formatPrice($price) - { - return $this->getQuote()->getStore()->formatPrice($price); + return $rate; } } diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php index 2963cac3a75338e85931834a14aa86c119c2711b..25ab9639223cdc98f41a86a58cba5ea4b0e4f820 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php @@ -43,13 +43,6 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage */ protected $_address; - /** - * Tax data - * - * @var \Magento\Tax\Helper\Data - */ - protected $_taxData = null; - /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData @@ -62,7 +55,6 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param CustomerAddressService $customerAddressService * @param AddressConfig $addressConfig * @param \Magento\Framework\App\Http\Context $httpContext - * @param \Magento\Tax\Helper\Data $taxData * @param array $data */ public function __construct( @@ -77,10 +69,8 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage CustomerAddressService $customerAddressService, AddressConfig $addressConfig, \Magento\Framework\App\Http\Context $httpContext, - \Magento\Tax\Helper\Data $taxData, array $data = array() ) { - $this->_taxData = $taxData; parent::__construct( $context, $coreData, @@ -145,17 +135,4 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage { return $this->getAddress()->getShippingMethod(); } - - /** - * @param float $price - * @param bool|null $flag - * @return float - */ - public function getShippingPrice($price, $flag) - { - return $this->getQuote()->getStore()->convertPrice( - $this->_taxData->getShippingPrice($price, $flag, $this->getAddress()), - true - ); - } } diff --git a/app/code/Magento/Checkout/Block/Shipping/Price.php b/app/code/Magento/Checkout/Block/Shipping/Price.php new file mode 100644 index 0000000000000000000000000000000000000000..1e88af05e61980546a8f02b89e5f1fa0a6af6b92 --- /dev/null +++ b/app/code/Magento/Checkout/Block/Shipping/Price.php @@ -0,0 +1,68 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Block\Shipping; + +use Magento\Sales\Model\Quote\Address\Rate; +use Magento\Checkout\Block\Cart\AbstractCart; + +class Price extends AbstractCart +{ + /** + * @var Rate + */ + protected $shippingRate; + + /** + * Set the shipping rate + * + * @param Rate $shippingRate + * @return $this + */ + public function setShippingRate(Rate $shippingRate) + { + $this->shippingRate = $shippingRate; + return $this; + } + + /** + * Return shipping rate + * + * @return Rate + */ + public function getShippingRate() + { + return $this->shippingRate; + } + + /** + * Get Shipping Price + * + * @return float + */ + public function getShippingPrice() + { + $price = $this->shippingRate->getPrice(); + return $this->getQuote()->getStore()->convertPrice($price, true); + } +} diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index 8517a00dd58315426a81f2d23b2b2485cab9b9cf..2e559e01a6b1fa2b46c960597420c463cd7f3d8b 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -3,26 +3,25 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-payment": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-gift-message": "0.1.0-alpha90", - "magento/module-wishlist": "0.1.0-alpha90", - "magento/module-weee": "0.1.0-alpha90", - "magento/module-page-cache": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-payment": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-gift-message": "0.1.0-alpha91", + "magento/module-wishlist": "0.1.0-alpha91", + "magento/module-page-cache": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Checkout/etc/module.xml b/app/code/Magento/Checkout/etc/module.xml index a4558a93dc165d99c35e3cf648e9b2394d005756..38fae3889957b4e9dd34bbeaa4d16efe10f66917 100644 --- a/app/code/Magento/Checkout/etc/module.xml +++ b/app/code/Magento/Checkout/etc/module.xml @@ -42,7 +42,6 @@ <module name="Magento_Eav"/> <module name="Magento_GiftMessage"/> <module name="Magento_Wishlist"/> - <module name="Magento_Weee"/> <module name="Magento_PageCache"/> <module name="Magento_Theme"/> </depends> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml index e8ac9f9cae13c7ec8e21dbf2ae02cf30055e4949..149824798fb747e1490845264c63770841006a2d 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml @@ -26,6 +26,7 @@ <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> <update handle="page_one_column"/> <update handle="checkout_cart_item_renderers" /> + <update handle="checkout_shipping_price_renderer" /> <referenceContainer name="content"> <block class="Magento\Checkout\Block\Cart" name="checkout.cart" template="cart.phtml"> <container name="checkout.cart.items" label="invisible" as="with-items"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml index 084af9a57b2c140fcb7f5c160770d593d0ac0112..e028ee7a7d49ddb434748dd24ecbd577b910afd4 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_item_renderers.xml @@ -24,6 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="checkout_item_price_renderers" /> <referenceBlock name="checkout.cart.item.renderers"> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="default" template="cart/item/default.phtml"/> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="simple" template="cart/item/default.phtml"/> diff --git a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml similarity index 85% rename from app/code/Magento/Bundle/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml rename to app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml index 9179f6c7af5315e5235bc79efadc1e733e8fcdab..55c9683a0006daf6e247d44b58596d4e7b500693 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml @@ -24,7 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="catalog.product.rss.feed.renderer.list"> - <block class="Magento\Bundle\Block\Catalog\Product\Price" as="bundle" template="rss/catalog/product/price.phtml" /> + <referenceBlock name="minicart"> + <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.cart.item.price.sidebar" template="cart/item/price/sidebar.phtml"/> </referenceBlock> </layout> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml similarity index 79% rename from app/code/Magento/Catalog/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml rename to app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml index b636cf0843cbf332be4249a653725290de25803d..a060ae1915a705ffb9743f9d98442a71279e64a0 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml @@ -24,8 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="catalog.product.rss.feed.renderer.list"> - <block class="Magento\Catalog\Block\Product\Price" as="default" template="rss/product/price.phtml" /> - <block class="Magento\Catalog\Block\Product\Price" as="msrp_rss" template="product/price_msrp_rss.phtml" /> + <referenceBlock name="minicart"> + <block class="Magento\Checkout\Block\Cart\Sidebar" name="checkout.cart.minicart.totals" template="cart/minicart/totals.phtml"/> </referenceBlock> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_item_price_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_item_price_renderers.xml new file mode 100644 index 0000000000000000000000000000000000000000..f7d411546d920c79fe1b41eebc0758cea5192e6d --- /dev/null +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_item_price_renderers.xml @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.item.price.unit" template="item/price/unit.phtml"/> + <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.item.price.row" template="item/price/row.phtml"/> + <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.unit.excl" template="onepage/review/item/price/unit_excl_tax.phtml"/> + <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.unit.incl" template="onepage/review/item/price/unit_incl_tax.phtml"/> + <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.rowtotal.excl" template="onepage/review/item/price/row_excl_tax.phtml"/> + <block class="Magento\Checkout\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.rowtotal.incl" template="onepage/review/item/price/row_incl_tax.phtml"/> +</layout> + diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml index ac0c94c543ef5d2e7aaf39726b58685d3b39b828..8ba34b0a8518edeabf2ee6b19e3d13a25c0ef0ce 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml @@ -25,6 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> <update handle="page_one_column"/> + <update handle="checkout_shipping_price_renderer" /> <referenceContainer name="content"> <block class="Magento\Checkout\Block\Onepage" name="checkout.onepage" template="onepage.phtml"> <block class="Magento\Checkout\Block\Onepage\Login" name="checkout.onepage.login" as="login" template="onepage/login.phtml" cacheable="false"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_progress.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_progress.xml index 99957b42bd9b23471f79b759e843cfe457c751fc..6799c05055bb5b01dbfbc9157ed8c18213ca6b53 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_progress.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_progress.xml @@ -24,6 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="checkout_shipping_price_renderer" /> <block class="Magento\Checkout\Block\Onepage\Progress" name="progress" output="1" template="onepage/progress.phtml"> <block class="Magento\Checkout\Block\Onepage\Payment\Info" name="payment_info" cacheable="false"> <action method="setInfoTemplate"> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml index 2de7a5f9f38a24c0282afa1a9fb923a7fd82c1a9..cb328bbefff725cb1d2b75f36b67ee844579e919 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review_item_renderers.xml @@ -24,6 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="checkout_item_price_renderers" /> <referenceBlock name="checkout.onepage.review.item.renderers"> <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="default" template="onepage/review/item.phtml"/> </referenceBlock> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml index d2ef4d0e6ff1f44f9282d407c50f15d6140f55d2..36e31690129bc99926b7c859bfd278df46523e6c 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_shippingmethod.xml @@ -24,5 +24,6 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <update handle="checkout_shipping_price_renderer" /> <block class="Magento\Checkout\Block\Onepage\Shipping\Method\Available" name="shipping_method" output="1" template="onepage/shipping_method/available.phtml"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_shipping_price_renderer.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_shipping_price_renderer.xml new file mode 100644 index 0000000000000000000000000000000000000000..e7e061fa3c659f269e2c9500dcd1dff23a3328d5 --- /dev/null +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_shipping_price_renderer.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <block class="Magento\Checkout\Block\Shipping\Price" name="checkout.shipping.price" as="shipping.price" template="shipping/price.phtml"/> +</layout> + diff --git a/app/code/Magento/Checkout/view/frontend/layout/default.xml b/app/code/Magento/Checkout/view/frontend/layout/default.xml index 9c37284180336acb44e2e0189608e1e669185d87..a8748a6d115ce738150103aaef3cfc111a273f11 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/default.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/default.xml @@ -25,6 +25,8 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> <update handle="checkout_cart_sidebar_item_renderers" /> + <update handle="checkout_cart_sidebar_item_price_renderers" /> + <update handle="checkout_cart_sidebar_total_renderers" /> <referenceBlock name="head.components"> <block class="Magento\Framework\View\Element\Js\Components" name="checkout_page_head_components" template="Magento_Checkout::js/components.phtml"/> </referenceBlock> diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml index 63e830d57cec0f192fb16c771fa76c308ac3d435..c94ff5af7e44170d8a7242c52fb494674360a20b 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml @@ -32,42 +32,42 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <tr class="item info item-info"> <td class="col item"> <?php if ($this->hasProductUrl()):?><a href="<?php echo $this->getProductUrl() ?>" title="<?php echo $this->escapeHtml($this->getProductName()) ?>" class="product photo product-item-photo"> - <?php else:?> + <?php else:?> <span class="product photo product-item-photo"> <?php endif;?> <?php echo $this->getLayout()->createBlock('Magento\Catalog\Block\Product\Image')->init($this->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml(); ?> - <?php if ($this->hasProductUrl()):?></a><?php else: ?></span><?php endif; ?> + <?php if ($this->hasProductUrl()):?></a><?php else: ?></span><?php endif; ?> <div class="product details product-item-details"> <strong class="product name product-item-name"> - <?php if ($this->hasProductUrl()):?> - <a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->escapeHtml($this->getProductName()) ?></a> - <?php else: ?> - <?php echo $this->escapeHtml($this->getProductName()) ?> - <?php endif; ?> + <?php if ($this->hasProductUrl()):?> + <a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->escapeHtml($this->getProductName()) ?></a> + <?php else: ?> + <?php echo $this->escapeHtml($this->getProductName()) ?> + <?php endif; ?> </strong> <?php if ($_options = $this->getOptionList()):?> - <dl class="cart-item-options"> - <?php foreach ($_options as $_option) : ?> - <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> - <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> - <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip wrapper"<?php endif; ?>> - <?php echo $_formatedOptionValue['value'] ?> - <?php if (isset($_formatedOptionValue['full_view'])): ?> - <div class="tooltip content"> - <dl class="item options"> - <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> - <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> - </dl> - </div> - <?php endif; ?> - </dd> - <?php endforeach; ?> - </dl> + <dl class="cart-item-options"> + <?php foreach ($_options as $_option) : ?> + <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> + <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> + <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip wrapper"<?php endif; ?>> + <?php echo $_formatedOptionValue['value'] ?> + <?php if (isset($_formatedOptionValue['full_view'])): ?> + <div class="tooltip content"> + <dl class="item options"> + <dt><?php echo $this->escapeHtml($_option['label']) ?></dt> + <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> + </dl> + </div> + <?php endif; ?> + </dd> + <?php endforeach; ?> + </dl> <?php endif;?> <?php if ($messages = $this->getMessages()): ?> - <?php foreach ($messages as $message): ?> - <div class="cart item message <?php echo $message['type'] ?>"><div><?php echo $this->escapeHtml($message['text']) ?></div></div> - <?php endforeach; ?> + <?php foreach ($messages as $message): ?> + <div class="cart item message <?php echo $message['type'] ?>"><div><?php echo $this->escapeHtml($message['text']) ?></div></div> + <?php endforeach; ?> <?php endif; ?> <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?> <?php if ($addInfoBlock): ?> @@ -97,211 +97,42 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite </td> <?php else: ?> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - <td class="col price" data-th="<?php echo $this->escapeHtml(__('Price')); ?>"> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - <span class="incl tax" data-th="<?php echo $this->escapeHtml(__('Incl. Tax')); ?>"> - <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> - <?php endif; ?> - </span> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display: none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee" data-th="<?php echo $this->escapeHtml(__('Total incl. tax')); ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> - </span> - <?php endif; ?> - - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - <span class="excl tax" data-th="<?php echo $this->escapeHtml(__('Excl. Tax')); ?>"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice() + $_item->getWeeeTaxAppliedAmount() + $_item->getWeeeTaxDisposition()); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> - <?php endif; ?> - </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'], true, true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'], true, true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'], true, true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee" data-th="<?php echo $this->escapeHtml(__('Total')); ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice() + $_item->getWeeeTaxAppliedAmount() + $_item->getWeeeTaxDisposition()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> - </span> - <?php endif; ?> - <?php $cols++; ?> - </td> - <?php endif; ?> + <td class="col price" data-th="<?php echo $this->escapeHtml(__('Price')); ?>"> + <?php echo $this->getUnitPriceHtml($_item); ?> + <?php $cols++; ?> + </td> <?php endif; ?> <td class="col qty" data-th="<?php echo $this->escapeHtml(__('Qty')); ?>"> <div class="control qty"> - <input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" type="number" size="4" title="<?php echo __('Qty') ?>" class="input-text qty" maxlength="12" data-validate="{required:true,'validate-greater-than-zero':true}"/> + <input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" type="number" size="4" title="<?php echo __('Qty') ?>" class="input-text qty" maxlength="12" data-validate="{required:true,'validate-greater-than-zero':true}"/> </div> <?php $cols++; ?> </td> - <?php if (($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> <td class="col subtotal" data-th="<?php echo $this->escapeHtml(__('Subtotal'));?>"> - <?php if (($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - <span class="incl tax" data-th="<?php echo $this->escapeHtml(__('Incl. Tax'));?>"> - <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - <?php if ($canApplyMsrp): ?> - <span class="cart msrp subtotal">--</span> - <?php else: ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> - <?php endif; ?> - <?php endif; ?> - </span> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee" data-th="<?php echo __('Total incl. tax'); ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> - </span> - <?php endif; ?> - - <?php if (($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - <span class="excl tax" data-th="<?php echo $this->escapeHtml(__('Excl. Tax'));?>"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - <?php if ($canApplyMsrp): ?> - <span class="cart msrp subtotal">--</span> - <?php else: ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()) ?> - <?php endif; ?> - <?php endif; ?> - </span> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee" data-th="<?php echo __('Total'); ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> - </span> + <?php if ($canApplyMsrp): ?> + <span class="cart msrp subtotal">--</span> + <?php else: ?> + <?php echo $this->getRowTotalHtml($_item); ?> <?php endif; ?> <?php $cols++; ?> </td> - <?php endif; ?> + </tr> <tr class="item actions item-actions"> <td colspan="<?php echo $cols;?>"> <div class="actions"> <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllowInCart()) : ?> <?php if ($isVisibleProduct): ?> - <a href="#" data-post='<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getMoveFromCartParams($_item->getId()); ?>' class="use-ajax action towishlist"> - <span><?php echo __('Move to Wishlist'); ?></span> - </a> + <a href="#" data-post='<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getMoveFromCartParams($_item->getId()); ?>' class="use-ajax action towishlist"> + <span><?php echo __('Move to Wishlist'); ?></span> + </a> <?php endif ?> <?php endif ?> <?php if ($isVisibleProduct): ?> - <a class="action edit" href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo __('Edit item parameters') ?>"><span><?php echo __('Edit') ?></span></a> + <a class="action edit" href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo __('Edit item parameters') ?>"><span><?php echo __('Edit') ?></span></a> <?php endif ?> <button title="<?php echo __('Remove item') ?>" diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/item/price/sidebar.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/item/price/sidebar.phtml new file mode 100644 index 0000000000000000000000000000000000000000..cae1afcee5c721a709b9ed410de8a02c16b13511 --- /dev/null +++ b/app/code/Magento/Checkout/view/frontend/templates/cart/item/price/sidebar.phtml @@ -0,0 +1,33 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Checkout\Block\Item\Price\Renderer */ +?> +<?php $_item = $this->getItem() ?> +<div class="pricing details"> + <div class="rate"> + <span class="label display"><?php echo __('Price'); ?></span> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> + </div> +</div> diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/minicart.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/minicart.phtml index 8216a39c0f176a4ca9bc73246837d1efc65727d0..319c68dbc82c4b268cfc6d3a376845ec19adf310 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/cart/minicart.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/cart/minicart.phtml @@ -77,18 +77,10 @@ <span class="mark"> <?php echo __('Cart Subtotal') ?> </span> - <div class="amount"> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->getSubtotal()) ?> - <?php if ($_subtotalInclTax = $this->getSubtotalInclTax()): ?> - <span class="amount incl tax"> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_subtotalInclTax) ?> - <?php echo $this->helper('Magento\Tax\Helper\Data')->getIncExcText(true) ?> - </span> - <?php endif; ?> - </div> - <?php endif; ?> + <?php echo $this->getTotalsHtml() ?> + <?php endif ?> </div> - <?php endif ?> + <?php endif; ?> <?php echo $this->getChildHtml('minicart_info') ?> <div class="actions"> <div class="primary"> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/price_msrp_rss.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/minicart/totals.phtml similarity index 67% rename from app/code/Magento/Catalog/view/frontend/templates/product/price_msrp_rss.phtml rename to app/code/Magento/Checkout/view/frontend/templates/cart/minicart/totals.phtml index 933f9e9ee665eaaaf1a248b7815c6e1f79e55854..914a1795c2c9684d9026c9ec3cddab0e2161c9a6 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/price_msrp_rss.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/cart/minicart/totals.phtml @@ -21,20 +21,10 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -?> -<?php -/** - * Template for displaying product price at rss feeds pages - * - * @var $this \Magento\Catalog\Block\Product\Price - */ -/** @var $_product \Magento\Catalog\Model\Product */ -$_product = $this->getProduct(); +/** @var $this Magento\Checkout\Block\Cart\Sidebar\Totals */ ?> -<div class="price-box map-info"> - <?php if ($this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_product)): ?> - <a href="<?php echo $_product->getProductUrl() ?>"><?php echo __('Click for price'); ?></a> - <?php endif; ?> +<div class="amount"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->getSubtotal()) ?> </div> diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/shipping.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/shipping.phtml index f8ebc3e7357fddb4d203113ebce56b84f822165f..80b6c5762b640de7e299acff357c645ace528815 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/cart/shipping.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/cart/shipping.phtml @@ -106,12 +106,7 @@ require([ <input name="estimate_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio" /> <label class="label" for="s_method_<?php echo $_rate->getCode() ?>"> <span><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?></span> - <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('Magento\Tax\Helper\Data')->displayShippingPriceIncludingTax()); ?> - <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?> - <?php echo $_excl; ?> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayShippingBothPrices() && $_incl != $_excl): ?> - (<?php echo __('Incl. Tax'); ?> <?php echo $_incl; ?>) - <?php endif; ?> + <?php echo $this->getShippingPriceHtml($_rate) ?> </label> <?php endif ?> </div> diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/sidebar/default.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/sidebar/default.phtml index ad98c68f8aa26c8b13b2b978957f1a9d0764db5e..a06f9acf686a0cfeb3317247348c133272bbe4af 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/cart/sidebar/default.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/cart/sidebar/default.phtml @@ -72,7 +72,6 @@ <?php // Prices ?> - <div class="pricing details<?php echo $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices() ? ' complex' : ''; ?>"> <?php if ($canApplyMsrp): ?> <div class="rate map"> @@ -81,115 +80,13 @@ </div> <?php else: ?> - - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - <div class="rate"> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - <span class="label excl tax"><?php echo __('Excl. Tax'); ?></span> - <?php else: ?> - <span class="label display"><?php echo __('Price'); ?></span> - <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> - <span class="value excl tax"> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> - </span> - <?php else: ?> - <span class="value display"> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> - </span> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> - - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <div class="rate weee"> - <span class="label weee"><?php echo $tax['title']; ?></span> - <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> - </div> - <?php endforeach; ?> - - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <div class="rate weee"> - <span class="label weee"><?php echo $tax['title']; ?></span> - <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - </div> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> - - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <div class="rate weee"> - <span class="label weee"><?php echo $tax['title']; ?></span> - <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - </div> - <?php endforeach; ?> - - <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> - <div class="rate weee total"> - <span class="label weee"><?php echo __('Total:'); ?></span> - <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> - <?php endif; ?> - - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> - <div class="rate"> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - <span class="label tax incl"><?php echo __('Incl. Tax'); ?></span> - <?php else: ?> - <span class="label display"><?php echo __('Price'); ?></span> - <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales')): ?> - <span class="value tax incl"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> - <?php else: ?> - <span class="value display"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?></span> - <?php endif; ?> - </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales')): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <div class="rate weee"> - <span class="label weee"><?php echo $tax['title']; ?></span> - <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> - </div> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <div class="rate weee"> - <span class="label weee"><?php echo $tax['title']; ?></span> - <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - </div> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales')): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <div class="rate weee"> - <span class="label weee"><?php echo $tax['title']; ?></span> - <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - </div> - <?php endforeach; ?> - <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales')): ?> - <div class="rate weee total"> - <span class="label weee tax incl"><?php echo __('Total incl. tax'); ?></span> - <span class="value weee"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> - <?php endif; ?> - + <?php echo $this->getSidebarItemPriceHtml($_item); ?> <?php endif; //Can apply MSRP ?> <div class="details qty"> <span class="label"><?php echo __('Qty'); ?></span> <span class="value qty"><?php echo $this->getQty() ?></span> </div> - </div> <div class="product actions"> <?php if ($_item->getProduct()->isVisibleInSiteVisibility()):?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/item/price/row.phtml b/app/code/Magento/Checkout/view/frontend/templates/item/price/row.phtml new file mode 100644 index 0000000000000000000000000000000000000000..f521c33736b199689d6fd33a18d24f7763db9b54 --- /dev/null +++ b/app/code/Magento/Checkout/view/frontend/templates/item/price/row.phtml @@ -0,0 +1,33 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Checkout\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +?> +<span class="excl tax" data-th="<?php echo $this->escapeHtml(__('Excl. Tax'));?>"> + <span class="cart price"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()) ?> + </span> +</span> diff --git a/app/code/Magento/Checkout/view/frontend/templates/item/price/unit.phtml b/app/code/Magento/Checkout/view/frontend/templates/item/price/unit.phtml new file mode 100644 index 0000000000000000000000000000000000000000..8da9e3d05c6ffcf0d228b4e5c6db046775c04e43 --- /dev/null +++ b/app/code/Magento/Checkout/view/frontend/templates/item/price/unit.phtml @@ -0,0 +1,33 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Checkout\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +?> +<span class="excl tax" data-th="<?php echo $this->escapeHtml(__('Excl. Tax')); ?>"> + <span class="cart price"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> + </span> +</span> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/progress.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/progress.phtml index 5bd564e85195df55867b466b66a71e5d6088ef90..0a6c13ef2e73db399152e5727d4dc5c49786d4ee 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/progress.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/progress.phtml @@ -71,16 +71,7 @@ <?php if ($this->getShippingMethod()): ?> <?php echo $this->escapeHtml($this->getShippingDescription()) ?> - <?php $_excl = $this->getShippingPriceExclTax(); ?> - <?php $_incl = $this->getShippingPriceInclTax(); ?> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayShippingPriceIncludingTax()): ?> - <?php echo $_incl; ?> - <?php else: ?> - <?php echo $_excl; ?> - <?php endif; ?> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayShippingBothPrices() && $_incl != $_excl): ?> - (<?php echo __('Incl. Tax'); ?> <?php echo $_incl; ?>) - <?php endif; ?> + <?php echo $this->getShippingPriceHtml($this->getShippingRate()) ?> <?php else: ?> <?php echo __('Shipping method has not been selected yet') ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item.phtml index d303b4da48f53a096b7ca21a485715b55ef1a09f..e4fe7fc63a01fca199b3b580f6d0f1a010e704b2 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item.phtml @@ -25,8 +25,6 @@ /** @var $this Magento\Checkout\Block\Cart\Item\Renderer */ $_item = $this->getItem(); -/** @var $_weeeHelper \Magento\Weee\Helper\Data */ -$_weeeHelper = $this->helper('Magento\Weee\Helper\Data'); ?> <tr> <td class="col item" data-th="<?php echo $this->escapeHtml(__('Product Name'));?>"><strong class="product name"><?php echo $this->escapeHtml($this->getProductName()) ?></strong> @@ -55,173 +53,23 @@ $_weeeHelper = $this->helper('Magento\Weee\Helper\Data'); </td> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col price excl tax" data-th="<?php echo $this->escapeHtml(__('Price'));?>"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> - <?php endif; ?> - - </span> - - - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - - <div class="cart tax info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee"><?php echo __('Total'); ?><br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> + <?php echo $this->getUnitPriceExclTaxHtml($_item); ?> </td> <?php endif; ?> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col price incl tax"> - <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_weeeHelper->getWeeeTaxInclTax($_item)); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> - <?php endif; ?> - - </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - - <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?>></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_weeeHelper->getWeeeTaxInclTax($_item)); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> + <?php echo $this->getUnitPriceInclTaxHtml($_item); ?> </td> <?php endif; ?> - <td class="col qty" data-th="<?php echo $this->escapeHtml(__('Qty'));?>"><span class="qty"><?php echo $_item->getQty() ?></span></td> + <td class="col qty"><span class="qty"><?php echo $_item->getQty() ?></span></td> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - <td class="col subtotal excl tax" data-th="<?php echo $this->escapeHtml(__('Subtotal'));?>"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()) ?> - <?php endif; ?> - - </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - - <div class="cart tax info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee"><?php echo __('Total'); ?>:<br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> + <td class="col subtotal excl tax"> + <?php echo $this->getRowtotalExclTaxHtml($_item); ?> </td> <?php endif; ?> <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> <td class="col subtotal incl tax"> - <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_weeeHelper->getRowWeeeTaxInclTax($_item)); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> - <?php endif; ?> - - </span> - - - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - - <div class="cart tax info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee"><?php echo __('Total incl. tax'); ?>:<br /> <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_weeeHelper->getRowWeeeTaxInclTax($_item)); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> + <?php echo $this->getRowtotalInclTaxHtml($_item); ?> </td> <?php endif; ?> </tr> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_excl_tax.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_excl_tax.phtml new file mode 100644 index 0000000000000000000000000000000000000000..2624f4597a306a1b5e9054d1354626b171f70a32 --- /dev/null +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_excl_tax.phtml @@ -0,0 +1,31 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Checkout\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +?> +<span class="cart price"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()) ?> +</span> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_incl_tax.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_incl_tax.phtml new file mode 100644 index 0000000000000000000000000000000000000000..97f5021039b3ae67dfc2a2788ce70ae515628785 --- /dev/null +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/row_incl_tax.phtml @@ -0,0 +1,32 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Checkout\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +?> +<?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> +<span class="cart price"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl) ?> +</span> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_excl_tax.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_excl_tax.phtml new file mode 100644 index 0000000000000000000000000000000000000000..5f62b4ef2cf369f393e26edc4728aa564668c31a --- /dev/null +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_excl_tax.phtml @@ -0,0 +1,31 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Checkout\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +?> +<span class="cart price"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> +</span> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_incl_tax.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_incl_tax.phtml new file mode 100644 index 0000000000000000000000000000000000000000..cfdc0239fc851a855e8809d84ef0a05c230619b9 --- /dev/null +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/review/item/price/unit_incl_tax.phtml @@ -0,0 +1,32 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Checkout\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +?> +<?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> +<span class="cart price"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl) ?> +</span> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/available.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/available.phtml index bae3a2e7c7c8016900d5131d4cbd9c506745b1aa..1a861ebcd023ce546a41dd98ef1738e6729aeded 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/available.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping_method/available.phtml @@ -44,12 +44,7 @@ <input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio"/> <?php endif; ?> <label class="label" for="s_method_<?php echo $_rate->getCode() ?>"><span><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?> - <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('Magento\Tax\Helper\Data')->displayShippingPriceIncludingTax()); ?> - <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?> - <?php echo $_excl; ?> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayShippingBothPrices() && $_incl != $_excl): ?> - (<?php echo __('Incl. Tax'); ?> <?php echo $_incl; ?>) - <?php endif; ?> + <?php echo $this->getShippingPriceHtml($_rate); ?> </span> </label> <?php endif ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/shipping/price.phtml b/app/code/Magento/Checkout/view/frontend/templates/shipping/price.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9c1d33fc0740cfa5f150f0071e5921cea4f8c4a8 --- /dev/null +++ b/app/code/Magento/Checkout/view/frontend/templates/shipping/price.phtml @@ -0,0 +1,28 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php /** @var $this \Magento\Checkout\Block\Shipping\Price */ ?> + +<?php $shippingPrice = $this->getShippingPrice(); ?> +<?php echo $shippingPrice; ?> diff --git a/app/code/Magento/Checkout/view/frontend/templates/total/tax.phtml b/app/code/Magento/Checkout/view/frontend/templates/total/tax.phtml deleted file mode 100644 index 7689b84c361a67338d8299d53aeda2d2d92ad1b5..0000000000000000000000000000000000000000 --- a/app/code/Magento/Checkout/view/frontend/templates/total/tax.phtml +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -?> -<?php global $taxIter; $taxIter++; ?> - -<?php - $attributes = 'class="totals-tax"'; - if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary() && $this->getTotal()->getValue()!=0) { - $attributes = 'class="totals-tax-summary"'; - } -?> -<tr <?php echo $attributes; ?>> - <td class="mark" colspan="<?php echo $this->getColspan(); ?>" style="<?php echo $this->getTotal()->getStyle() ?>"> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?> - <div class="detailed"><?php echo $this->getTotal()->getTitle() ?></div> - <?php else: ?> - <?php echo $this->getTotal()->getTitle() ?> - <?php endif;?> - </td> - <td class="amount" style="<?php echo $this->getTotal()->getStyle() ?>"> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->getTotal()->getValue()) ?> - </td> -</tr> - -<?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary() && $this->getTotal()->getValue()!=0): ?> - <?php $isTop = 1; ?> - <?php foreach ($this->getTotal()->getFullInfo() as $info): ?> - <?php if (isset($info['hidden']) && $info['hidden']) continue; ?> - <?php $percent = $info['percent']; ?> - <?php $amount = $info['amount']; ?> - <?php $rates = $info['rates']; ?> - <?php $isFirst = 1; ?> - - <?php foreach ($rates as $rate): ?> - <tr class="totals tax details details-<?php echo $taxIter; ?>"> - <td class="mark" style="<?php echo $this->getTotal()->getStyle() ?>" colspan="<?php echo $this->getColspan(); ?>"> - <?php echo $this->escapeHtml($rate['title']); ?> - <?php if (!is_null($rate['percent'])): ?> - (<?php echo (float)$rate['percent']; ?>%) - <?php endif; ?> - <br /> - </td> - <?php if ($isFirst): ?> - <td class="amount" rowspan="<?php echo count($rates); ?>" style="<?php echo $this->getTotal()->getStyle() ?>"> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($amount); ?> - </td> - <?php endif; ?> - </tr> - <?php $isFirst = 0; ?> - <?php $isTop = 0; ?> - <?php endforeach; ?> - <?php endforeach; ?> -<?php endif;?> diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json index 53612c3a15a997813e33bcaaa269bc37569b00f0..35a7284e76f3742104ba6d931baf6cc675a10e63 100644 --- a/app/code/Magento/CheckoutAgreements/composer.json +++ b/app/code/Magento/CheckoutAgreements/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-store": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json index 04e668fb805eb59e166610bb0692fa16cb451100..8b65e07c9de8b3ca9a8301a3c0082880c68e5c6f 100644 --- a/app/code/Magento/Cms/composer.json +++ b/app/code/Magento/Cms/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-widget": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-email": "0.1.0-alpha90", - "magento/module-install": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-widget": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-email": "0.1.0-alpha91", + "magento/module-install": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json index 091d2ae7c31be6d130677d19987b1a67a5b4e761..ee8135442f53429dadadd8c16677e1a5e4aa45a3 100644 --- a/app/code/Magento/CmsUrlRewrite/composer.json +++ b/app/code/Magento/CmsUrlRewrite/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-url-redirect": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90" + "magento/module-store": "0.1.0-alpha91", + "magento/module-url-redirect": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json index f00320c5f0e6cc1b4c9f54c6b4b77609a4f44fab..e73c6a4fc6212bc3dbac4d193c4bddc03ba04bfb 100644 --- a/app/code/Magento/ConfigurableImportExport/composer.json +++ b/app/code/Magento/ConfigurableImportExport/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-catalog-import-export": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-import-export": "0.1.0-alpha90", - "magento/module-configurable-product": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90" + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-catalog-import-export": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-import-export": "0.1.0-alpha91", + "magento/module-configurable-product": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index 7c456e44c9bf28422583c540c79e183279df6656..5ccabdd7a7a8a735e1309220e4720f4030e791c8 100644 --- a/app/code/Magento/ConfigurableProduct/composer.json +++ b/app/code/Magento/ConfigurableProduct/composer.json @@ -3,25 +3,25 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-catalog-rule": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-weee": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", - "magento/module-webapi": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-catalog-rule": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-weee": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", + "magento/module-webapi": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json index acae9e53d5a3228280868721addb709934ce6e24..bd64a3c22e5a66ba8f81e30ce15f9f733738b090 100644 --- a/app/code/Magento/Contact/composer.json +++ b/app/code/Magento/Contact/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-cms": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-cms": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Core/composer.json b/app/code/Magento/Core/composer.json index a79885d900b343214c090c181dcb9edfbe411b2f..fe40e8dd03b1d6a41c33f04f2cc7441ac28baae7 100644 --- a/app/code/Magento/Core/composer.json +++ b/app/code/Magento/Core/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-cron": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-page-cache": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-cron": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-page-cache": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Core/view/frontend/web/prototype/magento.css b/app/code/Magento/Core/view/frontend/web/prototype/magento.css index 973df1582cdc1010ff8f2fd21ae4fde2cced04a3..97a1b34a5cc588e1512ec4adcc2b402d5c491922 100644 --- a/app/code/Magento/Core/view/frontend/web/prototype/magento.css +++ b/app/code/Magento/Core/view/frontend/web/prototype/magento.css @@ -25,6 +25,7 @@ background: #fff; -webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, .4); box-shadow: 0 3px 6px rgba(0, 0, 0, .4); + z-index: 1000; } .dialog.ui-dialog { @@ -73,18 +74,23 @@ width: 16px; z-index: 1000; text-decoration: none; + line-height: 90%; } .ui-dialog .ui-dialog-titlebar-close:before { color: #676056; - content: "\e012"; - font-family: 'icons'; + content: 'X'; + font-family: sans-serif; font-style: normal; speak: none; font-weight: normal; -webkit-font-smoothing: antialiased; } +.ui-dialog .ui-dialog-titlebar-close .ui-button-text { + display: none; +} + .ui-dialog .ui-dialog-titlebar-close .ui-icon { display: none; } diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index 24bb9c00e22f3659c7d7ba57746d204855777ef0..aa23e8c2982ee50e4de1956135253f5f1afd845b 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index 616e2e5509aadfc2472601672770e95cbb2d37dd..e4057a028bf553af9e2e15f7592720b846f6da72 100644 --- a/app/code/Magento/CurrencySymbol/composer.json +++ b/app/code/Magento/CurrencySymbol/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-page-cache": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-page-cache": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index 883e23e784e9ee2e0369faec341817f65c643a0e..24835cd97b1e784d483bf0cf312c2292dc924572 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -3,29 +3,29 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-newsletter": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-wishlist": "0.1.0-alpha90", - "magento/module-index": "0.1.0-alpha90", - "magento/module-log": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-review": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-page-cache": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", - "magento/module-authorization": "0.1.0-alpha90", - "magento/module-integration": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-newsletter": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-wishlist": "0.1.0-alpha91", + "magento/module-index": "0.1.0-alpha91", + "magento/module-log": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-review": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-page-cache": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", + "magento/module-authorization": "0.1.0-alpha91", + "magento/module-integration": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json index 1ac83c3b0366d8a287cb87735703becce0a6c6a3..5230a785e9ca89fe5a154a3c998120a1c9509721 100644 --- a/app/code/Magento/CustomerImportExport/composer.json +++ b/app/code/Magento/CustomerImportExport/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-import-export": "0.1.0-alpha90", - "magento/module-store": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-import-export": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/DesignEditor/composer.json b/app/code/Magento/DesignEditor/composer.json index ac8de66b7a1aa54c9adb47b6fbe6c3970d6b4cc3..989e8759253041526da941a25254faa65281991a 100644 --- a/app/code/Magento/DesignEditor/composer.json +++ b/app/code/Magento/DesignEditor/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-url-rewrite": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-url-rewrite": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/DesignEditor/view/frontend/templates/translate_inline.phtml b/app/code/Magento/DesignEditor/view/frontend/templates/translate_inline.phtml index 1f250a9966a6a0b8ad07c2faf93b992cf7d69e5e..e5c673265c73807d32d007e4203317b628946a96 100644 --- a/app/code/Magento/DesignEditor/view/frontend/templates/translate_inline.phtml +++ b/app/code/Magento/DesignEditor/view/frontend/templates/translate_inline.phtml @@ -31,7 +31,7 @@ <form id="${id}" data-form="translate-inline-dialog-form"> {{each(i, item) items}} <input id="perstore_${i}" name="translate[${i}][perstore]" type="hidden" value="0"/> - <input name="translate[${i}][original]" type="hidden" value="${item.scope}::${escape(item.original)}"/> + <input name="translate[${i}][original]" type="hidden" value="${escape(item.original)}"/> <textarea id="custom_${i}" name="translate[${i}][custom]" data-translate-input-index="${i}">${escape(item.translated)}</textarea> {{/each}} </form> diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index 0832f2077dfd8c1decc9740dc3869888d123de3e..e9347ff479dd40c5651dbb94a86321283fb31850 100644 --- a/app/code/Magento/Dhl/composer.json +++ b/app/code/Magento/Dhl/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-shipping": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-shipping": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index d8fee1dd15c49639d5222bc370f22d44c4d64663..f4f9ad63d70ff1b48bc99e5bad379c7054240534 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json index dfaa9b07ab477e8d0512d71975ed4a7d436cc751..015b58a6c067856787ebd5eebfe530a7065bfc42 100644 --- a/app/code/Magento/Downloadable/composer.json +++ b/app/code/Magento/Downloadable/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-weee": "0.1.0-alpha90", - "magento/module-wishlist": "0.1.0-alpha90", - "magento/module-gift-message": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-weee": "0.1.0-alpha91", + "magento/module-wishlist": "0.1.0-alpha91", + "magento/module-gift-message": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Downloadable/view/frontend/templates/checkout/cart/item/default.phtml b/app/code/Magento/Downloadable/view/frontend/templates/checkout/cart/item/default.phtml index aae54e11456959c24faef1b7dda550e52bf94a61..8f5d09241888d13f3f376bae2fc90726a5b8ee7c 100644 --- a/app/code/Magento/Downloadable/view/frontend/templates/checkout/cart/item/default.phtml +++ b/app/code/Magento/Downloadable/view/frontend/templates/checkout/cart/item/default.phtml @@ -78,7 +78,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite <?php $cols = 1; ?> </td> <?php if ($canApplyMsrp): ?> - <td class="col msrp"<?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> colspan="2"<?php endif; ?>> + <td class="col msrp"> <span class="cart price"> <span class="msrp notice"><?php echo __('See price before order confirmation.'); ?></span> <?php $helpLinkId = 'cart-msrp-help-' . $_item->getId(); ?> @@ -94,95 +94,13 @@ require(['prototype'], function(){ <?php $cols++; ?> </td> <?php else: ?> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - <td class="col price" data-th="<?php echo $this->escapeHtml(__('Price')); ?>"> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - <span class="incl tax" data-th="<?php echo $this->escapeHtml(__('Incl. Tax')); ?>"> - <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?> - <?php endif; ?> - </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee" data-th="<?php echo __('Total incl. tax'); ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> - <?php $cols++; ?> - </span> - <?php endif; ?> - - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()): ?> - <span class="excl tax" data-th="<?php echo $this->escapeHtml(__('Excl. Tax')); ?>"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> - <?php endif; ?> - </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee" data-th="<?php echo $this->escapeHtml(__('Total')); ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> - </span> - <?php endif; ?> + <td class="col price" data-th="<?php echo $this->escapeHtml(__('Price')); ?>"> + <?php echo $this->getUnitPriceHtml($_item); ?> <?php $cols++; ?> </td> - <?php endif; ?> + + <?php endif; ?> <td class="col qty"> <div class="control qty"> @@ -191,104 +109,14 @@ require(['prototype'], function(){ <?php $cols++; ?> </td> - <?php if (($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() ||$this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - <td class="col subtotal" data-th="<?php echo $this->escapeHtml(__('Subtotal'));?>"> - <?php if (($this->helper('Magento\Tax\Helper\Data')->displayCartPriceInclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - <span class="incl tax" data-th="<?php echo __('Incl. Tax'); ?>"> - <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - <?php if ($canApplyMsrp): ?> - <span class="cart msrp subtotal">--</span> - <?php else: ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?> - <?php endif; ?> - <?php endif; ?> - </span> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee" data-th="<?php echo __('Total incl. tax'); ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> - </span> + <td class="col subtotal" data-th="<?php echo $this->escapeHtml(__('Subtotal'));?>"> + <?php if ($canApplyMsrp): ?> + <span class="cart msrp subtotal">--</span> + <?php else: ?> + <?php echo $this->getRowTotalHtml($_item); ?> <?php endif; ?> - - <?php if (($this->helper('Magento\Tax\Helper\Data')->displayCartPriceExclTax() || $this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?> - <span class="excl tax" data-th="<?php echo __('Excl. Tax'); ?>"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <span class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <?php else: ?> - <span class="cart price"> - <?php endif; ?> - - <?php if ($canApplyMsrp): ?> - <span class="cart msrp subtotal">--</span> - <?php else: ?> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?> - <?php else: ?> - <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()) ?> - <?php endif; ?> - <?php endif; ?> - - </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> - <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php elseif ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> - <span class="weee" data-th="<?php echo $tax['title']; ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> - <?php endforeach; ?> - <?php endif; ?> - </div> - - <?php if ($this->helper('Magento\Weee\Helper\Data')->typeOfDisplay(2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?> - <div class="cart-tax-total" - data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> - <span class="weee" data-th="<?php echo __('Total'); ?>"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span> - </div> - <?php endif; ?> - <?php endif; ?> - </span> - <?php endif; ?> - <?php $cols++; ?> - </td> - <?php endif; ?> + <?php $cols++; ?> + </td> </tr> <tr class="item actions"> <td colspan="<?php echo $cols;?>"> diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index 4ff54743f583848ea453efedece43eea18426034..e8ca045290861d86f4057ec1d288a0f3d23f15bd 100644 --- a/app/code/Magento/Eav/composer.json +++ b/app/code/Magento/Eav/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index 1f01b6d4c0d69f186f9b81bb6ff28b239abce3f7..acdd4206e94326a1e50f522f0745b05903444ab2 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-cms": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-cms": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json index 462b906d620269ba2b2b4937e7e4af4750dfd2f9..fc1956a316565717f4b28253652c4a3741038394 100644 --- a/app/code/Magento/Fedex/composer.json +++ b/app/code/Magento/Fedex/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-shipping": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-shipping": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index 1b7228317bb77f8fbe03c6139db4833661859372..27667e3e25a5ce68231e6833a35a84e39d0ab6ed 100644 --- a/app/code/Magento/GiftMessage/composer.json +++ b/app/code/Magento/GiftMessage/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-multishipping": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-multishipping": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json index d6f7e5d6a8e8ca5e3bbef820b48e0533c19d1f47..c923d16192f375c9e23b4d0aeab7065954a276ba 100644 --- a/app/code/Magento/GoogleAdwords/composer.json +++ b/app/code/Magento/GoogleAdwords/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json index 4919131005d3a4811278611b71a177ee4290ab00..098c375ca4a4c7e384d7a116d66f560e1c785694 100644 --- a/app/code/Magento/GoogleAnalytics/composer.json +++ b/app/code/Magento/GoogleAnalytics/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json index c4caba7bbb770e306fc3fc4b9f9d1813a1baf343..abb7d23a5d455bcd3ef4b4f58dc2373ba1fe6542 100644 --- a/app/code/Magento/GoogleOptimizer/composer.json +++ b/app/code/Magento/GoogleOptimizer/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-google-analytics": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-cms": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-google-analytics": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-cms": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/Price.php b/app/code/Magento/GoogleShopping/Model/Attribute/Price.php index 305eec75a9990971b715de07324e18f95817e409..81a8cbcc4174a9372ac3af761e90f93a8a67e1df 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/Price.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/Price.php @@ -41,6 +41,11 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute */ protected $_taxData = null; + /** + * @var \Magento\Catalog\Helper\Data|null + */ + protected $_catalogData = null; + /** * Config * @@ -77,6 +82,7 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\Customer\Service\V1\CustomerGroupService $customerGroupService + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Framework\Data\Collection\Db $resourceCollection * @param array $data * @@ -94,6 +100,7 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute \Magento\Tax\Helper\Data $taxData, \Magento\GoogleShopping\Model\Config $config, \Magento\Customer\Service\V1\CustomerGroupService $customerGroupService, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Framework\Data\Collection\Db $resourceCollection = null, array $data = array() ) { @@ -102,6 +109,7 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute $this->_taxData = $taxData; $this->_customerGroupService = $customerGroupService; $this->catalogPrice = $catalogPrice; + $this->_catalogData = $catalogData; parent::__construct( $context, $registry, @@ -236,7 +244,7 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute } } if ($product->getTypeId() != Product\Type::TYPE_BUNDLE) { - $price = $this->_taxData->getPrice($product, $price, $inclTax, null, null, null, $product->getStoreId()); + $price = $this->_catalogData->getTaxPrice($product, $price, $inclTax, null, null, null, $product->getStoreId()); } return $price; } @@ -267,7 +275,7 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute } } if ($product->getTypeId() != Product\Type::TYPE_BUNDLE) { - $finalPrice = $this->_taxData->getPrice( + $finalPrice = $this->_catalogData->getTaxPrice( $product, $finalPrice, $inclTax, diff --git a/app/code/Magento/GoogleShopping/composer.json b/app/code/Magento/GoogleShopping/composer.json index 5fc87f04a43f2b6267dc82bb393b086e81751162..99c1f0a77aa35244727862db82be8fc76db2b88e 100644 --- a/app/code/Magento/GoogleShopping/composer.json +++ b/app/code/Magento/GoogleShopping/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json index 9ddd9462305e8943bb0078e385fab1b1f9a50c04..ffd9ef845df3a38b57d82361131b9a39d1f529a4 100644 --- a/app/code/Magento/GroupedImportExport/composer.json +++ b/app/code/Magento/GroupedImportExport/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-import-export": "0.1.0-alpha90", - "magento/module-catalog-import-export": "0.1.0-alpha90", - "magento/module-grouped-product": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90" + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-import-export": "0.1.0-alpha91", + "magento/module-catalog-import-export": "0.1.0-alpha91", + "magento/module-grouped-product": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/GroupedProduct/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php b/app/code/Magento/GroupedProduct/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php index be12f61a002c89198a35e57034ae9911d9e60a35..168538c1d4aa34f32a9bd787fa8ff2bda886f2aa 100644 --- a/app/code/Magento/GroupedProduct/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php +++ b/app/code/Magento/GroupedProduct/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php @@ -35,11 +35,6 @@ use Magento\Customer\Service\V1\CustomerAccountServiceInterface as CustomerAccou */ class Grouped extends \Magento\GroupedProduct\Block\Product\View\Type\Grouped { - /** - * @var string - */ - protected $_priceBlockDefaultTemplate = 'catalog/product/price.phtml'; - /** * @var \Magento\Core\Helper\Data */ @@ -83,7 +78,6 @@ class Grouped extends \Magento\GroupedProduct\Block\Product\View\Type\Grouped { parent::_construct(); - $this->_block = 'Magento\Catalog\Block\Adminhtml\Product\Price'; $this->_useLinkForAsLowAs = false; } diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json index cf8b138e08efeb0a6a915dfab28d4a9a81023a8a..2093d016c8f3d7fd5479aac169f9b0300e670985 100644 --- a/app/code/Magento/GroupedProduct/composer.json +++ b/app/code/Magento/GroupedProduct/composer.json @@ -3,22 +3,22 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/templates/catalog/product/composite/fieldset/grouped.phtml b/app/code/Magento/GroupedProduct/view/adminhtml/templates/catalog/product/composite/fieldset/grouped.phtml index a8c10055c84f65a85886a718edef2db39cddcf80..e08864f013854a4133aead41f0c5fd3f58d01877 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/templates/catalog/product/composite/fieldset/grouped.phtml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/templates/catalog/product/composite/fieldset/grouped.phtml @@ -53,7 +53,7 @@ <?php if ($_hasAssociatedProducts): ?> <?php $i = 0 ?> <?php foreach ($_associatedProducts as $_item): ?> - <?php $_finalPriceInclTax = $this->helper('Magento\Tax\Helper\Data')->getPrice($_item, $_item->getFinalPrice(), true) ?> + <?php $_finalPriceInclTax = $this->helper('Magento\Catalog\Helper\Data')->getTaxPrice($_item, $_item->getFinalPrice(), true) ?> <tr class="<?php echo (++$i % 2) ? 'even' : 'odd' ?>"> <td class="col-id"><?php echo $_item->getId() ?></td> <td class="col-sku"><?php echo $this->escapeHtml($_item->getSku()) ?></td> diff --git a/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml index 1b2ed7999cd3e6c996ffc142c90aae88d9a97a53..6ce28a498987e4ab3d598a4abdb4817c2482b8cc 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml +++ b/app/code/Magento/GroupedProduct/view/frontend/layout/catalog_product_rss_feed_renderer_list.xml @@ -24,9 +24,6 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <referenceBlock name="catalog.product.rss.feed.renderer.list"> - <block class="Magento\Catalog\Block\Product\Price" as="grouped" template="Magento_GroupedProduct::rss/product/price.phtml" /> - </referenceBlock> <block class="Magento\Framework\Pricing\Render" name="product.price.render.grouped"> <arguments> <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> diff --git a/app/code/Magento/GroupedProduct/view/frontend/templates/product/price.phtml b/app/code/Magento/GroupedProduct/view/frontend/templates/product/price.phtml index eb2f83a9815a4c7b42e768da1920a5f338ca78a1..7199a5fc7ed41c300a8e4174d33bd507a1309406 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/templates/product/price.phtml +++ b/app/code/Magento/GroupedProduct/view/frontend/templates/product/price.phtml @@ -31,6 +31,8 @@ $_coreHelper = $this->helper('Magento\Core\Helper\Data'); /* @var $taxHelper \Magento\Tax\Helper\Data */ $taxHelper = $this->helper('Magento\Tax\Helper\Data'); +/* @var $catalogHelper \Magento\Catalog\Helper\Data */ +$catalogHelper = $this->helper('Magento\Catalog\Helper\Data'); $_product = $this->getProduct(); $_id = $_product->getId(); @@ -38,13 +40,13 @@ $_minimalPriceValue = $_product->getMinimalPrice(); $showMinPrice = $this->getDisplayMinimalPrice(); if ($showMinPrice && $_minimalPriceValue) { - $_exclTax = $taxHelper->getPrice($_product, $_minimalPriceValue); - $_inclTax = $taxHelper->getPrice($_product, $_minimalPriceValue, true); + $_exclTax = $catalogHelper->getTaxPrice($_product, $_minimalPriceValue); + $_inclTax = $catalogHelper->getTaxPrice($_product, $_minimalPriceValue, true); $price = $showMinPrice ? $_minimalPriceValue : 0; } else { $price = $_product->getFinalPrice(); - $_exclTax = $taxHelper->getPrice($_product, $price); - $_inclTax = $taxHelper->getPrice($_product, $price, true); + $_exclTax = $catalogHelper->getTaxPrice($_product, $price); + $_inclTax = $catalogHelper->getTaxPrice($_product, $price, true); } ?> diff --git a/app/code/Magento/GroupedProduct/view/frontend/templates/rss/product/price.phtml b/app/code/Magento/GroupedProduct/view/frontend/templates/rss/product/price.phtml deleted file mode 100644 index 8624390034aabb601203c0f92f035a75b5d64a58..0000000000000000000000000000000000000000 --- a/app/code/Magento/GroupedProduct/view/frontend/templates/rss/product/price.phtml +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -/** - * Template for displaying product price in RSS feeds - * - * @var $this \Magento\Catalog\Block\Product\Price - */ -?> -<?php -$_product = $this->getProduct(); -$_id = $_product->getId(); -$_minimalPriceValue = $_product->getMinimalPrice(); - -/** @var \Magento\Tax\Helper\Data $taxHelper */ -$taxHelper = $this->helper('Magento\Tax\Helper\Data'); -$_exclTax = $taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax = null); -$_inclTax = $taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax = true); -?> - -<?php if ($_product->getCanShowPrice() !== false):?> - <?php if ($this->getDisplayMinimalPrice() && $_minimalPriceValue): ?> - <div class="price-box"> - <p class="minimal-price"> - <span class="price-label"><?php echo __('Starting at:') ?></span> - <?php if ($this->helper('Magento\Tax\Helper\Data')->displayBothPrices()): ?> - <span class="price-excluding-tax"> - <span class="label"><?php echo __('Excl. Tax:') ?></span> - <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_exclTax, true, false) ?></span> - </span> - <span class="price-including-tax"> - <span class="label"><?php echo __('Incl. Tax:') ?></span> - <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_inclTax, true, false) ?></span> - </span> - <?php else: ?> - <?php - $_showPrice = $_inclTax; - if (!$taxHelper->displayPriceIncludingTax()) { - $_showPrice = $_exclTax; - } - ?> - <span class="price" id="product-minimal-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($_showPrice, true, false) ?></span> - <?php endif; ?> - </p> - </div> - <?php endif; ?> -<?php endif; ?> diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json index 3b83b03847620c7b0cf558f35cca29d46929cf29..224484fd26fc043cdcfcf689a423d79de4d88976 100644 --- a/app/code/Magento/ImportExport/composer.json +++ b/app/code/Magento/ImportExport/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-index": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-index": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "ext-ctype": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Index/composer.json b/app/code/Magento/Index/composer.json index fcf3e916598bb4ee95d3f64a5b64b18efedfdd01..23a2328951196244a6b45a200b6e019f9b2abf12 100644 --- a/app/code/Magento/Index/composer.json +++ b/app/code/Magento/Index/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index 4409860e4a068cf1bb03fa0deb002c64a3bc29c4..3556507c3e14bbbf4f4c9fdb3024dd19e8fc9a0c 100644 --- a/app/code/Magento/Indexer/composer.json +++ b/app/code/Magento/Indexer/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-page-cache": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-page-cache": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Install/composer.json b/app/code/Magento/Install/composer.json index 37ae0241420a80e98dcd5773225ffe4e973633ea..07bc5522643c88ae72ab3a716b7b125bcfcd030f 100644 --- a/app/code/Magento/Install/composer.json +++ b/app/code/Magento/Install/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-user": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-user": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json index 221c3807348cf60518c50868ae177ff0f7e394bc..66472fc0f953676afac0693c005f935ca333131c 100644 --- a/app/code/Magento/Integration/composer.json +++ b/app/code/Magento/Integration/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-user": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", - "magento/module-authorization": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-user": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", + "magento/module-authorization": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/LayeredNavigation/composer.json b/app/code/Magento/LayeredNavigation/composer.json index 00ec2ff67d6d64a7677b3a4fa924a12d82ad47b5..2b6661ad71272da03f50273f182a00706fba3377 100644 --- a/app/code/Magento/LayeredNavigation/composer.json +++ b/app/code/Magento/LayeredNavigation/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Log/composer.json b/app/code/Magento/Log/composer.json index 5fb3aacf06e9d988f8bf6e789bc32473bb31ffd8..f582ea2c56c73b8a57b4ed6e35ead18dc8088891 100644 --- a/app/code/Magento/Log/composer.json +++ b/app/code/Magento/Log/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json index 023416f651c932b0d2e49fcf5448f45fda717415..1413284e44a5098471aea6d4d6a863ac23d0f356 100644 --- a/app/code/Magento/Multishipping/composer.json +++ b/app/code/Magento/Multishipping/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-payment": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-weee": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-payment": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-weee": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json index 4bc48b94f69940bf124d9aa7aa51e68efdd33121..f4b419d6a8449eaf00e08c549c7121ba300a4bba 100644 --- a/app/code/Magento/Newsletter/composer.json +++ b/app/code/Magento/Newsletter/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-widget": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-cms": "0.1.0-alpha90", - "magento/module-email": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-cron": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-widget": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-cms": "0.1.0-alpha91", + "magento/module-email": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-cron": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json index ec0bfcae4b8df45957f0e4021a3b0ad17e2cb2f2..a280b3e9cd85536659a3c5cae5809b810d00711a 100644 --- a/app/code/Magento/OfflinePayments/composer.json +++ b/app/code/Magento/OfflinePayments/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-payment": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-payment": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json index e35cbbe21966b4e6d3275e5190779e1d144ffe09..46380fe5154d418af8a110ddb1b3819e4e1c0714 100644 --- a/app/code/Magento/OfflineShipping/composer.json +++ b/app/code/Magento/OfflineShipping/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-shipping": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-sales-rule": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-shipping": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-sales-rule": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Ogone/composer.json b/app/code/Magento/Ogone/composer.json index c32adb17524fe1ddec4b7ca49c1aea9f1c536fea..846030f27c43618836b270f3bcd69a7cdbcfcf0f 100644 --- a/app/code/Magento/Ogone/composer.json +++ b/app/code/Magento/Ogone/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-payment": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-payment": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json index 1a1968b4da93ff9d0a4b4c5bda73d9a8ce2d844f..b3052028f0df61d2e23816035c45ec11868cf3aa 100644 --- a/app/code/Magento/PageCache/composer.json +++ b/app/code/Magento/PageCache/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/PayPalRecurringPayment/composer.json b/app/code/Magento/PayPalRecurringPayment/composer.json index 8c2e560ad96412942a7c530556de4f59ff5cac8e..b057a1b38824ff621459bd78cbbdc04f45c390fd 100644 --- a/app/code/Magento/PayPalRecurringPayment/composer.json +++ b/app/code/Magento/PayPalRecurringPayment/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-payment": "0.1.0-alpha90", - "magento/module-paypal": "0.1.0-alpha90", - "magento/module-recurring-payment": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-payment": "0.1.0-alpha91", + "magento/module-paypal": "0.1.0-alpha91", + "magento/module-recurring-payment": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index fce23ae89598a788afe4b42f7e88c238afce093a..79f3726af36525cf709d09783a6be609cd348a2c 100644 --- a/app/code/Magento/Payment/composer.json +++ b/app/code/Magento/Payment/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-centinel": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-centinel": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Paypal/composer.json b/app/code/Magento/Paypal/composer.json index cd97fcde61a5524f028a36f2dac10effb9cedd96..2093260f349235896c759487c420f1f52e6fa18f 100644 --- a/app/code/Magento/Paypal/composer.json +++ b/app/code/Magento/Paypal/composer.json @@ -3,25 +3,25 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-payment": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-centinel": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-payment": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-centinel": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json index 9f15f4a5107fe99bc814d9f423ca183f383981aa..0c3540b5ac109223cf5a74485567edec0d870f1b 100644 --- a/app/code/Magento/Persistent/composer.json +++ b/app/code/Magento/Persistent/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-cron": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-cron": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/ProductAlert/Model/Observer.php b/app/code/Magento/ProductAlert/Model/Observer.php index 3bb08cf5e156f7d26f0b0aee5304ebcbcb628334..361ade36842406a2a9e76d0bd0fd2e399749c388 100644 --- a/app/code/Magento/ProductAlert/Model/Observer.php +++ b/app/code/Magento/ProductAlert/Model/Observer.php @@ -72,11 +72,11 @@ class Observer protected $_errors = array(); /** - * Tax data + * Catalog data * - * @var \Magento\Tax\Helper\Data + * @var \Magento\Catalog\Helper\Data */ - protected $_taxData = null; + protected $_catalogData = null; /** * Core store config @@ -131,7 +131,7 @@ class Observer protected $inlineTranslation; /** - * @param \Magento\Tax\Helper\Data $taxData + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\ProductAlert\Model\Resource\Price\CollectionFactory $priceColFactory @@ -144,7 +144,7 @@ class Observer * @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation */ public function __construct( - \Magento\Tax\Helper\Data $taxData, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\ProductAlert\Model\Resource\Price\CollectionFactory $priceColFactory, @@ -156,7 +156,7 @@ class Observer \Magento\ProductAlert\Model\EmailFactory $emailFactory, \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation ) { - $this->_taxData = $taxData; + $this->_catalogData = $catalogData; $this->_scopeConfig = $scopeConfig; $this->_storeManager = $storeManager; $this->_priceColFactory = $priceColFactory; @@ -249,8 +249,8 @@ class Observer $product->setCustomerGroupId($customer->getGroupId()); if ($alert->getPrice() > $product->getFinalPrice()) { $productPrice = $product->getFinalPrice(); - $product->setFinalPrice($this->_taxData->getPrice($product, $productPrice)); - $product->setPrice($this->_taxData->getPrice($product, $product->getPrice())); + $product->setFinalPrice($this->_catalogData->getTaxPrice($product, $productPrice)); + $product->setPrice($this->_catalogData->getTaxPrice($product, $product->getPrice())); $email->addPriceProduct($product); $alert->setPrice($productPrice); diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index cae86a3d2c98b677c7d7687499ee23f691481dec..525c8d9ed503c8a6309dacb3dda6e53a775952af 100644 --- a/app/code/Magento/ProductAlert/composer.json +++ b/app/code/Magento/ProductAlert/composer.json @@ -3,16 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/ProductAlert/etc/module.xml b/app/code/Magento/ProductAlert/etc/module.xml index 301a9234e2d3f1f360f420ff9bac228b19a00b76..24262c0128cabbf023f5677b03423abaa4dd9028 100644 --- a/app/code/Magento/ProductAlert/etc/module.xml +++ b/app/code/Magento/ProductAlert/etc/module.xml @@ -34,7 +34,6 @@ <module name="Magento_Catalog"/> <module name="Magento_Customer"/> <module name="Magento_Core"/> - <module name="Magento_Tax"/> </depends> </module> </config> diff --git a/app/code/Magento/RecurringPayment/composer.json b/app/code/Magento/RecurringPayment/composer.json index 1c8a325da56aaa2f840e88ee1f5b583dae6e0849..0e07d3798a301e5b1d253dedb32889bbecfa3af3 100644 --- a/app/code/Magento/RecurringPayment/composer.json +++ b/app/code/Magento/RecurringPayment/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-payment": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-payment": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json index a1ffb43367285a7d648a5e98b75959ae00b095a6..f506ed02d8963f311c393e2d41f756150ae40524 100644 --- a/app/code/Magento/Reports/composer.json +++ b/app/code/Magento/Reports/composer.json @@ -3,27 +3,27 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-cms": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-widget": "0.1.0-alpha90", - "magento/module-log": "0.1.0-alpha90", - "magento/module-wishlist": "0.1.0-alpha90", - "magento/module-review": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-downloadable": "0.1.0-alpha90", - "magento/module-sales-rule": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-cms": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-widget": "0.1.0-alpha91", + "magento/module-log": "0.1.0-alpha91", + "magento/module-wishlist": "0.1.0-alpha91", + "magento/module-review": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-downloadable": "0.1.0-alpha91", + "magento/module-sales-rule": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json index 6ff6189d3f8515a3fd279b923d7a77a492c02242..a5a5b0acffa3ae3bfbdfe0732f058da0188873b5 100644 --- a/app/code/Magento/RequireJs/composer.json +++ b/app/code/Magento/RequireJs/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index 17d0c66fe78b2c481cab2b316b982f3d04bcebdb..fb3bc3b4c9d775acb7f690be8da9bf70487e81a7 100644 --- a/app/code/Magento/Review/composer.json +++ b/app/code/Magento/Review/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-newsletter": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-newsletter": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json index dcef739b2ff3402f2cd3be02aeacc507df518753..c34c06f6bb5b19d2dfdab5749e60dabfed5d31d4 100644 --- a/app/code/Magento/Rss/composer.json +++ b/app/code/Magento/Rss/composer.json @@ -3,22 +3,22 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-sales-rule": "0.1.0-alpha90", - "magento/module-wishlist": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-review": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-gift-message": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-sales-rule": "0.1.0-alpha91", + "magento/module-wishlist": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-review": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-gift-message": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml index 39dcba1907665376f521b2a5e8f58aa4759ed254..b22f4d7f10867d060a99b4a3aedbfbd0bb00dfd7 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_category.xml @@ -24,10 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="catalog_product_rss_feed_renderer_list" /> - <block class="Magento\Rss\Block\Catalog\Category" output="1" name="rss.catalog.category" cacheable="false"> - <block class="Magento\Framework\View\Element\RendererList" name="catalog.product.rss.feed.renderer.list" as="renderer.list" /> - </block> + <block class="Magento\Rss\Block\Catalog\Category" output="1" name="rss.catalog.category" cacheable="false"/> <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> <arguments> <argument name="price_render_handle" xsi:type="string">catalog_product_prices</argument> diff --git a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml index eb952b5fc588619e08536c69ac5a2f59d555fb0a..abb1d44b535d991bd6a9c7e1dc0cab924eecd1d3 100644 --- a/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml +++ b/app/code/Magento/Rss/view/frontend/layout/rss_catalog_new.xml @@ -24,7 +24,6 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> - <update handle="catalog_product_rss_feed_renderer_list" /> <block class="Magento\Rss\Block\Catalog\NewCatalog" output="1" name="rss.catalog.new" cacheable="false"> <block class="Magento\Framework\Pricing\Render" name="product.price.render.default"> <arguments> diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json index c673316805af15b55a8fe17b31c965a0bebb09df..1cfb1de550dbd3953e52c28858726efa47e288ea 100644 --- a/app/code/Magento/Rule/composer.json +++ b/app/code/Magento/Rule/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json index 3fc154834cc263454b3ce7b09be0243b21ca9eca..5baf94d7b0adbdcf29a1ec6d14825be1b930f2dd 100644 --- a/app/code/Magento/Sales/composer.json +++ b/app/code/Magento/Sales/composer.json @@ -3,31 +3,31 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-payment": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-sales-rule": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-widget": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-gift-message": "0.1.0-alpha90", - "magento/module-reports": "0.1.0-alpha90", - "magento/module-weee": "0.1.0-alpha90", - "magento/module-rss": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/module-wishlist": "0.1.0-alpha90", - "magento/module-email": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-payment": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-sales-rule": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-widget": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-gift-message": "0.1.0-alpha91", + "magento/module-reports": "0.1.0-alpha91", + "magento/module-weee": "0.1.0-alpha91", + "magento/module-rss": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/module-wishlist": "0.1.0-alpha91", + "magento/module-email": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/SalesRule/Model/Validator.php b/app/code/Magento/SalesRule/Model/Validator.php index c89304ffb3fe92f281e2cbf85d9d9c5a131de4d9..31548d5e297dc1eeb5496444f77624ab78ff4c50 100644 --- a/app/code/Magento/SalesRule/Model/Validator.php +++ b/app/code/Magento/SalesRule/Model/Validator.php @@ -70,11 +70,11 @@ class Validator extends \Magento\Framework\Model\AbstractModel protected $_skipActionsValidation = false; /** - * Tax data + * Catalog data * - * @var \Magento\Tax\Helper\Data|null + * @var \Magento\Catalog\Helper\Data|null */ - protected $_taxData = null; + protected $_catalogData = null; /** * @var \Magento\SalesRule\Model\Resource\Rule\CollectionFactory @@ -95,7 +95,7 @@ class Validator extends \Magento\Framework\Model\AbstractModel * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry * @param Resource\Rule\CollectionFactory $collectionFactory - * @param \Magento\Tax\Helper\Data $taxData + * @param \Magento\Catalog\Helper\Data $catalogData * @param Utility $utility * @param RulesApplier $rulesApplier * @param \Magento\Framework\Model\Resource\AbstractResource $resource @@ -106,7 +106,7 @@ class Validator extends \Magento\Framework\Model\AbstractModel \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\SalesRule\Model\Resource\Rule\CollectionFactory $collectionFactory, - \Magento\Tax\Helper\Data $taxData, + \Magento\Catalog\Helper\Data $catalogData, \Magento\SalesRule\Model\Utility $utility, \Magento\SalesRule\Model\RulesApplier $rulesApplier, \Magento\Framework\Model\Resource\AbstractResource $resource = null, @@ -114,7 +114,7 @@ class Validator extends \Magento\Framework\Model\AbstractModel array $data = array() ) { $this->_collectionFactory = $collectionFactory; - $this->_taxData = $taxData; + $this->_catalogData = $catalogData; $this->validatorUtility = $utility; $this->rulesApplier = $rulesApplier; parent::__construct($context, $registry, $resource, $resourceCollection, $data); @@ -391,7 +391,7 @@ class Validator extends \Magento\Framework\Model\AbstractModel */ public function getItemOriginalPrice($item) { - return $this->_taxData->getPrice($item, $item->getOriginalPrice(), true); + return $this->_catalogData->getTaxPrice($item, $item->getOriginalPrice(), true); } /** @@ -414,7 +414,7 @@ class Validator extends \Magento\Framework\Model\AbstractModel */ public function getItemBaseOriginalPrice($item) { - return $this->_taxData->getPrice($item, $item->getBaseOriginalPrice(), true); + return $this->_catalogData->getTaxPrice($item, $item->getBaseOriginalPrice(), true); } /** diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index 5c5e2f7a78711b96a727e05619e51bdaffe1ac55..669dc21cf2938883d39969b73acbae99db996f3b 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -3,27 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-rule": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-shipping": "0.1.0-alpha90", - "magento/module-payment": "0.1.0-alpha90", - "magento/module-reports": "0.1.0-alpha90", - "magento/module-catalog-rule": "0.1.0-alpha90", - "magento/module-widget": "0.1.0-alpha90", - "magento/module-cron": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-rule": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-shipping": "0.1.0-alpha91", + "magento/module-payment": "0.1.0-alpha91", + "magento/module-reports": "0.1.0-alpha91", + "magento/module-catalog-rule": "0.1.0-alpha91", + "magento/module-widget": "0.1.0-alpha91", + "magento/module-cron": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/SalesRule/etc/module.xml b/app/code/Magento/SalesRule/etc/module.xml index 0d241d2a8da1a7ad39f1c7aa996bade106c1e1e6..64ccddb8b010d0e0c657c811680edbec08da1e2c 100644 --- a/app/code/Magento/SalesRule/etc/module.xml +++ b/app/code/Magento/SalesRule/etc/module.xml @@ -37,7 +37,6 @@ <module name="Magento_Sales"/> <module name="Magento_Eav"/> <module name="Magento_Core"/> - <module name="Magento_Tax"/> <module name="Magento_Backend"/> <module name="Magento_Customer"/> <module name="Magento_Directory"/> diff --git a/app/code/Magento/Sendfriend/composer.json b/app/code/Magento/Sendfriend/composer.json index 2f7f51b67ec1f7be1769c55de4ba0d05dcd8d3ad..81cc667f62ecb837b09b48a14799c9eec0c55271 100644 --- a/app/code/Magento/Sendfriend/composer.json +++ b/app/code/Magento/Sendfriend/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json index fc4e89cab74e3c8229bcc688252398ae772d2001..422520ed3e1dc594ac6f04600bc121602ce5c69c 100644 --- a/app/code/Magento/Shipping/composer.json +++ b/app/code/Magento/Shipping/composer.json @@ -3,23 +3,23 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-contact": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-payment": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-contact": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-payment": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "ext-gd": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json index 11958116c049bc193031121304199fa48ed4a328..e96bf61d3d7c6e1bbbc7d3c3dad179e0dc9869c0 100644 --- a/app/code/Magento/Sitemap/composer.json +++ b/app/code/Magento/Sitemap/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-cms": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-cms": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json index 47e2308ae586d8f63f9320e6100ec82c2538ed5f..e258117055980e8cea97b32bd80e27aaa0dcbbac 100644 --- a/app/code/Magento/Store/composer.json +++ b/app/code/Magento/Store/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-core": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-index": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-core": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-index": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Tax/Block/Checkout/Cart/Sidebar/Totals.php b/app/code/Magento/Tax/Block/Checkout/Cart/Sidebar/Totals.php new file mode 100644 index 0000000000000000000000000000000000000000..37886ded4b90ee6430bc852a4f115f80c9aef623 --- /dev/null +++ b/app/code/Magento/Tax/Block/Checkout/Cart/Sidebar/Totals.php @@ -0,0 +1,146 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Tax\Block\Checkout\Cart\Sidebar; + +use Magento\Checkout\Block\Cart\Sidebar\Totals as SidebarTotals; + +/** + * Block for displaying totals in sidebar + */ +class Totals extends SidebarTotals +{ + /** + * Tax data + * + * @var \Magento\Tax\Helper\Data + */ + protected $_taxData; + + /** + * @var \Magento\Tax\Model\Config + */ + protected $_taxConfig; + + /** + * @param \Magento\Framework\View\Element\Template\Context $context + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Customer\Model\Session $customerSession + * @param \Magento\Checkout\Model\Session $checkoutSession + * @param \Magento\Tax\Helper\Data $taxHelper + * @param \Magento\Tax\Model\Config $taxConfig + * @param array $data + */ + public function __construct( + \Magento\Framework\View\Element\Template\Context $context, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Customer\Model\Session $customerSession, + \Magento\Checkout\Model\Session $checkoutSession, + \Magento\Tax\Helper\Data $taxHelper, + \Magento\Tax\Model\Config $taxConfig, + array $data = array() + ) { + $this->_taxData = $taxHelper; + $this->_taxConfig = $taxConfig; + parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $data); + } + + /** + * Get subtotal, including tax. + * + * @return float + */ + public function getSubtotalInclTax() + { + $subtotal = 0; + $totals = $this->getTotals(); + if (isset($totals['subtotal'])) { + $subtotal = $totals['subtotal']->getValueInclTax(); + if (!$subtotal) { + $subtotal = $totals['subtotal']->getValue(); + } + } + + return $subtotal; + } + + /** + * Get subtotal, excluding tax. + * + * @return float + */ + public function getSubtotalExclTax() + { + $subtotal = 0; + $totals = $this->getTotals(); + if (isset($totals['subtotal'])) { + $subtotal = $totals['subtotal']->getValueExclTax(); + if (!$subtotal) { + $subtotal = $totals['subtotal']->getValue(); + } + } + return $subtotal; + } + + /** + * Return whether subtotal should be displayed including tax + * + * @return bool + */ + public function getDisplaySubtotalInclTax() + { + return $this->_taxConfig->displayCartSubtotalInclTax(); + } + + /** + * Return whether subtotal should be displayed excluding tax + * + * @return bool + */ + public function getDisplaySubtotalExclTax() + { + return $this->_taxConfig->displayCartSubtotalExclTax(); + } + + /** + * Return whether subtotal should be displayed excluding and including tax + * + * @return bool + */ + public function getDisplaySubtotalBoth() + { + return $this->_taxConfig->displayCartSubtotalBoth(); + } + + /** + * Get incl/excl tax label + * + * @param bool $flag + * @return string + */ + public function getIncExcTaxLabel($flag) + { + $text = $this->_taxData->getIncExcText($flag); + return $text ? ' (' . $text . ')' : ''; + } +} diff --git a/app/code/Magento/Tax/Block/Checkout/Shipping/Price.php b/app/code/Magento/Tax/Block/Checkout/Shipping/Price.php new file mode 100644 index 0000000000000000000000000000000000000000..10d61a940b67eb69ce5bcf42c6f1d6ec152fb48c --- /dev/null +++ b/app/code/Magento/Tax/Block/Checkout/Shipping/Price.php @@ -0,0 +1,119 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Tax\Block\Checkout\Shipping; + +use Magento\Sales\Model\Quote\Address\Rate; +use Magento\Checkout\Block\Cart\AbstractCart; + +class Price extends \Magento\Checkout\Block\Shipping\Price +{ + /** + * @var \Magento\Tax\Helper\Data + */ + protected $taxHelper; + + /** + * @param \Magento\Framework\View\Element\Template\Context $context + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Customer\Model\Session $customerSession + * @param \Magento\Checkout\Model\Session $checkoutSession + * @param \Magento\Tax\Helper\Data $taxHelper + * @param array $data + */ + public function __construct( + \Magento\Framework\View\Element\Template\Context $context, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Customer\Model\Session $customerSession, + \Magento\Checkout\Model\Session $checkoutSession, + \Magento\Tax\Helper\Data $taxHelper, + array $data = array() + ) { + $this->taxHelper = $taxHelper; + parent::__construct( + $context, + $catalogData, + $customerSession, + $checkoutSession, + $data + ); + } + + /** + * Get Shipping Price including or excluding tax + * + * @param bool $flag + * @return float + */ + protected function getShippingPriceWithFlag($flag) + { + $price = $this->taxHelper->getShippingPrice( + $this->getShippingRate()->getPrice(), + $flag, + $this->getAddress(), + $this->getQuote()->getCustomerTaxClassId() + ); + + return $this->getQuote()->getStore()->convertPrice($price, true); + } + + /** + * Get shipping price excluding tax + * + * @return float + */ + public function getShippingPriceExclTax() + { + return $this->getShippingPriceWithFlag(false); + } + + /** + * Get shipping price including tax + * + * @return float + */ + public function getShippingPriceInclTax() + { + return $this->getShippingPriceWithFlag(true); + } + + /** + * Return flag whether to display shipping price including tax + * + * @return bool + */ + public function displayShippingPriceInclTax() + { + return $this->taxHelper->displayShippingPriceIncludingTax(); + } + + /** + * Return flag whether to display shipping price including and excluding tax + * + * @return bool + */ + public function displayShippingBothPrices() + { + return $this->taxHelper->displayShippingBothPrices(); + } +} diff --git a/app/code/Magento/Tax/Block/Item/Price/Renderer.php b/app/code/Magento/Tax/Block/Item/Price/Renderer.php new file mode 100644 index 0000000000000000000000000000000000000000..278de31027faf2aac38ee6f7096c6307e6d37b37 --- /dev/null +++ b/app/code/Magento/Tax/Block/Item/Price/Renderer.php @@ -0,0 +1,83 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Tax\Block\Item\Price; + +use Magento\Tax\Helper\Data as TaxHelper; +use Magento\Framework\View\Element\Template\Context; + +/** + * Item price render block + * + * @author Magento Core Team <core@magentocommerce.com> + */ +class Renderer extends \Magento\Checkout\Block\Item\Price\Renderer +{ + /** + * @var \Magento\Tax\Helper\Data + */ + protected $taxHelper; + + /** + * Constructor + * + * @param Context $context + * @param TaxHelper $taxHelper + * @param array $data + */ + public function __construct(Context $context, TaxHelper $taxHelper, array $data = array()) + { + $this->taxHelper = $taxHelper; + parent::__construct($context, $data); + } + + /** + * Return whether display setting is to display price including tax + * + * @return bool + */ + public function displayPriceInclTax() + { + return $this->taxHelper->displayCartPriceInclTax(); + } + + /** + * Return whether display setting is to display price excluding tax + * + * @return bool + */ + public function displayPriceExclTax() + { + return $this->taxHelper->displayCartPriceExclTax(); + } + + /** + * Return whether display setting is to display both price including tax and price excluding tax + * + * @return bool + */ + public function displayBothPrices() + { + return $this->taxHelper->displayCartBothPrices(); + } +} diff --git a/app/code/Magento/Tax/Helper/Data.php b/app/code/Magento/Tax/Helper/Data.php index cb42eb2640016c711f9ebf68c6bc4fce68c8b317..f53c288c487d5f17d5e15a56125a5cda5e233951 100644 --- a/app/code/Magento/Tax/Helper/Data.php +++ b/app/code/Magento/Tax/Helper/Data.php @@ -39,16 +39,6 @@ use Magento\Customer\Model\Session as CustomerSession; */ class Data extends \Magento\Framework\App\Helper\AbstractHelper { - /** - * Price conversion constant for positive - */ - const PRICE_CONVERSION_PLUS = 1; - - /** - * Price conversion constant for negative - */ - const PRICE_CONVERSION_MINUS = 2; - /** * Default tax class for customers */ @@ -164,6 +154,13 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper */ protected $taxClassKeyBuilder; + /** + * \Magento\Catalog\Helper\Data + * + * @var CatalogHelper + */ + protected $catalogHelper; + /** * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Core\Helper\Data $coreData @@ -182,6 +179,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper * @param TaxCalculationServiceInterface $taxCalculationService * @param CustomerSession $customerSession * @param AddressConverter $addressConverter + * @param \Magento\Catalog\Helper\Data $catalogHelper */ public function __construct( \Magento\Framework\App\Helper\Context $context, @@ -200,7 +198,8 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper TaxClassKeyBuilder $taxClassKeyBuilder, TaxCalculationServiceInterface $taxCalculationService, CustomerSession $customerSession, - AddressConverter $addressConverter + AddressConverter $addressConverter, + \Magento\Catalog\Helper\Data $catalogHelper ) { parent::__construct($context); $this->_scopeConfig = $scopeConfig; @@ -219,6 +218,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper $this->taxCalculationService = $taxCalculationService; $this->customerSession = $customerSession; $this->addressConverter = $addressConverter; + $this->catalogHelper = $catalogHelper; } /** @@ -320,35 +320,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper */ public function needPriceConversion($store = null) { - $res = false; - if ($this->priceIncludesTax($store)) { - switch ($this->getPriceDisplayType($store)) { - case Config::DISPLAY_TYPE_EXCLUDING_TAX: - case Config::DISPLAY_TYPE_BOTH: - return self::PRICE_CONVERSION_MINUS; - case Config::DISPLAY_TYPE_INCLUDING_TAX: - $res = true; - break; - default: - break; - } - } else { - switch ($this->getPriceDisplayType($store)) { - case Config::DISPLAY_TYPE_INCLUDING_TAX: - case Config::DISPLAY_TYPE_BOTH: - return self::PRICE_CONVERSION_PLUS; - case Config::DISPLAY_TYPE_EXCLUDING_TAX: - $res = false; - break; - default: - break; - } - } - - if ($res === false) { - $res = $this->displayTaxColumn(); - } - return $res; + return $this->_config->needPriceConversion($store); } /** @@ -499,151 +471,6 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper return $this->_coreData->jsonEncode($priceFormat); } - /** - * Get unrounded product price - * - * @param \Magento\Catalog\Model\Product $product - * @param float $price inputed product price - * @param bool $includingTax return price include tax flag - * @param null|Address $shippingAddress - * @param null|Address $billingAddress - * @param null|int $ctc customer tax class - * @param null|string|bool|int|Store $store - * @param bool $priceIncludesTax flag what price parameter contain tax - * @return float - */ - public function getPriceUnrounded( - $product, - $price, - $includingTax = null, - $shippingAddress = null, - $billingAddress = null, - $ctc = null, - $store = null, - $priceIncludesTax = null - ) { - return $this->getPrice( - $product, - $price, - $includingTax, - $shippingAddress, - $billingAddress, - $ctc, - $store, - $priceIncludesTax, - false - ); - } - - /** - * Get product price with all tax settings processing - * - * @param \Magento\Catalog\Model\Product $product - * @param float $price inputed product price - * @param bool $includingTax return price include tax flag - * @param null|Address $shippingAddress - * @param null|Address $billingAddress - * @param null|int $ctc customer tax class - * @param null|string|bool|int|Store $store - * @param bool $priceIncludesTax flag what price parameter contain tax - * @param bool $roundPrice - * @return float - */ - public function getPrice( - $product, - $price, - $includingTax = null, - $shippingAddress = null, - $billingAddress = null, - $ctc = null, - $store = null, - $priceIncludesTax = null, - $roundPrice = true - ) { - if (!$price) { - return $price; - } - - $store = $this->_storeManager->getStore($store); - if ($this->needPriceConversion($store)) { - if (is_null($priceIncludesTax)) { - $priceIncludesTax = $this->priceIncludesTax($store); - } - - $shippingAddressDataObject = null; - if ($shippingAddress instanceof \Magento\Customer\Model\Address\AbstractAddress) { - $shippingAddressDataObject = $this->addressConverter->createAddressFromModel( - $shippingAddress, - null, - null - ); - } - - $billingAddressDataObject = null; - if ($billingAddress instanceof \Magento\Customer\Model\Address\AbstractAddress) { - $billingAddressDataObject = $this->addressConverter->createAddressFromModel( - $billingAddress, - null, - null - ); - } - - $item = $this->quoteDetailsItemBuilder->setQuantity(1) - ->setCode($product->getSku()) - ->setShortDescription($product->getShortDescription()) - ->setTaxClassKey( - $this->taxClassKeyBuilder->setType(TaxClassKey::TYPE_ID) - ->setValue($product->getTaxClassId())->create() - )->setTaxIncluded($priceIncludesTax) - ->setType('product') - ->setUnitPrice($price) - ->create(); - $quoteDetails = $this->quoteDetailsBuilder - ->setShippingAddress($shippingAddressDataObject) - ->setBillingAddress($billingAddressDataObject) - ->setCustomerTaxClassKey( - $this->taxClassKeyBuilder->setType(TaxClassKey::TYPE_ID) - ->setValue($ctc)->create() - )->setItems([$item]) - ->setCustomerId($this->customerSession->getCustomerId()) - ->create(); - - $storeId = null; - if ($store) { - $storeId = $store->getId(); - } - $taxDetails = $this->taxCalculationService->calculateTax($quoteDetails, $storeId); - $items = $taxDetails->getItems(); - $taxDetailsItem = array_shift($items); - - if (!is_null($includingTax)) { - if ($includingTax) { - $price = $taxDetailsItem->getPriceInclTax(); - } else { - $price = $taxDetailsItem->getPrice(); - } - } else { - switch ($this->getPriceDisplayType($store)) { - case Config::DISPLAY_TYPE_EXCLUDING_TAX: - case Config::DISPLAY_TYPE_BOTH: - $price = $taxDetailsItem->getPrice(); - break; - case Config::DISPLAY_TYPE_INCLUDING_TAX: - $price = $taxDetailsItem->getPriceInclTax(); - break; - default: - break; - } - } - } - - if ($roundPrice) { - return $store->roundPrice($price); - } else { - return $price; - } - } - /** * Check if we have display in catalog prices including tax * @@ -770,7 +597,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper $billingAddress = $shippingAddress->getQuote()->getBillingAddress(); } - $price = $this->getPrice( + $price = $this->catalogHelper->getTaxPrice( $pseudoProduct, $price, $includingTax, diff --git a/app/code/Magento/Tax/Model/Config.php b/app/code/Magento/Tax/Model/Config.php index e338e2d86e1018b89aae03b02155148a8f0ce3c6..884545512016a707ec7ff3a3fdfb23f64ff6ca88 100644 --- a/app/code/Magento/Tax/Model/Config.php +++ b/app/code/Magento/Tax/Model/Config.php @@ -116,6 +116,16 @@ class Config const DISPLAY_TYPE_BOTH = 3; + /** + * Price conversion constant for positive + */ + const PRICE_CONVERSION_PLUS = 1; + + /** + * Price conversion constant for negative + */ + const PRICE_CONVERSION_MINUS = 2; + /** * @var bool|null */ @@ -801,4 +811,45 @@ class Config $store ); } + + /** + * Check if necessary do product price conversion + * If it necessary will be returned conversion type (minus or plus) + * + * @param null|int|string|Store $store + * @return bool + */ + public function needPriceConversion($store = null) + { + $res = false; + $priceIncludesTax = $this->priceIncludesTax($store) || $this->getNeedUseShippingExcludeTax(); + if ($priceIncludesTax) { + switch ($this->getPriceDisplayType($store)) { + case self::DISPLAY_TYPE_EXCLUDING_TAX: + case self::DISPLAY_TYPE_BOTH: + return self::PRICE_CONVERSION_MINUS; + case self::DISPLAY_TYPE_INCLUDING_TAX: + $res = true; + break; + default: + break; + } + } else { + switch ($this->getPriceDisplayType($store)) { + case self::DISPLAY_TYPE_INCLUDING_TAX: + case self::DISPLAY_TYPE_BOTH: + return self::PRICE_CONVERSION_PLUS; + case self::DISPLAY_TYPE_EXCLUDING_TAX: + $res = false; + break; + default: + break; + } + } + + if ($res === false) { + $res = $this->displayCartPricesBoth(); + } + return $res; + } } diff --git a/app/code/Magento/Tax/Pricing/Adjustment.php b/app/code/Magento/Tax/Pricing/Adjustment.php index edd8467edf5e0a91267b1721929be69735d04c17..2497c1da400608689c44e0024cf59faf1a6d8498 100644 --- a/app/code/Magento/Tax/Pricing/Adjustment.php +++ b/app/code/Magento/Tax/Pricing/Adjustment.php @@ -43,6 +43,13 @@ class Adjustment implements AdjustmentInterface */ protected $taxHelper; + /** + * \Magento\Catalog\Helper\Data + * + * @var CatalogHelper + */ + protected $catalogHelper; + /** * @var int|null */ @@ -50,11 +57,13 @@ class Adjustment implements AdjustmentInterface /** * @param TaxHelper $taxHelper - * @param int $sortOrder + * @param \Magento\Catalog\Helper\Data $catalogHelper + * @param int|null $sortOrder */ - public function __construct(TaxHelper $taxHelper, $sortOrder = null) + public function __construct(TaxHelper $taxHelper, \Magento\Catalog\Helper\Data $catalogHelper, $sortOrder = null) { $this->taxHelper = $taxHelper; + $this->catalogHelper = $catalogHelper; $this->sortOrder = $sortOrder; } @@ -98,7 +107,17 @@ class Adjustment implements AdjustmentInterface public function extractAdjustment($amount, SaleableInterface $saleableItem) { if ($this->taxHelper->priceIncludesTax()) { - $adjustedAmount = $this->taxHelper->getPriceUnrounded($saleableItem, $amount); + $adjustedAmount = $this->catalogHelper->getTaxPrice( + $saleableItem, + $amount, + false, + null, + null, + null, + null, + null, + false + ); $result = $amount - $adjustedAmount; } else { $result = 0.; @@ -116,7 +135,17 @@ class Adjustment implements AdjustmentInterface public function applyAdjustment($amount, SaleableInterface $saleableItem) { $includingTax = !$this->taxHelper->priceIncludesTax(); - return $this->taxHelper->getPriceUnrounded($saleableItem, $amount, $includingTax); + return $this->catalogHelper->getTaxPrice( + $saleableItem, + $amount, + $includingTax, + null, + null, + null, + null, + null, + false + ); } /** diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json index c8aeb245caa5075a399754658967c68bc3195b48..965f34bc6c6869d23c3d1867ffc1298229afd016 100644 --- a/app/code/Magento/Tax/composer.json +++ b/app/code/Magento/Tax/composer.json @@ -3,24 +3,24 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-shipping": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-reports": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-configurable-product": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-shipping": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-reports": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-configurable-product": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml new file mode 100644 index 0000000000000000000000000000000000000000..58f761eb8bfd72d5e146323f593ffd720e42bdaf --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="minicart"> + <block class="Magento\Tax\Block\Item\Price\Renderer" name="checkout.cart.item.price.sidebar" template="Magento_Tax::checkout/cart/item/price/sidebar.phtml"/> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml new file mode 100644 index 0000000000000000000000000000000000000000..f0228cef99661c01b23d133c24628478f6c4cdae --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_cart_sidebar_total_renderers.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="minicart"> + <block class="Magento\Tax\Block\Checkout\Cart\Sidebar\Totals" name="checkout.cart.minicart.totals" template="Magento_Tax::checkout/cart/minicart/totals.phtml"/> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_item_price_renderers.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_item_price_renderers.xml new file mode 100644 index 0000000000000000000000000000000000000000..704ad0daf234a7b4b34ce4fbf7a557d5a28c2740 --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_item_price_renderers.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <block class="Magento\Tax\Block\Item\Price\Renderer" name="checkout.item.price.unit" template="Magento_Tax::item/price/unit.phtml"/> + <block class="Magento\Tax\Block\Item\Price\Renderer" name="checkout.item.price.row" template="Magento_Tax::item/price/row.phtml"/> +</layout> + diff --git a/app/code/Magento/Tax/view/frontend/layout/checkout_shipping_price_renderer.xml b/app/code/Magento/Tax/view/frontend/layout/checkout_shipping_price_renderer.xml new file mode 100644 index 0000000000000000000000000000000000000000..60ff63f42601c9e3d7c42c0138963802db25195e --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/layout/checkout_shipping_price_renderer.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <block class="Magento\Tax\Block\Checkout\Shipping\Price" name="checkout.shipping.price" as="shipping.price" template="Magento_Tax::checkout/shipping/price.phtml"/> +</layout> + diff --git a/app/code/Magento/Tax/view/frontend/templates/checkout/cart/item/price/sidebar.phtml b/app/code/Magento/Tax/view/frontend/templates/checkout/cart/item/price/sidebar.phtml new file mode 100644 index 0000000000000000000000000000000000000000..79e3ace12517cfb43e30f38591e7b89800ed92e2 --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/templates/checkout/cart/item/price/sidebar.phtml @@ -0,0 +1,51 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Tax\Block\Item\Price\Renderer */ +?> +<?php $_item = $this->getItem() ?> +<div class="pricing details<?php echo $this->displayBothPrices() ? ' complex' : ''; ?>"> +<?php if ($this->displayPriceExclTax() || $this->displayBothPrices()): ?> + <div class="rate"> + <?php if ($this->displayBothPrices()): ?> + <span class="label excl tax"><?php echo __('Excl. Tax'); ?></span> + <?php else: ?> + <span class="label display"><?php echo __('Price'); ?></span> + <?php endif; ?> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> + <?php endif; ?> + </div> + + <?php if ($this->displayPriceInclTax() || $this->displayBothPrices()): ?> + <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> + <div class="rate"> + <?php if ($this->displayBothPrices()): ?> + <span class="label tax incl"><?php echo __('Incl. Tax'); ?></span> + <?php else: ?> + <span class="label display"><?php echo __('Price'); ?></span> + <?php endif; ?> + <span class="value display"><?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl) ?></span> + </div> +<?php endif; ?> +</div> diff --git a/app/code/Magento/Tax/view/frontend/templates/checkout/cart/minicart/totals.phtml b/app/code/Magento/Tax/view/frontend/templates/checkout/cart/minicart/totals.phtml new file mode 100644 index 0000000000000000000000000000000000000000..7233ae8212ba524704b8377f896bc15e56ebb1d0 --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/templates/checkout/cart/minicart/totals.phtml @@ -0,0 +1,40 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this Magento\Tax\Block\Checkout\Cart\Sidebar\Totals */ +?> + +<div class="amount"> + <?php if ($this->getDisplaySubtotalExclTax()): ?> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->getSubtotalExclTax()); ?> + <?php elseif ($this->getDisplaySubtotalInclTax()): ?> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->getSubtotalInclTax()); ?> + <?php else: ?> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->getSubtotalExclTax()); ?> + <span class="amount incl tax"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($this->getSubtotalInclTax()) ?> + <?php echo $this->getIncExcTaxLabel(true) ?> + </span> + <?php endif; ?> +</div> diff --git a/app/code/Magento/Tax/view/frontend/templates/checkout/shipping/price.phtml b/app/code/Magento/Tax/view/frontend/templates/checkout/shipping/price.phtml new file mode 100644 index 0000000000000000000000000000000000000000..58246b11f91398d2458ddf40b08e0cf8f1a0b782 --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/templates/checkout/shipping/price.phtml @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php /** @var $this \Magento\Tax\Block\Checkout\Shipping\Price */ ?> + +<?php $_excl = $this->getShippingPriceExclTax(); ?> +<?php $_incl = $this->getShippingPriceInclTax(); ?> +<?php if ($this->displayShippingPriceInclTax()): ?> + <?php echo $_incl; ?> +<?php else: ?> + <?php echo $_excl; ?> +<?php endif; ?> +<?php if ($this->displayShippingBothPrices() && $_incl != $_excl): ?> + (<?php echo __('Incl. Tax'); ?> <?php echo $_incl; ?>) +<?php endif; ?> diff --git a/app/code/Magento/Tax/view/frontend/templates/item/price/row.phtml b/app/code/Magento/Tax/view/frontend/templates/item/price/row.phtml new file mode 100644 index 0000000000000000000000000000000000000000..59506d4369b624aeca6eae326377e215096afc74 --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/templates/item/price/row.phtml @@ -0,0 +1,43 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Tax\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +?> +<?php if (($this->displayPriceInclTax() || $this->displayBothPrices()) && !$_item->getNoSubtotal()): ?> + <span class="incl tax" data-th="<?php echo $this->escapeHtml(__('Incl. Tax'));?>"> + <span class="cart price"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotalInclTax()) ?> + </span> + </span> +<?php endif; ?> + +<?php if (($this->displayPriceExclTax() || $this->displayBothPrices()) && !$_item->getNoSubtotal()): ?> + <span class="excl tax" data-th="<?php echo $this->escapeHtml(__('Excl. Tax'));?>"> + <span class="cart price"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getRowTotal()) ?> + </span> + </span> +<?php endif; ?> diff --git a/app/code/Magento/Tax/view/frontend/templates/item/price/unit.phtml b/app/code/Magento/Tax/view/frontend/templates/item/price/unit.phtml new file mode 100644 index 0000000000000000000000000000000000000000..0e55d449a60c2ac1d025878ee5eae9e2ed6da087 --- /dev/null +++ b/app/code/Magento/Tax/view/frontend/templates/item/price/unit.phtml @@ -0,0 +1,45 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Tax\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +?> + +<?php if ($this->displayPriceInclTax() || $this->displayBothPrices()): ?> + <span class="incl tax" data-th="<?php echo $this->escapeHtml(__('Incl. Tax')); ?>"> + <?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?> + <span class="cart price"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl) ?> + </span> + </span> +<?php endif; ?> + +<?php if ($this->displayPriceExclTax() || $this->displayBothPrices()): ?> + <span class="excl tax" data-th="<?php echo $this->escapeHtml(__('Excl. Tax')); ?>"> + <span class="cart price"> + <?php echo $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?> + </span> + </span> +<?php endif; ?> diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index d67905d325bd8ec862ca5e213f2426bd17789149..4fe9b958cc444f8bae5896186e7c0db42fddc2bd 100644 --- a/app/code/Magento/Theme/composer.json +++ b/app/code/Magento/Theme/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-cms": "0.1.0-alpha90", - "magento/module-translation": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-cms": "0.1.0-alpha91", + "magento/module-translation": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Translation/Model/Inline/Parser.php b/app/code/Magento/Translation/Model/Inline/Parser.php index fb8e5baeac5d1165d46f6a2ef56d676f1bb0827e..1c809410bd47d09982b354ae4dec6e3afceda6d2 100644 --- a/app/code/Magento/Translation/Model/Inline/Parser.php +++ b/app/code/Magento/Translation/Model/Inline/Parser.php @@ -384,8 +384,7 @@ class Parser implements \Magento\Framework\Translate\Inline\ParserInterface 'shown' => $matches[1][0], 'translated' => $matches[2][0], 'original' => $matches[3][0], - 'location' => call_user_func($locationCallback, $matches, $options), - 'scope' => $matches[4][0] + 'location' => call_user_func($locationCallback, $matches, $options) ) ); $text = substr_replace($text, $matches[1][0], $matches[0][1], strlen($matches[0][0])); diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index 400b266e4c57e7b2b550bbd082cd3ca1188e2152..b15810ed78a48bf961f2ddc3f53c1422e4cd0807 100644 --- a/app/code/Magento/Translation/composer.json +++ b/app/code/Magento/Translation/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-core": "0.1.0-alpha90", - "magento/module-store": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-core": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Translation/view/adminhtml/templates/translate_inline.phtml b/app/code/Magento/Translation/view/adminhtml/templates/translate_inline.phtml index 246c199447179c8f7815bd9efc9aaef5edcac01f..64860327bbd67a65166fddbe5364ef8b4478298c 100644 --- a/app/code/Magento/Translation/view/adminhtml/templates/translate_inline.phtml +++ b/app/code/Magento/Translation/view/adminhtml/templates/translate_inline.phtml @@ -49,7 +49,7 @@ <tr> <th class="label"><label for="custom_${i}">Custom:</label></th> <td class="value"> - <input name="translate[${i}][original]" type="hidden" value="${item.scope}::${escape(item.original)}"/> + <input name="translate[${i}][original]" type="hidden" value="${escape(item.original)}"/> <input id="custom_${i}" name="translate[${i}][custom]" class="input-text" value="${escape(item.translated)}" /> </td> </tr> diff --git a/app/code/Magento/Translation/view/frontend/templates/translate_inline.phtml b/app/code/Magento/Translation/view/frontend/templates/translate_inline.phtml index 1e6c22653e173535ed62b9532a37143282f3c21d..3b3e35cd9808760906690b1b3277286147b97d98 100644 --- a/app/code/Magento/Translation/view/frontend/templates/translate_inline.phtml +++ b/app/code/Magento/Translation/view/frontend/templates/translate_inline.phtml @@ -23,16 +23,17 @@ */ ?> +<link rel="stylesheet" type="text/css" href="<?php echo $this->getViewFileUrl('prototype/windows/themes/default.css') ?>"/> <link rel="stylesheet" type="text/css" href="<?php echo $this->getViewFileUrl('Magento_Core::prototype/magento.css') ?>"/> <link rel="stylesheet" type="text/css" href="<?php echo $this->getViewFileUrl('mage/translate-inline.css') ?>"/> <script id="translate-inline-icon" type="text/x-jQuery-tmpl"> - <span class="action translate"></span> + <img src="${img}" height="16" width="16" class="translate-edit-icon"> </script> <script id="translate-form-template" type="text/x-jquery-tmpl"> <form id="${id}"> {{each(i, item) items}} - <div class="data table translate"><table cellspacing="0"> + <div class="magento_table_container"><table cellspacing="0"> {{each item}} <tr> <th class="label" style="text-transform: capitalize;">${$index}:</th> @@ -40,15 +41,16 @@ </tr> {{/each}} <tr> - <th class="label"><label for="custom_${i}">Custom:</label></th> + <th class="label"><label for="perstore_${i}">Store View Specific:</label></th> <td class="value"> - <input name="translate[${i}][original]" type="hidden" value="${item.scope}::${escape(item.original)}"/> - <input id="custom_${i}" name="translate[${i}][custom]" class="input-text" value="${escape(item.translated)}" /> + <input id="perstore_${i}" name="translate[${i}][perstore]" type="checkbox" value="1"/> </td> </tr> <tr> - <td colspan="2"> - <label for="perstore_${i}"><input id="perstore_${i}" name="translate[${i}][perstore]" type="checkbox" value="1"/> Store View Specific</label> + <th class="label"><label for="custom_${i}">Custom:</label></th> + <td class="value"> + <input name="translate[${i}][original]" type="hidden" value="${escape(item.original)}"/> + <input id="custom_${i}" name="translate[${i}][custom]" class="input-text" value="${escape(item.translated)}" /> </td> </tr> </table></div> @@ -57,13 +59,15 @@ {{if message}}<p class="a-center accent">${message}</p>{{/if}} </script> -<div data-role="translate-dialog" data-mage-init='{"translateInline":{"ajaxUrl":"<?php echo $this->getAjaxUrl() ?>"}, "loader": {}}'></div> +<div data-role="translate-dialog" + data-mage-init='{"translateInline":{"ajaxUrl":"<?php echo $this->getAjaxUrl() ?>"},"loader":{}}'></div> <script type="text/javascript"> require([ "jquery", "mage/edit-trigger", "mage/translate-inline" ], function($){ - $('body').editTrigger({alwaysShown:true, singleElement:false}).addClass('trnslate-inline-area'); + $('body').editTrigger({img: '<?php echo $this->getViewFileUrl('Magento_Core::fam_book_open.png') ?>', alwaysShown:true, singleElement:false}); + $('body').addClass('trnslate-inline-area'); }); </script> diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json index 19eded9e99926f83e2e41e47a5a1fb14ade7b07d..e22b920d2edb176d3bc05fca0386cfae92630f58 100644 --- a/app/code/Magento/Ups/composer.json +++ b/app/code/Magento/Ups/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-shipping": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-shipping": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/UrlRedirect/composer.json b/app/code/Magento/UrlRedirect/composer.json index 6a171dcaeebec1d02fe22405c1aa6d33da9ff045..619f506112066464ce79a3b7ca87071ccdecc9d4 100644 --- a/app/code/Magento/UrlRedirect/composer.json +++ b/app/code/Magento/UrlRedirect/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-cms": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-install": "0.1.0-alpha90", - "magento/module-store": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90" + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-cms": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-install": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json index ddbfb0b15707f214e9220da8e2fe33f07d53cd92..e609b938b0cf6f59eea5ec8c9e1eca06f0782849 100644 --- a/app/code/Magento/UrlRewrite/composer.json +++ b/app/code/Magento/UrlRewrite/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-store": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json index e33b331681524124fe6b24d4dcbac88fb1a79828..05bd790e0d313f4103d61424e1f350f9a47ba388 100644 --- a/app/code/Magento/User/composer.json +++ b/app/code/Magento/User/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-authorization": "0.1.0-alpha90", - "magento/module-store": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-integration": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-authorization": "0.1.0-alpha91", + "magento/module-store": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-integration": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index 373b6e91de3af510678e109139117a1a1b8c854b..b52ac78c7cbcf25d0f505757e1bf6fcd345460c1 100644 --- a/app/code/Magento/Usps/composer.json +++ b/app/code/Magento/Usps/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-shipping": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-shipping": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json index 266cfd75b83bbf04ed2db0fd1cd650b82f77f107..d9f70c2a1ee994ada7b76f76ce2e36231bfb0209 100644 --- a/app/code/Magento/Webapi/composer.json +++ b/app/code/Magento/Webapi/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-authorization": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-integration": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-user": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-authorization": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-integration": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-user": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Weee/Block/Item/Price/Renderer.php b/app/code/Magento/Weee/Block/Item/Price/Renderer.php new file mode 100644 index 0000000000000000000000000000000000000000..b9731673b3213b00e8ee5d9c075987b5923e3d61 --- /dev/null +++ b/app/code/Magento/Weee/Block/Item/Price/Renderer.php @@ -0,0 +1,267 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Weee\Block\Item\Price; + +use Magento\Weee\Model\Tax as WeeeDisplayConfig; +use Magento\Framework\Pricing\PriceCurrencyInterface; + +/** + * Item price render block + * + * @author Magento Core Team <core@magentocommerce.com> + */ +class Renderer extends \Magento\Tax\Block\Item\Price\Renderer +{ + /** + * @var \Magento\Weee\Helper\Data + */ + protected $weeeHelper; + + /** + * @var \Magento\Framework\Pricing\PriceCurrencyInterface + */ + protected $priceCurrency; + + /** + * @param \Magento\Framework\View\Element\Template\Context $context + * @param \Magento\Tax\Helper\Data $taxHelper + * @param \Magento\Weee\Helper\Data $weeeHelper + * @param PriceCurrencyInterface $priceCurrency + * @param array $data + */ + public function __construct( + \Magento\Framework\View\Element\Template\Context $context, + \Magento\Tax\Helper\Data $taxHelper, + \Magento\Weee\Helper\Data $weeeHelper, + PriceCurrencyInterface $priceCurrency, + array $data = array() + ) { + $this->weeeHelper = $weeeHelper; + $this->priceCurrency = $priceCurrency; + parent::__construct($context, $taxHelper, $data); + $this->_isScopePrivate = true; + } + + /** + * Whether to display weee details together with price + * + * @return bool + */ + public function displayPriceWithWeeeDetails() + { + if (!$this->weeeHelper->isEnabled()) { + return false; + } + + if (!$this->weeeHelper->typeOfDisplay([WeeeDisplayConfig::DISPLAY_INCL_DESCR], 'sales')) { + return false; + } + + if (!$this->getItem()->getWeeeTaxAppliedAmount()) { + return false; + } + + return true; + } + + /** + * Get display price for unit price including tax. The Weee amount will be added to unit price including tax + * depending on Weee display setting + * + * @return float + */ + public function getUnitDisplayPriceInclTax() + { + $priceInclTax = $this->getItem()->getPriceInclTax(); + + if (!$this->weeeHelper->isEnabled()) { + return $priceInclTax; + } + + if ($this->weeeHelper + ->typeOfDisplay([WeeeDisplayConfig::DISPLAY_INCL_DESCR, WeeeDisplayConfig::DISPLAY_INCL], 'sales')) { + return $priceInclTax + $this->weeeHelper->getWeeeTaxInclTax($this->getItem()); + } + + return $priceInclTax; + } + + /** + * Get display price for row total including tax. The Weee amount will be added to row total including tax + * depending on Weee display setting + * + * @return float + */ + public function getRowDisplayPriceInclTax() + { + $rowTotalInclTax = $this->getItem()->getRowTotalInclTax(); + + if (!$this->weeeHelper->isEnabled()) { + return $rowTotalInclTax; + } + + if ($this->weeeHelper-> + typeOfDisplay([WeeeDisplayConfig::DISPLAY_INCL_DESCR, WeeeDisplayConfig::DISPLAY_INCL], 'sales')) { + return $rowTotalInclTax + $this->weeeHelper->getRowWeeeTaxInclTax($this->getItem()); + } + + return $rowTotalInclTax; + } + + /** + * Get display price for unit price excluding tax. The Weee amount will be added to unit price + * depending on Weee display setting + * + * @return float + */ + public function getUnitDisplayPriceExclTax() + { + $priceExclTax = $this->getItem()->getCalculationPrice(); + + if (!$this->weeeHelper->isEnabled()) { + return $priceExclTax; + } + + if ($this->weeeHelper + ->typeOfDisplay([WeeeDisplayConfig::DISPLAY_INCL_DESCR, WeeeDisplayConfig::DISPLAY_INCL], 'sales')) { + return $priceExclTax + $this->getItem()->getWeeeTaxAppliedAmount(); + } + + return $priceExclTax; + } + + /** + * Get display price for row total excluding tax. The Weee amount will be added to row total + * depending on Weee display setting + * + * @return float + */ + public function getRowDisplayPriceExclTax() + { + $rowTotalExclTax = $this->getItem()->getRowTotal(); + + if (!$this->weeeHelper->isEnabled()) { + return $rowTotalExclTax; + } + + if ($this->weeeHelper + ->typeOfDisplay([WeeeDisplayConfig::DISPLAY_INCL_DESCR, WeeeDisplayConfig::DISPLAY_INCL], 'sales')) { + return $rowTotalExclTax + $this->getItem()->getWeeeTaxAppliedRowAmount(); + } + + return $rowTotalExclTax; + } + + /** + * Get final unit display price including tax, this will add Weee amount to unit price include tax + * + * @return float + */ + public function getFinalUnitDisplayPriceInclTax() + { + $priceInclTax = $this->getItem()->getPriceInclTax(); + + if (!$this->weeeHelper->isEnabled()) { + return $priceInclTax; + } + + return $priceInclTax + $this->weeeHelper->getWeeeTaxInclTax($this->getItem()); + } + + /** + * Get final row display price including tax, this will add weee amount to rowTotalInclTax + * + * @return float + */ + public function getFinalRowDisplayPriceInclTax() + { + $rowTotalInclTax = $this->getItem()->getRowTotalInclTax(); + + if (!$this->weeeHelper->isEnabled()) { + return $rowTotalInclTax; + } + + return $rowTotalInclTax + $this->weeeHelper->getRowWeeeTaxInclTax($this->getItem()); + } + + /** + * Get final unit display price excluding tax + * + * @return float + */ + public function getFinalUnitDisplayPriceExclTax() + { + $priceExclTax = $this->getItem()->getCalculationPrice(); + + if (!$this->weeeHelper->isEnabled()) { + return $priceExclTax; + } + + return $priceExclTax + $this->getItem()->getWeeeTaxAppliedAmount(); + } + + /** + * Get final row display price excluding tax, this will add Weee amount to rowTotal + * + * @return float + */ + public function getFinalRowDisplayPriceExclTax() + { + $rowTotalExclTax = $this->getItem()->getRowTotal(); + + if (!$this->weeeHelper->isEnabled()) { + return $rowTotalExclTax; + } + + return $rowTotalExclTax + $this->getItem()->getWeeeTaxAppliedRowAmount(); + } + + /** + * Whether to display final price that include Weee amounts + * + * @return bool + */ + public function displayFinalPrice() + { + if (!$this->weeeHelper->typeOfDisplay(WeeeDisplayConfig::DISPLAY_EXCL_DESCR_INCL, 'sales')) { + return false; + } + + if (!$this->getItem()->getWeeeTaxAppliedAmount()) { + return false; + } + return true; + } + + /** + * Format price + * + * @param float $price + * @return string + */ + public function formatPrice($price) + { + return $this->priceCurrency->format($price); + } +} diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json index df204ed3d472c88f3e5b7476cc9c0ece626b6acd..8566ab317d28181dad542a5b1f399aaecbc2d56e 100644 --- a/app/code/Magento/Weee/composer.json +++ b/app/code/Magento/Weee/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-directory": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-eav": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-bundle": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-tax": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-directory": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-eav": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-bundle": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Weee/etc/config.xml b/app/code/Magento/Weee/etc/config.xml index b8ee23f8e3e5f672f543d7f75349310124dc2990..6d8815430703d80528a77e6dc24cfaf621f32e61 100644 --- a/app/code/Magento/Weee/etc/config.xml +++ b/app/code/Magento/Weee/etc/config.xml @@ -28,6 +28,7 @@ <sales> <totals_sort> <weee>35</weee> + <weee_tax>35</weee_tax> </totals_sort> </sales> <tax> diff --git a/app/code/Magento/Weee/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml b/app/code/Magento/Weee/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml new file mode 100644 index 0000000000000000000000000000000000000000..c3d94a8bd2afe0956e2c62dcf53754ee4f1c07ca --- /dev/null +++ b/app/code/Magento/Weee/view/frontend/layout/checkout_cart_sidebar_item_price_renderers.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <referenceBlock name="minicart"> + <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.cart.item.price.sidebar" template="Magento_Weee::checkout/cart/item/price/sidebar.phtml"/> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Weee/view/frontend/layout/checkout_item_price_renderers.xml b/app/code/Magento/Weee/view/frontend/layout/checkout_item_price_renderers.xml new file mode 100644 index 0000000000000000000000000000000000000000..4daf41e0d7224ac2aba37a7517072263c629902b --- /dev/null +++ b/app/code/Magento/Weee/view/frontend/layout/checkout_item_price_renderers.xml @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Core/etc/layout_single.xsd"> + <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.item.price.unit" template="Magento_Weee::item/price/unit.phtml"/> + <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.item.price.row" template="Magento_Weee::item/price/row.phtml"/> + <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.unit.excl" template="checkout/onepage/review/item/price/unit_excl_tax.phtml"/> + <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.unit.incl" template="checkout/onepage/review/item/price/unit_incl_tax.phtml"/> + <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.rowtotal.excl" template="checkout/onepage/review/item/price/row_excl_tax.phtml"/> + <block class="Magento\Weee\Block\Item\Price\Renderer" name="checkout.onepage.review.item.price.rowtotal.incl" template="checkout/onepage/review/item/price/row_incl_tax.phtml"/> +</layout> + diff --git a/app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml b/app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml new file mode 100644 index 0000000000000000000000000000000000000000..8b8c19ddaf2b0ac471bad0204537891796d3044d --- /dev/null +++ b/app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml @@ -0,0 +1,87 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Weee\Block\Item\Price\Renderer */ +?> +<?php $_item = $this->getItem() ?> +<div class="pricing details<?php echo $this->displayBothPrices() ? ' complex' : ''; ?>"> + <?php if ($this->displayPriceExclTax() || $this->displayBothPrices()): ?> + <div class="rate"> + <?php if ($this->displayBothPrices()): ?> + <span class="label excl tax"><?php echo __('Excl. Tax'); ?></span> + <?php else: ?> + <span class="label display"><?php echo __('Price'); ?></span> + <?php endif; ?> + <span class="value display"> + <?php echo $this->formatPrice($this->getUnitDisplayPriceExclTax()) ?> + </span> + </div> + + <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> + <div class="rate weee"> + <span class="label weee"><?php echo $tax['title']; ?></span> + <span class="value weee"><?php echo $this->formatPrice($tax['amount'],true,true); ?></span> + </div> + <?php endforeach; ?> + + <?php if ($this->displayFinalPrice()): ?> + <div class="rate weee total"> + <span class="label weee"><?php echo __('Total:'); ?></span> + <span class="value weee"><?php echo $this->formatPrice($this->getFinalUnitDisplayPriceExclTax()); ?></span> + </div> + <?php endif; ?> + <?php endif; ?> + <?php endif; ?> + +<?php if ($this->displayPriceInclTax() || $this->displayBothPrices()): ?> +<?php $_incl = $this->getPriceInclTax($_item); ?> + <div class="rate"> + <?php if ($this->displayBothPrices()): ?> + <span class="label tax incl"><?php echo __('Incl. Tax'); ?></span> + <?php else: ?> + <span class="label display"><?php echo __('Price'); ?></span> + <?php endif; ?> + + <span class="value display"> + <?php echo $this->formatPrice($this->getUnitDisplayPriceInclTax()) ?> + </span> + </div> + <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> + <div class="rate weee"> + <span class="label weee"><?php echo $tax['title']; ?></span> + <span class="value weee"><?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></span> + </div> + <?php endforeach; ?> + + <?php if ($this->displayFinalPrice()): ?> + <div class="rate weee total"> + <span class="label weee"><?php echo __('Total:'); ?></span> + <span class="value weee"><?php echo $this->formatPrice($this->getFinalUnitDisplayPriceInclTax()); ?></span> + </div> + <?php endif; ?> + <?php endif; ?> +<?php endif; ?> +</div> diff --git a/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/row_excl_tax.phtml b/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/row_excl_tax.phtml new file mode 100644 index 0000000000000000000000000000000000000000..c0229fe426c1a88e6492452b17d75cf3984d0b2d --- /dev/null +++ b/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/row_excl_tax.phtml @@ -0,0 +1,55 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Weee\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +?> +<?php if ($this->displayPriceWithWeeeDetails()): ?> + <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> +<?php else: ?> + <span class="cart price"> +<?php endif; ?> + +<?php echo $this->formatPrice($this->getRowDisplayPriceExclTax()); ?> + </span> + +<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> + <div class="cart tax info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> + <?php if ($this->displayPriceWithWeeeDetails()): ?> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> + <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount'],true,true); ?></span> + <?php endforeach; ?> + <?php endif; ?> + </div> + + <?php if ($this->displayFinalPrice()): ?> + <div class="cart-tax-total" data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> + <span class="weee"><?php echo __('Total'); ?>:<br /> + <?php echo $this->formatPrice($this->getFinalRowDisplayPriceExclTax()); ?> + </span> + </div> + <?php endif; ?> +<?php endif; ?> + diff --git a/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/row_incl_tax.phtml b/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/row_incl_tax.phtml new file mode 100644 index 0000000000000000000000000000000000000000..dab120b21520546281e5f14a2b1d00ef69aa1a14 --- /dev/null +++ b/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/row_incl_tax.phtml @@ -0,0 +1,56 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Weee\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +/** @var $_weeeHelper \Magento\Weee\Helper\Data */ +$_weeeHelper = $this->helper('Magento\Weee\Helper\Data'); +?> +<?php $_incl = $_item->getRowTotalInclTax(); ?> +<?php if ($this->displayPriceWithWeeeDetails()): ?> + <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> +<?php else: ?> + <span class="cart price"> +<?php endif; ?> +<?php echo $this->formatPrice($this->getRowDisplayPriceInclTax()); ?> + </span> + +<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> + <div class="cart tax info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> + <?php if ($this->displayPriceWithWeeeDetails()): ?> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> + <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span> + <?php endforeach; ?> + <?php endif; ?> + </div> + + <?php if ($this->displayFinalPrice()): ?> + <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $_item->getId(); ?>"}'> + <span class="weee"><?php echo __('Total incl. tax'); ?>:<br /> + <?php echo $this->formatPrice($this->getFinalRowDisplayPriceInclTax()); ?> + </span> + </div> + <?php endif; ?> +<?php endif; ?> diff --git a/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/unit_excl_tax.phtml b/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/unit_excl_tax.phtml new file mode 100644 index 0000000000000000000000000000000000000000..d0699e03a575ba75915ec7adc2b370802a8256ba --- /dev/null +++ b/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/unit_excl_tax.phtml @@ -0,0 +1,54 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Weee\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +?> +<?php if ($this->displayPriceWithWeeeDetails()): ?> + <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> +<?php else: ?> + <span class="cart price"> +<?php endif; ?> + +<?php echo $this->formatPrice($this->getUnitDisplayPriceExclTax()); ?> + </span> + +<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> + <div class="cart tax info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> + <?php if ($this->displayPriceWithWeeeDetails()): ?> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> + <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount'],true,true); ?></span> + <?php endforeach; ?> + <?php endif; ?> + </div> + + <?php if ($this->displayFinalPrice()): ?> + <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $_item->getId(); ?>"}'> + <span class="weee"><?php echo __('Total'); ?><br /> + <?php echo $this->formatPrice($this->getFinalUnitDisplayPriceExclTax()); ?> + </span> + </div> + <?php endif; ?> +<?php endif; ?> diff --git a/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/unit_incl_tax.phtml b/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/unit_incl_tax.phtml new file mode 100644 index 0000000000000000000000000000000000000000..a3dfa7bbb0fafa83a7a7b42bea6b5b739c4c95cc --- /dev/null +++ b/app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/unit_incl_tax.phtml @@ -0,0 +1,57 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Weee\Block\Item\Price\Renderer */ + +$_item = $this->getItem(); +/** @var $_weeeHelper \Magento\Weee\Helper\Data */ +$_weeeHelper = $this->helper('Magento\Weee\Helper\Data'); +?> +<?php $_incl = $_item->getPriceInclTax(); ?> +<?php if ($this->displayPriceWithWeeeDetails()): ?> + <span class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> +<?php else: ?> + <span class="cart price"> +<?php endif; ?> + +<?php echo $this->formatPrice($this->getUnitDisplayPriceInclTax()); ?> + </span> + +<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?> + <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;"> + <?php if ($this->displayPriceWithWeeeDetails()): ?> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?> + <span class="weee"><?php echo $tax['title']; ?>: <?php echo $this->formatPrice($tax['amount_incl_tax'],true,true); ?></span> + <?php endforeach; ?> + <?php endif; ?> + </div> + + <?php if ($this->displayFinalPrice()): ?> + <div class="cart tax total" data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $_item->getId(); ?>"}'> + <span class="weee"><?php echo __('Total incl. tax'); ?>:<br /> + <?php echo $this->formatPrice($this->getFinalUnitDisplayPriceInclTax()); ?> + </span> + </div> + <?php endif; ?> +<?php endif; ?> \ No newline at end of file diff --git a/app/code/Magento/Weee/view/frontend/templates/item/price/row.phtml b/app/code/Magento/Weee/view/frontend/templates/item/price/row.phtml new file mode 100644 index 0000000000000000000000000000000000000000..b56723ae6ab0049f4a96fcf751293369711cee42 --- /dev/null +++ b/app/code/Magento/Weee/view/frontend/templates/item/price/row.phtml @@ -0,0 +1,92 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Weee\Block\Item\Price\Renderer */ + +$item = $this->getItem(); +?> +<?php if (($this->displayPriceInclTax() || $this->displayBothPrices()) && !$item->getNoSubtotal()): ?> + <span class="incl tax" data-th="<?php echo $this->escapeHtml(__('Incl. Tax')); ?>"> + <?php if ($this->displayPriceWithWeeeDetails()): ?> + <span class="cart-tax-total" + data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $item->getId(); ?>"}'> + <?php else: ?> + <span class="cart price"> + <?php endif; ?> + <?php echo $this->formatPrice($this->getRowDisplayPriceInclTax()); ?> + </span> + + <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?> + <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $item->getId(); ?>" style="display: none;"> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?> + <span class="weee" data-th="<?php echo $tax['title']; ?>"> + <?php echo $this->formatPrice($tax['row_amount_incl_tax'], true, true); ?> + </span> + <?php endforeach; ?> + </div> + + <?php if ($this->displayFinalPrice()): ?> + <div class="cart-tax-total" + data-tax-toggle='{"itemTaxId" : "#subtotal-item-tax-details<?php echo $item->getId(); ?>"}'> + <span class="weee" data-th="<?php echo $this->escapeHtml(__('Total incl. tax')); ?>"> + <?php echo $this->formatPrice($this->getFinalRowDisplayPriceInclTax()); ?> + </span> + </div> + <?php endif; ?> + <?php endif; ?> + </span> +<?php endif; ?> + +<?php if ($this->displayPriceExclTax() || $this->displayBothPrices()): ?> + <span class="excl tax" data-th="<?php echo $this->escapeHtml(__('Excl. Tax')); ?>"> + <?php if ($this->displayPriceWithWeeeDetails()): ?> + <span class="cart-tax-total" + data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $item->getId(); ?>"}'> + <?php else: ?> + <span class="cart price"> + <?php endif; ?> + <?php echo $this->formatPrice($this->getRowDisplayPriceExclTax()); ?> + </span> + + <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?> + <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $item->getId(); ?>" + style="display:none;"> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?> + <span class="weee" data-th="<?php echo $tax['title']; ?>"> + <?php echo $this->formatPrice($tax['row_amount'], true, true); ?> + </span> + <?php endforeach; ?> + </div> + + <?php if ($this->displayFinalPrice()): ?> + <div class="cart-tax-total" + data-tax-toggle='{"itemTaxId" : "#esubtotal-item-tax-details<?php echo $item->getId(); ?>"}'> + <span class="weee" data-th="<?php echo $this->escapeHtml(__('Total')); ?>"> + <?php echo $this->formatPrice($this->getFinalRowDisplayPriceExclTax()); ?> + </span> + </div> + <?php endif; ?> + <?php endif; ?> + </span> +<?php endif; ?> diff --git a/app/code/Magento/Weee/view/frontend/templates/item/price/unit.phtml b/app/code/Magento/Weee/view/frontend/templates/item/price/unit.phtml new file mode 100644 index 0000000000000000000000000000000000000000..b5190c715dfcce9b8ce8ad06f639cd68ac47e4aa --- /dev/null +++ b/app/code/Magento/Weee/view/frontend/templates/item/price/unit.phtml @@ -0,0 +1,93 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +/** @var $this \Magento\Weee\Block\Item\Price\Renderer */ + +$item = $this->getItem(); +?> + +<?php if ($this->displayPriceInclTax() || $this->displayBothPrices()): ?> + <span class="incl tax" data-th="<?php echo $this->escapeHtml(__('Incl. Tax')); ?>"> + <?php if ($this->displayPriceWithWeeeDetails()): ?> + <span class="cart-tax-total" + data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $item->getId(); ?>"}'> + <?php else: ?> + <span class="cart price"> + <?php endif; ?> + <?php echo $this->formatPrice($this->getUnitDisplayPriceInclTax()); ?> + </span> + + <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?> + <div class="cart-tax-info" id="unit-item-tax-details<?php echo $item->getId(); ?>" style="display: none;"> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?> + <span class="weee" data-th="<?php echo $tax['title']; ?>"> + <?php echo $this->formatPrice($tax['amount_incl_tax'], true, true); ?> + </span> + <?php endforeach; ?> + </div> + + <?php if ($this->displayFinalPrice()): ?> + <div class="cart-tax-total" + data-tax-toggle='{"itemTaxId" : "#unit-item-tax-details<?php echo $item->getId(); ?>"}'> + <span class="weee" data-th="<?php echo $this->escapeHtml(__('Total incl. tax')); ?>"> + <?php echo $this->formatPrice($this->getFinalUnitDisplayPriceInclTax()); ?> + </span> + </div> + <?php endif; ?> + <?php endif; ?> + </span> +<?php endif; ?> + +<?php if ($this->displayPriceExclTax() || $this->displayBothPrices()): ?> + <span class="excl tax" data-th="<?php echo $this->escapeHtml(__('Excl. Tax')); ?>"> + <?php if ($this->displayPriceWithWeeeDetails()): ?> + <span class="cart-tax-total" + data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $item->getId(); ?>"}'> + <?php else: ?> + <span class="cart price"> + <?php endif; ?> + <?php echo $this->formatPrice($this->getUnitDisplayPriceExclTax()); ?> + </span> + + <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?> + <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $item->getId(); ?>" + style="display:none;"> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?> + <span class="weee" data-th="<?php echo $tax['title']; ?>"> + <?php echo $this->formatPrice($tax['amount'], true, true); ?> + </span> + <?php endforeach; ?> + </div> + + <?php if ($this->displayFinalPrice()): ?> + <div class="cart-tax-total" + data-tax-toggle='{"itemTaxId" : "#eunit-item-tax-details<?php echo $item->getId(); ?>"}'> + <span class="weee" data-th="<?php echo $this->escapeHtml(__('Total')); ?>"> + <?php echo $this->formatPrice($this->getFinalUnitDisplayPriceExclTax()); ?> + </span> + </div> + <?php endif; ?> + <?php endif; ?> + </span> +<?php endif; ?> diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index 2403b38e284a96629c5d08c7ae9168a505649824..547554a1b9c0a8282efad2119a35e50df36b21ad 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-cms": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-cms": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json index 6dd7470f703fc717c42c8413aab645e29e4d5597..b1235d7a0aaaf24a0a0a955bbdfdc9fa30b6a9fc 100644 --- a/app/code/Magento/Wishlist/composer.json +++ b/app/code/Magento/Wishlist/composer.json @@ -3,25 +3,24 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha90", - "magento/module-customer": "0.1.0-alpha90", - "magento/module-catalog": "0.1.0-alpha90", - "magento/module-core": "0.1.0-alpha90", - "magento/module-checkout": "0.1.0-alpha90", - "magento/module-theme": "0.1.0-alpha90", - "magento/module-catalog-inventory": "0.1.0-alpha90", - "magento/module-tax": "0.1.0-alpha90", - "magento/module-backend": "0.1.0-alpha90", - "magento/module-bundle": "0.1.0-alpha90", - "magento/module-sales": "0.1.0-alpha90", - "magento/module-grouped-product": "0.1.0-alpha90", - "magento/module-configurable-product": "0.1.0-alpha90", - "magento/module-downloadable": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/module-store": "0.1.0-alpha91", + "magento/module-customer": "0.1.0-alpha91", + "magento/module-catalog": "0.1.0-alpha91", + "magento/module-core": "0.1.0-alpha91", + "magento/module-checkout": "0.1.0-alpha91", + "magento/module-theme": "0.1.0-alpha91", + "magento/module-catalog-inventory": "0.1.0-alpha91", + "magento/module-backend": "0.1.0-alpha91", + "magento/module-bundle": "0.1.0-alpha91", + "magento/module-sales": "0.1.0-alpha91", + "magento/module-grouped-product": "0.1.0-alpha91", + "magento/module-configurable-product": "0.1.0-alpha91", + "magento/module-downloadable": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/code/Magento/Wishlist/etc/module.xml b/app/code/Magento/Wishlist/etc/module.xml index fbf025e1362d46c03aa0466e45d825bbc161e91f..b2d43717cc4d2de66da38bfa70ffab025fd2c8ff 100644 --- a/app/code/Magento/Wishlist/etc/module.xml +++ b/app/code/Magento/Wishlist/etc/module.xml @@ -37,7 +37,6 @@ <module name="Magento_Checkout"/> <module name="Magento_Theme"/> <module name="Magento_CatalogInventory"/> - <module name="Magento_Tax"/> <module name="Magento_Backend"/> <module name="Magento_Bundle" type="soft"/> <module name="Magento_Sales"/> diff --git a/app/code/Magento/Wishlist/view/frontend/templates/render/item/price_msrp_item.phtml b/app/code/Magento/Wishlist/view/frontend/templates/render/item/price_msrp_item.phtml index 46adf8abbd87a72f299cde37808319201112b6b3..f37f68a1237b8e21f874d8667bf19b6182d1d554 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/render/item/price_msrp_item.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/render/item/price_msrp_item.phtml @@ -42,7 +42,7 @@ $_msrpPrice = ''; ?> <div class="price-box msrp"> - <?php $_price = $this->helper('Magento\Tax\Helper\Data')->getPrice($_product, $_product->getMsrp()) ?> + <?php $_price = $this->helper('Magento\Catalog\Helper\Data')->getTaxPrice($_product, $_product->getMsrp()) ?> <?php if($_product->getMsrp()): ?> <?php $_msrpPrice = $_coreHelper->currency($_product->getMsrp(),true,false) ?> <span class="old-price" ><?php echo $_msrpPrice ?></span> diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json index e6a1b089950a597c4b8cd513a3e9765c28e6633b..9d0746de0d3c570a83f61f4c659c062d453a5780 100644 --- a/app/design/adminhtml/Magento/backend/composer.json +++ b/app/design/adminhtml/Magento/backend/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha90", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/design/adminhtml/Magento/backend/theme.xml b/app/design/adminhtml/Magento/backend/theme.xml index fe67f100a603c818e34a63e791562ee93d299723..e1241b1f7e112e78745818fd0b8a4d466b1c26d0 100644 --- a/app/design/adminhtml/Magento/backend/theme.xml +++ b/app/design/adminhtml/Magento/backend/theme.xml @@ -24,5 +24,5 @@ --> <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> <title>Magento 2 backend</title> - <version>0.1.0-alpha90</version> + <version>0.1.0-alpha91</version> </theme> diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index 5542bb6163aeecdeb0017a820cdd146232f6dfc3..755c77f48ac960d052c3ffc707e053b36c548195 100644 --- a/app/design/frontend/Magento/blank/composer.json +++ b/app/design/frontend/Magento/blank/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha90", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/design/frontend/Magento/blank/theme.xml b/app/design/frontend/Magento/blank/theme.xml index 314963981afe0bdfb6a443072bfb95350fcdcf6c..6c89ce8a33f3e92b74fdf2ebf938a9adaa93b12b 100644 --- a/app/design/frontend/Magento/blank/theme.xml +++ b/app/design/frontend/Magento/blank/theme.xml @@ -24,7 +24,7 @@ --> <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> <title>Magento Blank</title> - <version>0.1.0-alpha90</version> + <version>0.1.0-alpha91</version> <media> <preview_image>media/preview.jpg</preview_image> </media> diff --git a/app/design/frontend/Magento/plushe/composer.json b/app/design/frontend/Magento/plushe/composer.json index 1e26263548734e627123d1269318850eee1db2f6..72363cea6328c3c2b086bf18263bc80ca1b0b31d 100644 --- a/app/design/frontend/Magento/plushe/composer.json +++ b/app/design/frontend/Magento/plushe/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/theme-frontend-blank": "0.1.0-alpha90", - "magento/framework": "0.1.0-alpha90", + "magento/theme-frontend-blank": "0.1.0-alpha91", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "extra": { "map": [ [ diff --git a/app/design/frontend/Magento/plushe/theme.xml b/app/design/frontend/Magento/plushe/theme.xml index b97568f87d759bc495abfd4fbba649c293d173f8..566974dc62e6aab5d1db8dc4332cfbe74514c1e7 100644 --- a/app/design/frontend/Magento/plushe/theme.xml +++ b/app/design/frontend/Magento/plushe/theme.xml @@ -24,7 +24,7 @@ --> <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> <title>Magento Plushe</title> - <version>0.1.0-alpha90</version> + <version>0.1.0-alpha91</version> <parent>Magento/blank</parent> <media> <preview_image>media/preview.jpg</preview_image> diff --git a/app/design/install/Magento/basic/theme.xml b/app/design/install/Magento/basic/theme.xml index 78050dd98f95a5105dbffcb5102b7aa943a4dc82..24d35b0131b064f5a5c5efc6393d40977a637fbb 100644 --- a/app/design/install/Magento/basic/theme.xml +++ b/app/design/install/Magento/basic/theme.xml @@ -24,5 +24,5 @@ --> <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> <title>Magento Basic</title> - <version>0.1.0-alpha90</version> + <version>0.1.0-alpha91</version> </theme> diff --git a/app/i18n/magento/de_de/composer.json b/app/i18n/magento/de_de/composer.json index f15bf8e8c62823e36536c9c13099d6114e974acd..a1e261976da7ddf1f770fa4fb88a7eae94f07a49 100644 --- a/app/i18n/magento/de_de/composer.json +++ b/app/i18n/magento/de_de/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-de_de", "description": "German (Germany) language", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "require": { - "magento/framework": "0.1.0-alpha90", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/en_us/composer.json b/app/i18n/magento/en_us/composer.json index 4353c63040f14387acd6932b0d6f8863676c8c6c..86d92fb28c57fd9714d5d9ac7e65de6fa5c970b2 100644 --- a/app/i18n/magento/en_us/composer.json +++ b/app/i18n/magento/en_us/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-en_us", "description": "English (United States) language", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "require": { - "magento/framework": "0.1.0-alpha90", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/es_es/composer.json b/app/i18n/magento/es_es/composer.json index 0051cd143cf09d1a9f1813646863772a76c4db99..06ff6c531706327e8b9ad9590cc65b4ac93a8f38 100644 --- a/app/i18n/magento/es_es/composer.json +++ b/app/i18n/magento/es_es/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-es_es", "description": "Spanish (Spain) language", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "require": { - "magento/framework": "0.1.0-alpha90", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/fr_fr/composer.json b/app/i18n/magento/fr_fr/composer.json index 7ec67b4fe3761e156e137d2148733d3a7c4eae96..9abad4a014cbcb7ef61c019a5e7868816210a2ab 100644 --- a/app/i18n/magento/fr_fr/composer.json +++ b/app/i18n/magento/fr_fr/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-fr_fr", "description": "French (France) language", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "require": { - "magento/framework": "0.1.0-alpha90", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/nl_nl/composer.json b/app/i18n/magento/nl_nl/composer.json index 3b2dc8f8dace12cc4787169d61e411e7f705c3e9..d18687dd182a7f41e7b9bb51331bde5ec26fc11f 100644 --- a/app/i18n/magento/nl_nl/composer.json +++ b/app/i18n/magento/nl_nl/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-nl_nl", "description": "Dutch (Netherlands) language", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "require": { - "magento/framework": "0.1.0-alpha90", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/pt_br/composer.json b/app/i18n/magento/pt_br/composer.json index fd9d2f8b4fc2999249d4e180291a85e0b9dd748b..5c27edf02a0365f4d2f2c4eb846a69a632ad1e09 100644 --- a/app/i18n/magento/pt_br/composer.json +++ b/app/i18n/magento/pt_br/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-pt_br", "description": "Portuguese (Brazil) language", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "require": { - "magento/framework": "0.1.0-alpha90", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/zh_cn/composer.json b/app/i18n/magento/zh_cn/composer.json index c92f93e623498ff6ffb45cf61de9870f53ea04cd..3484087c8d12bdeba665c8e4878624188b93f819 100644 --- a/app/i18n/magento/zh_cn/composer.json +++ b/app/i18n/magento/zh_cn/composer.json @@ -1,9 +1,9 @@ { "name": "magento/language-zh_cn", "description": "Chinese (China) language", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "require": { - "magento/framework": "0.1.0-alpha90", + "magento/framework": "0.1.0-alpha91", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/composer.json b/composer.json index f1577e2f35705ea76bebcbc21d11e4d129b9ced0..5a5756d06fbdc3cafca320de701d75c10151a9c0 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/project-community-edition", "description": "Magento project (Community Edition)", "type": "project", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "require": { "php": "~5.4.11|~5.5.0" }, diff --git a/dev/tests/functional/composer.json.dist b/dev/tests/functional/composer.json.dist index e2d1dd19e9df73f5b84a65e22fa133b1a120d035..00488d8d096894147825f82c25827d3acb9ea9d3 100644 --- a/dev/tests/functional/composer.json.dist +++ b/dev/tests/functional/composer.json.dist @@ -2,7 +2,7 @@ "require": { "magento/mtf": "dev-master", "php": ">=5.4.0", - "phpunit/phpunit": "3.7.*", + "phpunit/phpunit": "4.1.0", "phpunit/phpunit-selenium": ">=1.2", "netwing/selenium-server-standalone": ">=2.35" }, diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Template.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Template.php index 038a00bdf900ba42be3693c14836e51598c2bf1a..c0f21a0f302bdb58cfbfa92dd01d39e45cdae704 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Template.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Template.php @@ -26,12 +26,10 @@ namespace Magento\Backend\Test\Block; use Mtf\Block\Block; -use Mtf\Client\Element\Locator; /** * Class Template * Backend abstract block - * */ class Template extends Block { @@ -40,7 +38,7 @@ class Template extends Block * * @var string */ - protected $loader = '[data-role=loader]'; + protected $loader = '[data-role="loader"]'; /** * Magento varienLoader.js loader @@ -51,10 +49,12 @@ class Template extends Block /** * Wait until loader will be disappeared + * + * @return void */ public function waitLoader() { - $this->waitForElementNotVisible($this->loader, Locator::SELECTOR_CSS); - $this->waitForElementNotVisible($this->loaderOld, Locator::SELECTOR_CSS); + $this->waitForElementNotVisible($this->loader); + $this->waitForElementNotVisible($this->loaderOld); } } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php index ff2a43e7792e9c4b5d2033b983d4ab0ab117d8ed..c1beedc5ba9d1f4384a8eca79bd678a3461b5f1c 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php @@ -48,6 +48,13 @@ class Bundle extends Tab */ protected $openOption = '[data-target="#bundle_option_%d-content"]'; + /** + * Selector for 'Add Products to Option' button + * + * @var string + */ + protected $optionContent = '#bundle_option_%d-content'; + /** * Get bundle options block * @@ -76,12 +83,13 @@ class Bundle extends Tab } foreach ($fields['bundle_selections']['value']['bundle_options'] as $key => $bundleOption) { $itemOption = $this->_rootElement->find(sprintf($this->openOption, $key)); - if ($itemOption->isVisible()) { + $isContent = $this->_rootElement->find(sprintf($this->optionContent, $key))->isVisible(); + if ($itemOption->isVisible() && !$isContent) { $itemOption->click(); - } else { + } elseif (!$itemOption->isVisible()) { $this->_rootElement->find($this->addNewOption)->click(); } - $this->getBundleOptionBlock($key)->fillBundleOption($bundleOption); + $this->getBundleOptionBlock($key)->fillOption($bundleOption); } return $this; } @@ -101,12 +109,13 @@ class Bundle extends Tab } $index = 0; foreach ($fields['bundle_selections']['value']['bundle_options'] as $key => &$bundleOption) { - $this->_rootElement->find(sprintf($this->openOption, $index))->click(); + if (!$this->_rootElement->find(sprintf($this->optionContent, $key))->isVisible()) { + $this->_rootElement->find(sprintf($this->openOption, $index))->click(); + } foreach ($bundleOption['assigned_products'] as &$product) { $product['data']['getProductName'] = $product['search_data']['name']; } - $newFields['bundle_selections'][$key] = $this->getBundleOptionBlock($key) - ->getBundleOptionData($bundleOption); + $newFields['bundle_selections'][$key] = $this->getBundleOptionBlock($key)->getOptionData($bundleOption); $index++; } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php index cf1ae7edca2b8dc40706b995d05a70d3a7a21ec0..95ebe787dea1ea681493497521fa95416419a48d 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php @@ -106,7 +106,7 @@ class Option extends Form * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function fillBundleOption(array $fields) + public function fillOption(array $fields) { $mapping = $this->dataMapping($fields); $this->_fill($mapping); @@ -131,7 +131,7 @@ class Option extends Form * @param array $fields * @return array */ - public function getBundleOptionData(array $fields) + public function getOptionData(array $fields) { $mapping = $this->dataMapping($fields); $newField = $this->_getData($mapping); diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php index 4e2ab8a141280a1007cc5a10a312137e7b86d89b..276829518d50672913ff2aba417414027787ac03 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php @@ -26,6 +26,7 @@ namespace Magento\Bundle\Test\Block\Catalog\Product\View\Type; use Mtf\Block\Block; use Mtf\Client\Element\Locator; +use Magento\Bundle\Test\Fixture\CatalogProductBundle; use Magento\Bundle\Test\Page\Product\CatalogProductView; use Magento\Bundle\Test\Block\Catalog\Product\View\Type\Option; @@ -101,17 +102,18 @@ class Bundle extends Block /** * Fill bundle option on frontend add click "Add to cart" button * - * @param array $fillData + * @param CatalogProductBundle $product * @param CatalogProductView $catalogProductView * @return void */ - public function addToCart(array $fillData, CatalogProductView $catalogProductView) + public function addToCart(CatalogProductBundle $product, CatalogProductView $catalogProductView) { - $this->fillBundleOptions($fillData['bundle_options']); + $fillData = $product->getDataFieldConfig('checkout_data')['source']->getPreset(); + if (isset($fillData['bundle_options'])) { + $this->fillBundleOptions($fillData['bundle_options']); + } if (isset($fillData['custom_options'])) { - foreach ($fillData['custom_options'] as $option) { - $catalogProductView->getCustomOptionsBlock()->fillCustomOptions($option); - } + $catalogProductView->getCustomOptionsBlock()->fillCustomOptions($product, $fillData['custom_options']); } $catalogProductView->getViewBlock()->clickAddToCart(); } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php index c05c517b04ec7e8cfc171bd391baf11db886af96..aa34b81f22ce20b4abb4d3f21a17159274e73621 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php @@ -100,7 +100,7 @@ class AssertBundlePriceType extends AbstractConstraint : $product->getPriceType(); $fillData = $product->getDataFieldConfig('checkout_data')['source']->getPreset(); $bundleBlock = $catalogProductView->getBundleViewBlock()->getBundleBlock(); - $bundleBlock->addToCart($fillData, $catalogProductView); + $bundleBlock->addToCart($product, $catalogProductView); $cartBlock = $checkoutCartView->getCartBlock(); $specialPrice = 0; if (isset($bundleData['group_price'])) { diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php index 4eff17432fefa6e3125dbd21682f1937fde8d842..76880a4c01508fef07cc9ca946c3f960e79183a4 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php @@ -26,8 +26,6 @@ namespace Magento\Bundle\Test\Constraint; use Mtf\Fixture\FixtureInterface; use Magento\Catalog\Test\Constraint\AssertProductForm; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; /** * Class AssertBundleProductForm @@ -55,62 +53,21 @@ class AssertBundleProductForm extends AssertProductForm ] ]; - /** - * Assert form data equals fixture data - * - * @param FixtureInterface $product - * @param CatalogProductIndex $productGrid - * @param CatalogProductEdit $productPage - * @return void - */ - public function processAssert( - FixtureInterface $product, - CatalogProductIndex $productGrid, - CatalogProductEdit $productPage - ) { - $filter = ['sku' => $product->getSku()]; - $productGrid->open(); - $productGrid->getProductGrid()->searchAndOpen($filter); - - $formData = $productPage->getForm()->getData($product); - $fixtureData = $this->prepareFixtureData($product->getData()); - $errors = $this->verifyData($fixtureData, $formData); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - /** * Prepares fixture data for comparison * * @param array $data + * @param FixtureInterface $product * @param array $sortFields [optional] * @return array */ - protected function prepareFixtureData(array $data, array $sortFields = []) + protected function prepareFixtureData(array $data, FixtureInterface $product, array $sortFields = []) { - $data = $this->prepareSpecialPriceArray($data); $data['bundle_selections'] = $this->prepareBundleOptions( $data['bundle_selections']['bundle_options'] ); - return parent::prepareFixtureData($data, $sortFields); - } - - /** - * Prepare special price array for Bundle product - * - * @param array $fields - * @return array - */ - protected function prepareSpecialPriceArray(array $fields) - { - foreach ($this->specialArray as $key => $value) { - if (array_key_exists($key, $fields)) { - if (isset($value['type']) && $value['type'] == 'date') { - $fields[$key] = vsprintf('%d/%d/%d', explode('/', $fields[$key])); - } - } - } - return $fields; + return parent::prepareFixtureData($data, $product, $sortFields); } /** diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertProductCustomOptionsOnBundleProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertProductCustomOptionsOnBundleProductPage.php new file mode 100644 index 0000000000000000000000000000000000000000..502fabef02f9903fc41674f3c5421ed09ba3c9cf --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertProductCustomOptionsOnBundleProductPage.php @@ -0,0 +1,57 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Bundle\Test\Constraint; + +use Mtf\Fixture\FixtureInterface; +use Magento\Catalog\Test\Page\Product\CatalogProductView; +use Magento\Catalog\Test\Constraint\AssertProductCustomOptionsOnProductPage; + +/** + * Class AssertProductCustomOptionsOnBundleProductPage + * Assertion that commodity options are displayed correctly on bundle product page + */ +class AssertProductCustomOptionsOnBundleProductPage extends AssertProductCustomOptionsOnProductPage +{ + /** + * Flag for verify price data + * + * @var bool + */ + protected $isPrice = false; + + /** + * Open product view page + * + * @param CatalogProductView $catalogProductView + * @param FixtureInterface $product + * @return void + */ + protected function openProductPage(CatalogProductView $catalogProductView, FixtureInterface $product) + { + $catalogProductView->init($product); + $catalogProductView->open(); + $catalogProductView->getViewBlock()->clickCustomize(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/CatalogProductBundle/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/CatalogProductBundle/CheckoutData.php index fcd9289437fe862e59ac68713f265fc2efb0e736..1485dc7940253536f3f4133395058c6a81243497 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/CatalogProductBundle/CheckoutData.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/CatalogProductBundle/CheckoutData.php @@ -84,9 +84,52 @@ class CheckoutData extends AbstractCheckoutData ], 'custom_options' => [ [ - 'type' => 'Drop-down', - 'title' => 'custom option drop down', - 'value' => ['30 bucks'], + 'option' => 1, + 'value' => [1], + ], + [ + 'option' => 2, + 'value' => [1], + ], + [ + 'option' => 3, + 'value' => ['Field'], + ], + [ + 'option' => 4, + 'value' => ['Field'], + ], + [ + 'option' => 5, + 'value' => ['Area'], + ], + [ + 'option' => 7, + 'value' => [1], + ], + [ + 'option' => 8, + 'value' => [1], + ], + [ + 'option' => 9, + 'value' => [1], + ], + [ + 'option' => 10, + 'value' => [1], + ], + [ + 'option' => 11, + 'value' => ['12/12/2014'], + ], + [ + 'option' => 12, + 'value' => ['12/12/2014/12/30/AM'], + ], + [ + 'option' => 13, + 'value' => ['12/12/AM'], ], ] ], @@ -102,9 +145,8 @@ class CheckoutData extends AbstractCheckoutData ], 'custom_options' => [ [ - 'type' => 'Drop-down', - 'title' => 'custom option drop down', - 'value' => ['10 percent'], + 'option' => 1, + 'value' => [1], ], ] ], @@ -141,49 +183,40 @@ class CheckoutData extends AbstractCheckoutData ], 'custom_options' => [ [ - 'type' => 'Field', - 'title' => 'custom option field', + 'option' => 1, 'value' => ['Field'], ], [ - 'type' => 'Area', - 'title' => 'custom option Area', + 'option' => 2, 'value' => ['Area'], ], [ - 'type' => 'Radio Buttons', - 'title' => 'custom option Radio Buttons', - 'value' => ['20 percent'], + 'option' => 4, + 'value' => [1], ], [ - 'type' => 'Drop-down', - 'title' => 'custom option drop down', - 'value' => ['20 percent'], + 'option' => 5, + 'value' => [1], ], [ - 'type' => 'Checkbox', - 'title' => 'custom option Checkbox', - 'value' => ['20 percent'], + 'option' => 6, + 'value' => [1], ], [ - 'type' => 'Multiple Select', - 'title' => 'custom option Multiple Select', - 'value' => ['20 percent'], + 'option' => 7, + 'value' => [1], ], [ - 'type' => 'Date', - 'title' => 'custom option Date', + 'option' => 8, 'value' => ['12/12/2014'], ], [ - 'type' => 'Date & Time', - 'title' => 'custom option Date & Time', + 'option' => 9, 'value' => ['12/12/2014/12/30/AM'], ], [ - 'type' => 'Time', - 'title' => 'custom option Time', - 'value' => ['12/12/2014/12/30/AM'], + 'option' => 10, + 'value' => ['12/12/AM'], ], ] ], diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/CatalogProductBundle/Price.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/CatalogProductBundle/Price.php index d92d5f7f1c91cfda0f750c8c9421f834d92a03a8..e4a01716fcabc11714d657a670f7293929810b12 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/CatalogProductBundle/Price.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/CatalogProductBundle/Price.php @@ -140,7 +140,7 @@ class Price implements FixtureInterface 'fixed-24' => [ 'price_from' => '96.00', 'price_to' => '97.00', - 'cart_price' => '252.00' + 'cart_price' => '244.00' ], 'fixed-1' => [ 'price_from' => '1.00', @@ -168,7 +168,7 @@ class Price implements FixtureInterface 'fixed-115' => [ 'price_from' => '115.00', 'price_to' => '120.00', - 'cart_price' => '145.00' + 'cart_price' => '317.00' ], 'fixed-126' => [ 'price_from' => '115.00', diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.php index bf983be138617176fb903a9dab2f0ccb0ba80daf..455f7dbe322c662f4b8eb42bf89ceab2751e069a 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Page/Product/CatalogProductView.php @@ -34,16 +34,25 @@ class CatalogProductView extends ParentCatalogProductView { const MCA = 'bundle/catalog/product/view'; - protected $_blocks = [ - 'bundleViewBlock' => [ + /** + * Custom constructor + * + * @return void + */ + protected function _init() + { + $this->_blocks['bundleViewBlock'] = [ 'name' => 'bundleViewBlock', 'class' => 'Magento\Bundle\Test\Block\Catalog\Product\View', 'locator' => '.bundle-options-container', 'strategy' => 'css selector', - ], - ]; + ]; + parent::_init(); + } /** + * Bundle block on frontend + * * @return \Magento\Bundle\Test\Block\Catalog\Product\View */ public function getBundleViewBlock() diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv index 35d7c6279827ec87de81dffba59c17bf70b5ad26..c5a33ebf810f7268ef09e8229d9bc9f53375c484 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv @@ -1,15 +1,15 @@ -"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/status";"product/data/price_type";"product/data/price/value";"product/data/price/preset";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/is_in_stock";"product/data/weight_type";"product/data/weight";"product/data/category";"product/data/description";"product/data/group_price/preset";"product/data/special_price";"product/data/special_from_date/pattern";"product/data/special_to_date/pattern";"product/data/tier_price/preset";"product/data/price_view";"product/data/stock_data/use_config_manage_stock";"product/data/stock_data/manage_stock";"product/data/shipment_type";"product/data/bundle_selections/preset";"product/data/bundle_selections/products";"product/data/checkout_data/preset";"product/data/custom_options/preset";"product/data/visibility";"product/data/use_config_gift_message_available";"product/data/gift_message_available";"constraint" -"BundleProduct %isolation%";"-";"bundle_sku_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Bundle Product Dynamic Required";"-";"-";"-";"-";"-";"-";"No";"No";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product offline";"Dynamic";"-";"-";"-";"Out of Stock";"Dynamic";"-";"category_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Separately";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductNotSearchableBySku" -"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"Product online";"Dynamic";"-";"dynamic-200";"-";"In Stock";"Dynamic";"-";"category_%isolation%";"Bundle Product Dynamic";"-";"-";"-";"-";"-";"Price Range";"-";"-";"Together";"all_types_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_options";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertProductInStock, assertBundleItemsOnProductPage, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"-";"Fixed";"10";"fixed-15";"None";"-";"Fixed";"10";"-";"Bundle Product Fixed Required";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"100";"fixed-24";"Taxable Goods";"In Stock";"Fixed";"10";"category_%isolation%";"Bundle Product Fixed";"default";"-";"-";"-";"-";"As Low as";"-";"-";"Separately";"all_types_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_fixed_and_custom_options";"all_types";"Catalog, Search";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductVisibleInCategory, assertBundleProductPage, assertProductInStock, assertGroupedPriceOnBundleProductPage, assertBundleItemsOnProductPage, assertBundlePriceView, assertBundlePriceType" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"10";"fixed-1";"Taxable Goods";"Out of Stock";"Fixed";"10";"category_%isolation%";"-";"-";"10";"m/d/Y";"m/d/Y +3 days";"-";"Price Range";"No";"Yes";"Together";"with_not_required_options";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"with_not_required_options";"-";"Catalog";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertBundleProductPage, assertProductOutOfStock, assertBundlePriceView" -"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"-";"Dynamic";"-";"dynamic-50";"-";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"default";"As Low as";"No";"No";"Together";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"Search";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage, assertTierPriceOnBundleProductPage" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-8";"-";"-";"-";"-";"-";"-";"-";"20";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-32";"-";"-";"-";"-";"-";"-";"MAGETWO-23061";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-40";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" -"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-115";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_1";"MAGETWO-23066";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" -"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-126";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_2";"MAGETWO-23069";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"assertProductSaveMessage" -"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"assertProductSaveMessage" +"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/status";"product/data/price_type";"product/data/price/value";"product/data/price/preset";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/is_in_stock";"product/data/weight_type";"product/data/weight";"product/data/category";"product/data/description";"product/data/group_price/preset";"product/data/special_price";"product/data/special_from_date/pattern";"product/data/special_to_date/pattern";"product/data/tier_price/preset";"product/data/price_view";"product/data/stock_data/use_config_manage_stock";"product/data/stock_data/manage_stock";"product/data/shipment_type";"product/data/bundle_selections/preset";"product/data/bundle_selections/products";"product/data/checkout_data/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/visibility";"product/data/use_config_gift_message_available";"product/data/gift_message_available";"constraint";"issue" +"BundleProduct %isolation%";"-";"bundle_sku_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Bundle Product Dynamic Required";"-";"-";"-";"-";"-";"-";"No";"No";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage";"" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product offline";"Dynamic";"-";"-";"-";"Out of Stock";"Dynamic";"-";"category_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Separately";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductNotSearchableBySku";"" +"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"Product online";"Dynamic";"-";"dynamic-200";"-";"In Stock";"Dynamic";"-";"category_%isolation%";"Bundle Product Dynamic";"-";"-";"-";"-";"-";"Price Range";"-";"-";"Together";"all_types_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_options";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertProductInStock, assertBundleItemsOnProductPage, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType";"" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"-";"Fixed";"10";"fixed-15";"None";"-";"Fixed";"10";"-";"Bundle Product Fixed Required";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage";"" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"100";"fixed-24";"Taxable Goods";"In Stock";"Fixed";"10";"category_%isolation%";"Bundle Product Fixed";"default";"-";"-";"-";"-";"As Low as";"-";"-";"Separately";"all_types_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_fixed_and_custom_options";"all_types";"-";"Catalog, Search";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductVisibleInCategory, assertBundleProductPage, assertProductInStock, assertGroupedPriceOnBundleProductPage, assertBundleItemsOnProductPage, assertBundlePriceView, assertBundlePriceType";"Bug: MAGETWO-26969" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"10";"fixed-1";"Taxable Goods";"Out of Stock";"Fixed";"10";"category_%isolation%";"-";"-";"10";"m/d/Y";"m/d/Y +3 days";"-";"Price Range";"No";"Yes";"Together";"with_not_required_options";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"with_not_required_options";"-";"-";"Catalog";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertBundleProductPage, assertProductOutOfStock, assertBundlePriceView";"Bug: MAGETWO-26980" +"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"-";"Dynamic";"-";"dynamic-50";"-";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"default";"As Low as";"No";"No";"Together";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"Search";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage, assertTierPriceOnBundleProductPage";"Bug: MAGETWO-26853" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-8";"-";"-";"-";"-";"-";"-";"-";"20";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory";"" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-32";"-";"-";"-";"-";"-";"-";"MAGETWO-23061";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-40";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" +"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-115";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_1";"MAGETWO-23066";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType, assertProductCustomOptionsOnBundleProductPage";"" +"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-126";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_2";"MAGETWO-23069";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage";"" +"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage";"" diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/global/constraint.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/global/constraint.xml index 017c23441d638d0a28764d9745fa4bd2332bd4d9..db84e1416f85c9be0b1fd899c429175f0205282d 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/global/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/global/constraint.xml @@ -54,4 +54,7 @@ <assertGroupedPriceOnBundleProductPage module="Magento_Bundle"> <severeness>low</severeness> </assertGroupedPriceOnBundleProductPage> + <assertProductCustomOptionsOnBundleProductPage module="Magento_Bundle"> + <severeness>low</severeness> + </assertProductCustomOptionsOnBundleProductPage> </constraint> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php index 3b3056997e8ed85d8f7f472d312b6377ac864db5..879c19657d528b50fc4c1356a45b1c88de4e02c0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options.php @@ -26,7 +26,9 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab; use Mtf\ObjectManager; use Mtf\Client\Element; +use Mtf\Client\Element\Locator; use Magento\Backend\Test\Block\Widget\Tab; +use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Options\Search\Grid; /** * Class Options @@ -35,11 +37,18 @@ use Magento\Backend\Test\Block\Widget\Tab; class Options extends Tab { /** - * Custom option row CSS locator + * Custom option row * * @var string */ - protected $customOptionRow = '#product-custom-options-content .fieldset-wrapper:nth-child(%d)'; + protected $customOptionRow = '//*[*[@class="fieldset-wrapper-title"]//span[.="%s"]]'; + + /** + * New custom option row CSS locator + * + * @var string + */ + protected $newCustomOptionRow = '#product-custom-options-content .fieldset-wrapper:nth-child(%d)'; /** * Add an option button @@ -48,6 +57,20 @@ class Options extends Tab */ protected $buttonFormLocator = '[data-ui-id="admin-product-options-add-button"]'; + /** + * Import an option button + * + * @var string + */ + protected $buttonImportOptions = '[data-ui-id="admin-product-options-import-button"]'; + + /** + * Selector block import products grid + * + * @var string + */ + protected $importGrid = "//ancestor::body/div[*[@id='import-container'] and contains(@style,'display: block')]"; + /** * Fill custom options form on tab * @@ -63,6 +86,10 @@ class Options extends Tab } foreach ($fields['value'] as $keyRoot => $field) { + if ($keyRoot === 'import') { + $this->importOptions($field['products']); + continue; + } $options = null; $this->_rootElement->find($this->buttonFormLocator)->click(); if (!empty($field['options'])) { @@ -70,13 +97,13 @@ class Options extends Tab unset($field['options']); } - $rootElement = $this->_rootElement->find(sprintf($this->customOptionRow, $keyRoot + 1)); + $rootElement = $this->_rootElement->find(sprintf($this->newCustomOptionRow, $keyRoot + 1)); $data = $this->dataMapping($field); $this->_fill($data, $rootElement); // Fill subform if (isset($field['type']) && !empty($options)) { - /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Options\OptionsAbstract $optionsForm */ + /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Options\AbstractOptions $optionsForm */ $optionsForm = $this->blockFactory->create( __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($field['type']), ['element' => $rootElement] @@ -95,6 +122,35 @@ class Options extends Tab return $this; } + /** + * Import custom options + * + * @param array $products + * @return void + */ + protected function importOptions(array $products) + { + foreach ($products as $product) { + $this->_rootElement->find($this->buttonImportOptions)->click(); + $searchBlock = $this->getSearchGridBlock(); + $searchBlock->searchAndSelect(['sku' => $product]); + $searchBlock->addProducts(); + } + } + + /** + * Get grid for import custom options products + * + * @return Grid + */ + protected function getSearchGridBlock() + { + return $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Options\Search\Grid', + ['element' => $this->_rootElement->find($this->importGrid, Locator::SELECTOR_XPATH)] + ); + } + /** * Get data of tab * @@ -109,6 +165,9 @@ class Options extends Tab if (empty($fields['value'])) { return $formData; } + if (isset($fields['value']['import'])) { + $fields['value'] = $this->prepareCustomOptions($fields['value']); + } foreach ($fields['value'] as $keyRoot => $field) { $formDataItem = null; @@ -118,15 +177,15 @@ class Options extends Tab unset($field['options']); } - $rootLocator = sprintf($this->customOptionRow, $keyRoot + 1); - $rootElement = $this->_rootElement->find($rootLocator); - $this->waitForElementVisible($rootLocator); + $rootLocator = sprintf($this->customOptionRow, $field['title']); + $rootElement = $this->_rootElement->find($rootLocator, Locator::SELECTOR_XPATH); + $this->waitForElementVisible($rootLocator, Locator::SELECTOR_XPATH); $data = $this->dataMapping($field); $formDataItem = $this->_getData($data, $rootElement); // Data collection subform if (isset($field['type']) && !empty($options)) { - /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Options\OptionsAbstract $optionsForm */ + /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Options\AbstractOptions $optionsForm */ $optionsForm = $this->blockFactory->create( __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($field['type']), ['element' => $rootElement] @@ -145,6 +204,20 @@ class Options extends Tab return $formData; } + /** + * Prepare custom options with import options + * + * @param array $options + * @return array + */ + protected function prepareCustomOptions(array $options) + { + $importOptions = $options['import']['options']; + $options = array_merge($options, $importOptions); + unset($options['import']); + return $options; + } + /** * Convert option name * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options/Search/Grid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options/Search/Grid.php new file mode 100644 index 0000000000000000000000000000000000000000..2de58d1a861c1cd46f381db58c01fdc2c024a653 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options/Search/Grid.php @@ -0,0 +1,70 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Options\Search; + +use Magento\Backend\Test\Block\Widget\Grid as GridInterface; + +/** + * Class Grid + * 'Import custom options to product' grid + */ +class Grid extends GridInterface +{ + /** + * Selector for 'Import' button + * + * @var string + */ + protected $importProducts = '#import-custom-options-apply-button'; + + /** + * An element locator which allows to select entities in grid + * + * @var string + */ + protected $selectItem = 'tbody tr .col-id'; + + /** + * Filters param for grid + * + * @var array + */ + protected $filters = [ + 'sku' => [ + 'selector' => 'input[name=sku]' + ], + ]; + + /** + * Press 'Import' button + * + * @return void + */ + public function addProducts() + { + $this->_rootElement->find($this->importProducts)->click(); + $this->getTemplateBlock()->waitForElementNotVisible($this->importProducts); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml index 56f08f31376a55ae9506bfa17c54931e57cfdd3b..1d5f379a164bbe378fd6899b6de37d12aa7d8678 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml @@ -166,7 +166,7 @@ <type> <selector>.field [id$='_type']</selector> <strategy>css selector</strategy> - <input>select</input> + <input>strictselect</input> </type> </fields> </customer-options> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php index af6f96cb6677275f238d29a78dac5ec439e07008..f46da17bfd143c3561f1f89f5c8d5afc88337007 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php @@ -135,7 +135,9 @@ class CustomOptions extends Form */ public function getOptions(FixtureInterface $product = null) { - $dataOptions = ($product && $product->hasData('custom_options')) ? $product->getCustomOptions() : []; + $dataOptions = ($product && $product->hasData('custom_options')) + ? $product->getDataFieldConfig('custom_options')['source']->getCustomOptions() + : []; $listCustomOptions = $this->getListCustomOptions(); $readyOptions = []; $result = []; @@ -406,14 +408,12 @@ class CustomOptions extends Form */ protected function parseOptionText($optionText) { - preg_match('/\+?.([0-9.]+)$/', $optionText, $match); - $optionPrice = isset($match[1]) ? $match[1] : 0; - $optionTitle = isset($match[0]) - ? substr($optionText, 0, strlen($optionText) - strlen($match[0])) - : $optionText; + preg_match('`^(.*?)\+\$(\d.*?)$`', $optionText, $match); + $optionPrice = isset($match[2]) ? str_replace(',', '', $match[2]) : 0; + $optionTitle = isset($match[1]) ? trim($match[1]) : $optionText; return [ - 'title' => trim($optionTitle), + 'title' => $optionTitle, 'price' => $optionPrice ]; } @@ -439,37 +439,104 @@ class CustomOptions extends Form /** * Fill custom options * + * @param FixtureInterface $product * @param array $customOptions * @return void */ - public function fillCustomOptions(array $customOptions) + public function fillCustomOptions(FixtureInterface $product, array $customOptions) { - $type = strtolower(preg_replace('/[^a-zA-Z]/', '', $customOptions['type'])); - $customOptions += $this->dataMapping([$type => []]); + $customOptions = $this->prepareCustomOptions($product, $customOptions); + foreach ($customOptions as $option) { + $this->fillOption($option); + } + } + + /** + * Prepare custom options for fill + * + * @param FixtureInterface $product + * @param array $customOptions + * @return array + */ + protected function prepareCustomOptions(FixtureInterface $product, array $customOptions) + { + $options = []; + $productCustomOptions = $product->hasData('custom_options') + ? $product->getDataFieldConfig('custom_options')['source']->getCustomOptions() + : null; + + if ($productCustomOptions !== null) { + foreach ($customOptions as $key => $option) { + $type = $productCustomOptions[$option['option'] - 1]['type']; + $title = $productCustomOptions[$option['option'] - 1]['title']; + $titleOption = []; + foreach ($option['value'] as $value) { + $titleOption[] = is_numeric($value) + ? $productCustomOptions[$option['option'] - 1]['options'][$value - 1]['title'] + : null; + } + + $options[$key] = $this->dataMapping([$option, $type, $title, $titleOption]); + } + } + + return $options; + } + + /** + * Custom options mapping + * + * @param array|null $fields + * @param string|null $parent + * @return array + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + protected function dataMapping(array $fields = null, $parent = null) + { + list($option, $type, $title, $titleOption) = $fields; + + $isDate = $type == 'Date' || $type == 'Time' || $type == 'Date & Time'; + $isChecked = $type == 'Checkbox' || $type == 'Radio Buttons'; + $isField = $type == 'Field' || $type == 'Area'; - $isDate = $customOptions['type'] == 'Date' || - $customOptions['type'] == 'Time' || - $customOptions['type'] == 'Date & Time'; - $isChecked = $customOptions['type'] == 'Checkbox' || $customOptions['type'] == 'Radio Buttons'; + $optionName = strtolower(preg_replace('/[^a-zA-Z]/', '', $type)); + $option += parent::dataMapping([$optionName => []]); + $selector = [$option[$optionName]['selector']]; if ($isDate) { - $customOptions['value'] = explode('/', $customOptions['value'][0]); - $customOptions['dateSelector'] = $this->setDateTypeSelector(count($customOptions['value'])); + $value = explode('/', $option['value'][0]); + $selector = $this->setDateTypeSelector(count($value), $selector[0]); + } elseif ($isChecked) { + $selector[0] = str_replace('%option_name%', $titleOption[0], $selector[0]); + $value = ['Yes']; + } elseif ($isField) { + $value = $option['value']; + } else { + $value = $titleOption; } - foreach ($customOptions['value'] as $key => $attributeValue) { - $selector = $customOptions[$type]['selector']; - if ($isDate) { - $selector .= $customOptions['dateSelector'][$key]; - } elseif ($isChecked) { - $selector = str_replace('%product_name%', $attributeValue, $selector); - $attributeValue = 'Yes'; - } + return [ + 'title' => $title, + 'value' => $value, + 'selector' => $selector, + 'input' => $option[$optionName]['input'] + ]; + } + /** + * Fill custom option + * + * @param array $customOption + * @return void + */ + public function fillOption(array $customOption) + { + foreach ($customOption['value'] as $key => $attributeValue) { $select = $this->_rootElement->find( - sprintf($this->optionByName, $customOptions['title']) . $selector, + sprintf($this->optionByName, $customOption['title']) . $customOption['selector'][$key], Locator::SELECTOR_XPATH, - $customOptions[$type]['input'] + $customOption['input'] ); $select->setValue($attributeValue); } @@ -479,9 +546,10 @@ class CustomOptions extends Form * Set item data type selector * * @param int $count + * @param string $selector [optional] * @return array */ - protected function setDateTypeSelector($count) + protected function setDateTypeSelector($count, $selector = '') { $result = []; $parent = ''; @@ -489,7 +557,7 @@ class CustomOptions extends Form if (!(($i + 1) % 4)) { $parent = '//span'; } - $result[$i] = $parent . '//select[' . ($i % 3 + 1) . ']'; + $result[$i] = $selector . $parent . '//select[' . ($i % 3 + 1) . ']'; } return $result; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.xml index 44504ba1c175b32744a5ce008c4371775716c27c..af94825cc498b8f986ac87f933755f63d27d6b27 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.xml @@ -34,11 +34,11 @@ <input>multiselect</input> </multipleselect> <checkbox> - <selector>//div[label[span[contains(text(), "%product_name%")]]]/input</selector> + <selector>//div[label[span[contains(text(), "%option_name%")]]]/input</selector> <input>checkbox</input> </checkbox> <radiobuttons> - <selector>//div[label[span[contains(text(), "%product_name%")]]]/input</selector> + <selector>//div[label[span[contains(text(), "%option_name%")]]]/input</selector> <input>checkbox</input> </radiobuttons> <date> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php index 2de9af98ded0acac2c3514680a3c1ea25cdad8f3..751ece734dd175e85847fac5bf0e374eeca1d6c3 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php @@ -24,10 +24,9 @@ namespace Magento\Catalog\Test\Constraint; -use Mtf\Constraint\AbstractAssertForm; use Mtf\Fixture\FixtureInterface; +use Mtf\Constraint\AbstractAssertForm; use Magento\Catalog\Test\Page\Product\CatalogProductView; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; /** * Class AssertProductCustomOptionsOnProductPage @@ -89,6 +88,13 @@ class AssertProductCustomOptionsOnProductPage extends AbstractAssertForm ] ]; + /** + * Flag for verify price data + * + * @var bool + */ + protected $isPrice = true; + /** * Assertion that commodity options are displayed correctly * @@ -98,19 +104,43 @@ class AssertProductCustomOptionsOnProductPage extends AbstractAssertForm */ public function processAssert(CatalogProductView $catalogProductView, FixtureInterface $product) { - // TODO fix initialization url for frontend page - // Open product view page - $catalogProductView->init($product); - $catalogProductView->open(); + $this->openProductPage($catalogProductView, $product); // Prepare data $formCustomOptions = $catalogProductView->getCustomOptionsBlock()->getOptions($product); + $actualPrice = $this->isPrice ? $this->getProductPrice($catalogProductView) : null; + $fixtureCustomOptions = $this->prepareOptions($product, $actualPrice); + + $error = $this->verifyData($fixtureCustomOptions, $formCustomOptions); + \PHPUnit_Framework_Assert::assertEmpty($error, $error); + } + + /** + * Get price from product page + * + * @param CatalogProductView $catalogProductView + * @return string + */ + protected function getProductPrice(CatalogProductView $catalogProductView) + { $prices = $catalogProductView->getViewBlock()->getProductPriceBlock()->getPrice(); $actualPrice = isset($prices['price_special_price']) ? $prices['price_special_price'] : $prices['price_regular_price']; - $fixtureCustomOptions = $this->prepareOptions($product, $actualPrice); - $error = $this->verifyData($fixtureCustomOptions, $formCustomOptions); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); + + return $actualPrice; + } + + /** + * Open product view page + * + * @param CatalogProductView $catalogProductView + * @param FixtureInterface $product + * @return void + */ + protected function openProductPage(CatalogProductView $catalogProductView, FixtureInterface $product) + { + $catalogProductView->init($product); + $catalogProductView->open(); } /** @@ -119,12 +149,15 @@ class AssertProductCustomOptionsOnProductPage extends AbstractAssertForm * @param FixtureInterface $product * @param int|null $actualPrice * @return array + * + * @SuppressWarnings(PHPMD.NPathComplexity) */ protected function prepareOptions(FixtureInterface $product, $actualPrice = null) { - $customOptions = $product->getCustomOptions(); $result = []; - + $customOptions = $product->hasData('custom_options') + ? $product->getDataFieldConfig('custom_options')['source']->getCustomOptions() + : null; $actualPrice = $actualPrice ? $actualPrice : $product->getPrice(); foreach ($customOptions as $customOption) { $skippedField = isset($this->skippedFieldOptions[$customOption['type']]) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php index 2fde4a0da852f217a420b93b919445f86b5151b8..93defce60ad9fa1bdb255d042ffa89431b7f5609 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php @@ -80,7 +80,7 @@ class AssertProductDuplicateForm extends AssertProductForm $productGrid->open()->getProductGrid()->searchAndOpen($filter); $formData = $productPage->getForm()->getData($product); - $fixtureData = $this->prepareFixtureData($product->getData()); + $fixtureData = $this->prepareFixtureData($product->getData(), $product); $errors = $this->verifyData($fixtureData, $formData); \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); @@ -90,10 +90,11 @@ class AssertProductDuplicateForm extends AssertProductForm * Prepares fixture data for comparison * * @param array $data + * @param FixtureInterface $product * @param array $sortFields [optional] * @return array */ - protected function prepareFixtureData(array $data, array $sortFields = []) + protected function prepareFixtureData(array $data, FixtureInterface $product, array $sortFields = []) { $compareData = array_filter($data); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php index b5ade64e7f27a5c7e485181a237e26a10a99df1f..46d4fe28d6fce5b0b853d81c0585f7fa2b34f2e4 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php @@ -39,7 +39,16 @@ class AssertProductForm extends AbstractAssertForm * * @var array */ - protected $sortFields = []; + protected $sortFields = [ + 'custom_options::title' + ]; + + /** + * Formatting options for array values + * + * @var array + */ + protected $specialArray = []; /** * Constraint severeness @@ -65,7 +74,7 @@ class AssertProductForm extends AbstractAssertForm $productGrid->open(); $productGrid->getProductGrid()->searchAndOpen($filter); - $fixtureData = $this->prepareFixtureData($product->getData(), $this->sortFields); + $fixtureData = $this->prepareFixtureData($product->getData(), $product, $this->sortFields); $formData = $this->prepareFormData($productPage->getForm()->getData($product), $this->sortFields); $error = $this->verifyData($fixtureData, $formData); \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); @@ -75,14 +84,21 @@ class AssertProductForm extends AbstractAssertForm * Prepares fixture data for comparison * * @param array $data + * @param FixtureInterface $product * @param array $sortFields [optional] * @return array */ - protected function prepareFixtureData(array $data, array $sortFields = []) + protected function prepareFixtureData(array $data, FixtureInterface $product, array $sortFields = []) { if (isset($data['website_ids']) && !is_array($data['website_ids'])) { $data['website_ids'] = [$data['website_ids']]; } + if (isset($data['custom_options'])) { + $data['custom_options'] = $product->getDataFieldConfig('custom_options')['source']->getCustomOptions(); + } + if (!empty($this->specialArray)) { + $data = $this->prepareSpecialPriceArray($data); + } foreach ($sortFields as $path) { $data = $this->sortDataByPath($data, $path); @@ -90,6 +106,24 @@ class AssertProductForm extends AbstractAssertForm return $data; } + /** + * Prepare special price array for product + * + * @param array $fields + * @return array + */ + protected function prepareSpecialPriceArray(array $fields) + { + foreach ($this->specialArray as $key => $value) { + if (array_key_exists($key, $fields)) { + if (isset($value['type']) && $value['type'] == 'date') { + $fields[$key] = vsprintf('%d/%d/%d', explode('/', $fields[$key])); + } + } + } + return $fields; + } + /** * Prepares form data for comparison * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php index d34ea99c6890949d5783cada18d268ebab3ae4ed..f029c62865b7fcbe8ba589c8b433204e52fc6cb4 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php @@ -591,6 +591,12 @@ class CatalogProductSimple extends InjectableFixture 'source' => 'Magento\Backend\Test\Fixture\Date', ]; + protected $stock_data = [ + 'attribute_code' => 'stock_data', + 'backend_type' => 'virtual', + 'group' => 'advanced-inventory' + ]; + public function getCategoryIds() { return $this->getData('category_ids'); @@ -880,4 +886,9 @@ class CatalogProductSimple extends InjectableFixture { return $this->getData('news_to_date'); } + + public function getStockDate() + { + return $this->getData('stock_data'); + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml index 52b9547ef7ff82391d79a5c3d2b3473d520eb9ef..8f88072b9836d6c9af8b0c81c472d0628ff4cace 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml @@ -454,6 +454,11 @@ <input>select</input> <group>autosettings</group> </is_returnable> + <stock_data> + <attribute_code>stock_data</attribute_code> + <backend_type>virtual</backend_type> + <group>advanced-inventory</group> + </stock_data> </fields> <data_set> <sku></sku> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php index ae564f6f61f72de0f354e040ae0cacdd01f91b5c..6eb83048281cec2644fca2ed27293d5fd2442b43 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php @@ -24,6 +24,7 @@ namespace Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Mtf\Fixture\FixtureFactory; use Mtf\Fixture\FixtureInterface; /** @@ -32,25 +33,80 @@ use Mtf\Fixture\FixtureInterface; * * Data keys: * - preset (Custom options preset name) - * - products (comma separated sku identifiers) + * - import_products (comma separated data set name) */ class CustomOptions implements FixtureInterface { /** - * @var \Mtf\Fixture\FixtureFactory + * Prepared dataSet data + * + * @var array + */ + protected $data; + + /** + * Custom options data + * + * @var array */ - protected $fixtureFactory; + protected $customOptions; /** + * Data set configuration settings + * + * @var array + */ + protected $params; + + /** + * @constructor * @param array $params * @param array $data + * @param FixtureFactory|null $fixtureFactory */ - public function __construct(array $params, array $data = []) + public function __construct(array $params, array $data, FixtureFactory $fixtureFactory) { $this->params = $params; if (isset($data['preset'])) { - $this->data = $this->getPreset($data['preset']); + $this->data = $this->replaceData($this->getPreset($data['preset']), mt_rand()); + $this->customOptions = $this->data; + } + if (isset($data['import_products'])) { + $importData = explode(',', $data['import_products']); + $importCustomOptions = []; + $importProducts = []; + foreach ($importData as $item) { + list($fixture, $dataSet) = explode('::', $item); + $product = $fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]); + if ($product->hasData('id') !== null) { + $product->persist(); + } + $importCustomOptions = array_merge($importCustomOptions, $product->getCustomOptions()); + $importProducts[] = $product->getSku(); + } + $this->customOptions = array_merge($this->data, $importCustomOptions); + $this->data['import'] = ['options' => $importCustomOptions, 'products' => $importProducts]; + } + } + + /** + * Replace custom options data + * + * @param array $data + * @param int $replace + * @return array + */ + protected function replaceData(array $data, $replace) + { + $result = []; + foreach ($data as $key => $value) { + if (is_array($value)) { + $value = $this->replaceData($value, $replace); + } + $result[$key] = str_replace('%isolation%', $replace, $value); } + + return $result; } /** @@ -66,7 +122,7 @@ class CustomOptions implements FixtureInterface /** * Return prepared data set * - * @param $key [optional] + * @param string $key [optional] * @return mixed * * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -76,6 +132,16 @@ class CustomOptions implements FixtureInterface return $this->data; } + /** + * Return all custom options + * + * @return array + */ + public function getCustomOptions() + { + return $this->customOptions; + } + /** * Return data set configuration settings * @@ -97,7 +163,7 @@ class CustomOptions implements FixtureInterface $presets = [ 'MAGETWO-23062' => [ [ - 'title' => 'custom option drop down', + 'title' => 'custom option drop down %isolation%', 'is_require' => 'Yes', 'type' => 'Drop-down', 'options' => [ @@ -112,7 +178,7 @@ class CustomOptions implements FixtureInterface ], 'MAGETWO-23063' => [ [ - 'title' => 'custom option drop down', + 'title' => 'custom option drop down %isolation%', 'is_require' => 'Yes', 'type' => 'Drop-down', 'options' => [ @@ -127,7 +193,7 @@ class CustomOptions implements FixtureInterface ], 'MAGETWO-23066' => [ [ - 'title' => 'custom option drop down', + 'title' => 'custom option drop down %isolation%', 'is_require' => 'Yes', 'type' => 'Drop-down', 'options' => [ @@ -142,7 +208,7 @@ class CustomOptions implements FixtureInterface ], 'MAGETWO-23069' => [ [ - 'title' => 'custom option drop down', + 'title' => 'custom option drop down %isolation%', 'is_require' => 'Yes', 'type' => 'Drop-down', 'options' => [ @@ -223,7 +289,7 @@ class CustomOptions implements FixtureInterface ], 'default' => [ [ - 'title' => 'custom option drop down', + 'title' => 'custom option drop down %isolation%', 'is_require' => 'Yes', 'type' => 'Drop-down', 'options' => [ @@ -236,7 +302,7 @@ class CustomOptions implements FixtureInterface ] ], [ - 'title' => 'custom option drop down2', + 'title' => 'custom option drop down2 %isolation%', 'is_require' => 'Yes', 'type' => 'Drop-down', 'options' => [ @@ -251,7 +317,7 @@ class CustomOptions implements FixtureInterface ], 'two_options' => [ [ - 'title' => 'custom option drop down', + 'title' => 'custom option drop down %isolation%', 'is_require' => 'Yes', 'type' => 'Drop-down', 'options' => [ @@ -264,15 +330,15 @@ class CustomOptions implements FixtureInterface ] ], [ - 'title' => 'custom option drop down2', + 'title' => 'custom option field %isolation%', 'is_require' => 'Yes', - 'type' => 'Drop-down', + 'type' => 'Field', 'options' => [ [ - 'title' => '20 percent', - 'price' => 20, - 'price_type' => 'Percent', - 'sku' => 'sku_drop_down_row_2' + 'price' => 10, + 'price_type' => 'Fixed', + 'sku' => 'sku_field_option_%isolation%', + 'max_characters' => 1024 ] ] ] @@ -408,10 +474,9 @@ class CustomOptions implements FixtureInterface ] ], [ - //TODO fixed setValue() for select type (contains => "=") 'title' => 'custom option Time %isolation%', 'is_require' => 'Yes', - 'type' => 'Date & Time', + 'type' => 'Time', 'options' => [ [ 'price' => 20, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php index 94226e34082b0c65a39bedb1c4f568d8f474cc2b..82523cf8cec15ed17936e1e1686b1de18d63a59e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php @@ -47,6 +47,10 @@ class Curl extends AbstractCurl implements CatalogProductSimpleInterface 'Yes' => 1, 'No' => 0 ], + 'use_config_notify_stock_qty' => [ + 'Yes' => 1, + 'No' => 0 + ], 'is_shareable' => [ 'Yes' => 1, 'No' => 0, @@ -91,6 +95,10 @@ class Curl extends AbstractCurl implements CatalogProductSimpleInterface 'status' => [ 'Product offline' => 2, 'Product online' => 1 + ], + 'is_require' => [ + 'Yes' => 1, + 'No' => 0 ] ]; @@ -115,6 +123,13 @@ class Curl extends AbstractCurl implements CatalogProductSimpleInterface ] ]; + /** + * Select custom options + * + * @var array + */ + protected $selectOptions = ['Drop-down', 'Radio Buttons', 'Checkbox', 'Multiple Select']; + /** * Post request for creating simple product * @@ -158,14 +173,17 @@ class Curl extends AbstractCurl implements CatalogProductSimpleInterface } $fields['category_ids'] = $categoryIds; } - + if (isset($fields['tier_price'])) { $fields['tier_price'] = $this->preparePriceData($fields['tier_price']); } if (isset($fields['group_price'])) { $fields['group_price'] = $this->preparePriceData($fields['group_price']); } - + if ($isCustomOptions = isset($fields['custom_options'])) { + $fields = $this->prepareCustomOptionsData($fields); + } + if (!empty($fields['website_ids'])) { foreach ($fields['website_ids'] as &$value) { $value = isset($this->mappingData['website_ids'][$value]) @@ -184,8 +202,56 @@ class Curl extends AbstractCurl implements CatalogProductSimpleInterface } $fields = $this->prepareStockData($fields); + $fields = $prefix ? [$prefix => $fields] : $fields; + if ($isCustomOptions) { + $fields['affect_product_custom_options'] = 1; + } + + return $fields; + } - return $prefix ? [$prefix => $fields] : $fields; + /** + * Preparation of custom options data + * + * @param array $fields + * @return array + */ + protected function prepareCustomOptionsData(array $fields) + { + $options = []; + foreach ($fields['custom_options'] as $key => $customOption) { + $options[$key] = ['option_id' => 0, 'is_delete' => '']; + foreach ($customOption['options'] as $index => $option) { + $customOption['options'][$index]['is_delete'] = ''; + $customOption['options'][$index]['price_type'] = strtolower($option['price_type']); + } + $options[$key] += in_array($customOption['type'], $this->selectOptions) + ? ['values' => $customOption['options']] + : $customOption['options'][0]; + unset($customOption['options']); + $options[$key] += $customOption; + $options[$key]['type'] = $this->optionNameConvert($customOption['type']); + } + $fields['options'] = $options; + unset($fields['custom_options']); + + return $fields; + } + + /** + * Convert option name + * + * @param string $optionName + * @return string + */ + protected function optionNameConvert($optionName) + { + $optionName = str_replace(['-', ' & '], "_", trim($optionName)); + $end = strpos($optionName, ' '); + if ($end !== false) { + $optionName = substr($optionName, 0, $end); + } + return strtolower($optionName); } /** @@ -275,7 +341,7 @@ class Curl extends AbstractCurl implements CatalogProductSimpleInterface protected function createProduct(array $data, array $config) { $url = $this->getUrl($config); - $curl = new BackendDecorator(new CurlTransport(), new Config); + $curl = new BackendDecorator(new CurlTransport(), new Config()); $curl->addOption(CURLOPT_HEADER, 1); $curl->write(CurlInterface::POST, $url, '1.0', [], $data); $response = $curl->read(); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.php index 6d2d48f49501bd3abe32bc2924c8dd0af3ce1e89..b770f0bbc7370559c8a1706e0cb46db8e4d6399a 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.php @@ -251,5 +251,43 @@ class CatalogProductSimple extends AbstractRepository 'weight' => 1, 'tier_price' => ['preset' => 'default'], ]; + + $this->_data['with_two_custom_option'] = [ + 'type_id' => 'simple', + 'attribute_set_id' => ['dataSet' => 'default'], + 'name' => 'Simple Product %isolation%', + 'sku' => 'sku_simple_product_%isolation%', + 'price' => ['value' => 300, 'preset' => '-'], + 'weight' => 1, + 'custom_options' => ['preset' => 'two_options'], + ]; + + $this->_data['with_all_custom_option'] = [ + 'type_id' => 'simple', + 'attribute_set_id' => ['dataSet' => 'default'], + 'name' => 'Simple Product %isolation%', + 'sku' => 'sku_simple_product_%isolation%', + 'price' => ['value' => 300, 'preset' => '-'], + 'weight' => 1, + 'custom_options' => ['preset' => 'all_types'], + ]; + + $this->_data['low_stock_product'] = [ + 'sku' => 'low_stock_product%isolation%', + 'name' => 'low_stock_product%isolation%', + 'type_id' => 'simple', + 'quantity_and_stock_status' => [ + 'qty' => 1.0000, + 'is_in_stock' => 'In Stock', + ], + 'stock_data' => [ + 'use_config_notify_stock_qty' => 'No', + 'notify_stock_qty' => 2, + ], + 'weight' => 1, + 'attribute_set_id' => ['dataSet' => 'default'], + 'price' => ['value' => 100, 'preset' => '-'], + 'website_ids' => ['Main Website'], + ]; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv index 3fdd14092f40ecdac812115e979275b306efd906..2741e51bef7c09d7f87f9805a49b6a33f9392eea 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest/testCreate.csv @@ -1,19 +1,19 @@ -"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"constraint";"product/data/custom_options/preset";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"MAGETWO-23062";"MAGETWO-23062";"-";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"MAGETWO-23063";"MAGETWO-23063";"-";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"MAGETWO-23062";"MAGETWO-23029";"-";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"MAGETWO-23063";"MAGETWO-23030";"-";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"MAGETWO-23063";"MAGETWO-23030";"MAGETWO-23055";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"MAGETWO-23062";"MAGETWO-23029";"MAGETWO-23055";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"MAGETWO-23063";"MAGETWO-23030";"-";"MAGETWO-23002" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"MAGETWO-23062";"MAGETWO-23029";"-";"MAGETWO-23002" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage";"-";"-";"-";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"assertProductSaveMessage, assertProductInStock";"-";"-";"-";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"assertProductSaveMessage, assertProductOutOfStock";"-";"-";"-";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"Search";"assertProductSaveMessage, assertProductSearchableBySku";"-";"-";"-";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage";"-";"-";"-";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"-";"-";"-";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"Taxable Goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage";"-";"-";"default";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"Taxable Goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"-";"-";"-";"-" -"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"-";"-";"-";"default" -"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"options-suite";"-";"-";"-" +"product/data/name";"product/data/sku";"product/data/tax_class_id/dataSet";"product/data/price/value";"product/data/special_price";"product/data/short_description";"product/data/description";"product/data/weight";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/visibility";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/price/preset";"product/data/group_price/preset";"product/data/tier_price/preset";"constraint";"issue" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10000";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"50";"657";"-";"-";"MAGETWO-23062";"-";"MAGETWO-23062";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10001";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"51";"658";"-";"-";"MAGETWO-23063";"-";"MAGETWO-23063";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10002";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"52";"659";"-";"-";"MAGETWO-23062";"-";"MAGETWO-23029";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10003";"90";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"53";"660";"-";"-";"MAGETWO-23063";"-";"MAGETWO-23030";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10004";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"54";"661";"-";"-";"MAGETWO-23063";"-";"MAGETWO-23030";"MAGETWO-23055";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10005";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"55";"662";"-";"-";"MAGETWO-23062";"-";"MAGETWO-23029";"MAGETWO-23055";"-";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10006";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"56";"663";"-";"-";"MAGETWO-23063";"-";"MAGETWO-23030";"-";"MAGETWO-23002";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10007";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"57";"664";"-";"-";"MAGETWO-23062";"-";"MAGETWO-23029";"-";"MAGETWO-23002";"assertProductSaveMessage, assertProductInGrid, assertProductInCategory, assertProductPage, assertProductInCart";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10008";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"58";"665";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductVisibleInCategory, assertProductPage";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10009";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"59";"75";"In Stock";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInStock";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10010";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"60";"0";"Out of Stock";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10011";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"61";"138";"-";"Search";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductSearchableBySku";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10012";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"62";"139";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductSearchableBySku, assertProductPage";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10013";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"63";"140";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"Taxable Goods";"10014";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"64";"141";"-";"-";"-";"-";"-";"default";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductGroupedPriceOnProductPage";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"Taxable Goods";"10015";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"65";"142";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductSpecialPriceOnProductPage";"" +"Simple Product %isolation%";"simple_sku_%isolation%";"None";"10016";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"66";"143";"-";"-";"-";"-";"-";"-";"default";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductTierPriceOnProductPage";"Bug: MAGETWO-26853" +"Simple Product %isolation%";"simple_sku_%isolation%";"-";"10017";"-";"Simple Product short_description %isolation%";"Simple Product description %isolation%";"67";"144";"-";"-";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductInStock, assertProductVisibleInCategory, assertProductPage, assertProductCustomOptionsOnProductPage";"" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest/testCreate.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest/testCreate.csv index 204ed2c43a4a96f7b539b4b0f2bce8248a26626c..cbc73ef8063d886dd04e81380951c882ea9c5a25 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest/testCreate.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest/testCreate.csv @@ -1,8 +1,8 @@ -"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/is_virtual";"product/data/category";"product/data/group_price/preset";"product/data/price/preset";"product/data/tier_price/preset";"product/data/inventory_manage_stock";"product/data/quantity_and_stock_status/is_in_stock";"product/data/custom_options/preset";"product/data/visibility";"constraint" -"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid" -"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"None";"999";"Yes";"category_%isolation%";"-";"-";"MAGETWO-23002";"Yes";"In Stock";"-";"Catalog, Search";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductForm, assertProductSearchableBySku" -"VirtualProduct %isolation%";"-";"10";"Taxable Goods";"999";"Yes";"-";"-";"MAGETWO-23030";"-";"-";"Out of Stock";"-";"Search";"assertProductSaveMessage, assertProductForm, assertProductSkuAutoGenerated, assertProductSearchableBySku" -"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"-";"Yes";"category_%isolation%";"MAGETWO-23055";"-";"-";"-";"-";"-";"Catalog";"assertProductSaveMessage, assertProductForm, assertProductVisibleInCategory" -"VirtualProduct %isolation%";"virtual_sku_%isolation%";"9000";"-";"-";"Yes";"-";"MAGETWO-23055";"-";"-";"-";"-";"options-suite";"-";"assertProductSaveMessage, assertProductSearchableBySku, assertProductPage, assertProductGroupedPriceOnProductPage, assertProductCustomOptionsOnProductPage" -"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"999";"Yes";"-";"-";"MAGETWO-23030";"-";"No";"In Stock";"-";"-";"assertProductSaveMessage, assertProductPage, assertProductSpecialPriceOnProductPage, assertProductInStock" -"VirtualProduct %isolation%";"virtual_sku_%isolation%";"9000";"-";"999";"Yes";"-";"-";"-";"default";"-";"Out of Stock";"-";"-";"assertProductSaveMessage, assertProductPage, assertProductTierPriceOnProductPage, assertProductOutOfStock" +"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/is_virtual";"product/data/category";"product/data/group_price/preset";"product/data/price/preset";"product/data/tier_price/preset";"product/data/inventory_manage_stock";"product/data/quantity_and_stock_status/is_in_stock";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/visibility";"constraint" +"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid" +"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"None";"999";"Yes";"category_%isolation%";"-";"-";"MAGETWO-23002";"Yes";"In Stock";"-";"-";"Catalog, Search";"assertProductSaveMessage, assertProductVisibleInCategory, assertProductForm, assertProductSearchableBySku" +"VirtualProduct %isolation%";"-";"10";"Taxable Goods";"999";"Yes";"-";"-";"MAGETWO-23030";"-";"-";"Out of Stock";"-";"-";"Search";"assertProductSaveMessage, assertProductForm, assertProductSkuAutoGenerated, assertProductSearchableBySku" +"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"-";"Yes";"category_%isolation%";"MAGETWO-23055";"-";"-";"-";"-";"-";"-";"Catalog";"assertProductSaveMessage, assertProductForm, assertProductVisibleInCategory" +"VirtualProduct %isolation%";"virtual_sku_%isolation%";"9000";"-";"-";"Yes";"-";"MAGETWO-23055";"-";"-";"-";"-";"options-suite";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"assertProductSaveMessage, assertProductSearchableBySku, assertProductPage, assertProductGroupedPriceOnProductPage, assertProductCustomOptionsOnProductPage" +"VirtualProduct %isolation%";"virtual_sku_%isolation%";"10";"-";"999";"Yes";"-";"-";"MAGETWO-23030";"-";"No";"In Stock";"-";"-";"-";"assertProductSaveMessage, assertProductPage, assertProductSpecialPriceOnProductPage, assertProductInStock" +"VirtualProduct %isolation%";"virtual_sku_%isolation%";"9000";"-";"999";"Yes";"-";"-";"-";"default";"-";"Out of Stock";"-";"-";"-";"assertProductSaveMessage, assertProductPage, assertProductTierPriceOnProductPage, assertProductOutOfStock" diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableProductForm.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableProductForm.php index c52f86168016c2e3e3c7ce92ad9dab9f38722659..217490e3c10d1fed7cb21342516d00eeae23d1e1 100755 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableProductForm.php @@ -24,10 +24,7 @@ namespace Magento\Downloadable\Test\Constraint; -use Mtf\Fixture\FixtureInterface; use Magento\Catalog\Test\Constraint\AssertProductForm; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; /** * Class AssertDownloadableProductForm @@ -41,43 +38,4 @@ class AssertDownloadableProductForm extends AssertProductForm * @var array */ protected $sortFields = ['downloadable_links/downloadable/link::sort_order']; - - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - - /** - * Assert form data equals fixture data - * - * @param FixtureInterface $product - * @param CatalogProductIndex $productGrid - * @param CatalogProductEdit $productPage - * @return void - */ - public function processAssert( - FixtureInterface $product, - CatalogProductIndex $productGrid, - CatalogProductEdit $productPage - ) { - $filter = ['sku' => $product->getData('sku')]; - $productGrid->open()->getProductGrid()->searchAndOpen($filter); - - $fieldsFixture = $this->prepareFixtureData($product->getData(), $this->sortFields); - $fieldsForm = $this->prepareFormData($productPage->getForm()->getData($product), $this->sortFields); - $error = $this->verifyData($fieldsFixture, $fieldsForm); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Text of Visible in product form assert - * - * @return string - */ - public function toString() - { - return 'Form data equal the fixture data.'; - } } diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/testCreateDownloadableProduct.csv b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/testCreateDownloadableProduct.csv index 59d2c37991d66c19de9aac686266cab640bbd29d..1a84344a633592e923de242cb4804ac54ad28ad9 100755 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/testCreateDownloadableProduct.csv +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/testCreateDownloadableProduct.csv @@ -1,15 +1,15 @@ -product/data/name;product/data/sku;product/data/price/value;product/data/tax_class_id/dataSet;product/data/quantity_and_stock_status/qty;product/data/quantity_and_stock_status/is_in_stock;product/data/is_virtual;product/data/category;product/data/description;product/data/short_description;product/data/stock_data/manage_stock;product/data/stock_data/qty;product/data/stock_data/use_config_min_qty;product/data/stock_data/min_qty;product/data/downloadable_sample/preset;product/data/downloadable_links/preset;product/data/custom_options/preset;product/data/special_price;product/data/group_price/preset;product/data/tier_price/preset;constraint -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;100;Taxable Goods;1;In Stock;Yes;Default Category;-;-;-;-;-;-;-;default;-;-;-;-;assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertProductInStock -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;1;Taxable Goods;10;In Stock;Yes;category %isolation%;-;-;-;-;-;-;default;default;-;-;-;-;assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertDownloadableSamplesData, assertDownloadableLinksData -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;33;Taxable Goods;10;In Stock;Yes;category %isolation%;-;-;-;-;-;-;-;default;default;-;-;-;assertProductSaveMessage, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;55;Taxable Goods;10;In Stock;Yes;-;-;-;-;-;-;-;with_three_samples;with_three_links;two_options;-;-;-;assertProductSaveMessage, assertProductCustomOptionsOnProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData, assertProductInStock, assertProductSearchableBySku -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;100;Taxable Goods;50;Out of Stock;Yes;Default Category;-;-;-;-;-;-;-;default;-;-;-;-;assertProductSaveMessage, assertProductOutOfStock, assertProductInGrid, assertDownloadableProductForm -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;9999;Taxable Goods;-;-;Yes;Default Category;-;-;Yes;123;No;123;-;default;-;-;-;-;assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductOutOfStock -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;98;None;5;In Stock;Yes;Default Category;This is description for downloadable product;-;-;-;-;-;-;default;-;-;-;-;assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;57;Taxable Goods;10;In Stock;Yes;category %isolation%;-;This is short description for downloadable product;-;-;-;-;default;with_three_links;default;-;-;-;assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;65;Taxable Goods;11;In Stock;Yes;category %isolation%;This is description for downloadable product;This is short description for downloadable product;-;-;-;-;default;with_three_links;default;-;-;-;assertProductSaveMessage, assertProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;65;Taxable Goods;11;In Stock;Yes;category %isolation%;-;-;-;-;-;-;default;with_three_links;default;-;-;-;assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertDownloadableLinksData, assertProductCustomOptionsOnProductPage -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;100;Taxable Goods;-;-;Yes;Default Category;-;-;-;-;-;-;-;default;-;-;-;-;assertProductSaveMessage, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;10;Taxable Goods;10;In Stock;Yes;category %isolation%;-;-;-;-;-;-;-;-;-;5;-;-;assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;365;Taxable Goods;23;In Stock;Yes;category %isolation%;-;-;-;-;-;-;-;-;-;-;default;-;assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage -DownloadableProduct_%isolation%;DownloadableProduct_%isolation%;250;Taxable Goods;65;In Stock;Yes;category %isolation%;-;-;-;-;-;-;-;-;-;-;-;default;assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage \ No newline at end of file +"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/is_virtual";"product/data/category";"product/data/description";"product/data/short_description";"product/data/stock_data/manage_stock";"product/data/stock_data/qty";"product/data/stock_data/use_config_min_qty";"product/data/stock_data/min_qty";"product/data/downloadable_sample/preset";"product/data/downloadable_links/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/special_price";"product/data/group_price/preset";"product/data/tier_price/preset";"constraint";"issue" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"1";"In Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertProductInStock";"" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertDownloadableSamplesData, assertDownloadableLinksData";"Bug: MAGETWO-26676" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"33";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData";"" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"55";"Taxable Goods";"10";"In Stock";"Yes";"-";"-";"-";"-";"-";"-";"-";"with_three_samples";"with_three_links";"two_options";"-";"-";"-";"-";"assertProductSaveMessage, assertProductCustomOptionsOnProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData, assertProductInStock, assertProductSearchableBySku";"" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"50";"Out of Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductOutOfStock, assertProductInGrid, assertDownloadableProductForm";"" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"9999";"Taxable Goods";"-";"-";"Yes";"Default Category";"-";"-";"Yes";"123";"No";"123";"-";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductOutOfStock";"" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"98";"None";"5";"In Stock";"Yes";"Default Category";"This is description for downloadable product";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage";"" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"57";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData";"Bug: MAGETWO-26676" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"Taxable Goods";"11";"In Stock";"Yes";"category %isolation%";"This is description for downloadable product";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData";"Bug: MAGETWO-26676" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"Taxable Goods";"11";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertDownloadableLinksData, assertProductCustomOptionsOnProductPage";"" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"-";"-";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage";"" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"10";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"5";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage";"" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"365";"Taxable Goods";"23";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage";"" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"250";"Taxable Goods";"65";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage";"Bug: MAGETWO-26853" diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Grid.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Grid.php index d25a5e0cb5b6326008ce3fcd74719f8fa8acaefa..1ff86e647f2ca27f1ffeb579056e5e5123e6ccb9 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Grid.php @@ -24,24 +24,40 @@ namespace Magento\Newsletter\Test\Block\Adminhtml\Template; -use Magento\Backend\Test\Block\Widget\Grid as AbstractGrid; +use Mtf\Client\Element\Locator; /** * Class Grid * Newsletter templates grid block - * - * @package Magento\Newsletter\Test\Block\Aminhtml\Template */ -class Grid extends AbstractGrid +class Grid extends \Magento\Backend\Test\Block\Widget\Grid { /** * Filters array mapping * - * @var array $filters + * @var array */ protected $filters = [ 'code' => [ - 'selector' => '[data-ui-id="widget-grid-column-filter-text-1-filter-code"]' + 'selector' => 'input[name="code"]' ] ]; + + /** + * Locator for "Action" + * + * @var string + */ + protected $action = '.action-select'; + + /** + * Action for newsletter template + * + * @param string $action + * @return void + */ + public function performAction($action) + { + $this->_rootElement->find($this->action, Locator::SELECTOR_CSS, 'select')->setValue($action); + } } diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Preview.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Preview.php new file mode 100644 index 0000000000000000000000000000000000000000..726517308e85b658b791046e106f2eedacc3580d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Preview.php @@ -0,0 +1,76 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Newsletter\Test\Block\Adminhtml\Template; + +use Mtf\Block\Block; +use Mtf\Client\Browser; +use Mtf\Client\Element; +use Mtf\Block\BlockFactory; +use Mtf\Client\Element\Locator; + +/** + * Class Preview + * Newsletter template preview + */ +class Preview extends Block +{ + /** + * Browser + * + * @var Browser + */ + protected $browser; + + /** + * IFrame locator + * + * @var string + */ + protected $iFrame = '#preview_iframe'; + + /** + * Constructor + * + * @param Element $element + * @param BlockFactory $blockFactory + * @param Browser $browser + */ + public function __construct(Element $element, BlockFactory $blockFactory, Browser $browser) + { + $this->browser = $browser; + parent::__construct($element, $blockFactory); + } + + /** + * Get page content text + * + * @return string + */ + public function getPageContent() + { + $this->browser->switchToFrame(new Locator($this->iFrame)); + return $this->_rootElement->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterPreview.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterPreview.php new file mode 100644 index 0000000000000000000000000000000000000000..9689e2d6b916da202d058a66e8acd3a58301ae3f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterPreview.php @@ -0,0 +1,74 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Newsletter\Test\Constraint; + +use Mtf\Client\Browser; +use Mtf\Constraint\AbstractConstraint; +use Magento\Newsletter\Test\Fixture\Template; +use Magento\Newsletter\Test\Page\Adminhtml\TemplatePreview; + +/** + * Class AssertNewsletterPreview + * Assert that newsletter preview opened in new window and template content correct + */ +class AssertNewsletterPreview extends AbstractConstraint +{ + /** + * Constraint severeness + * + * @var string + */ + protected $severeness = 'low'; + + /** + * Assert that newsletter preview opened in new window and template content correct + * + * @param Browser $browser + * @param TemplatePreview $templatePreview + * @param Template $newsletter + * @return void + */ + public function processAssert(Browser $browser, TemplatePreview $templatePreview, Template $newsletter) + { + $browser->selectWindow(); + $content = $templatePreview->getContent()->getPageContent(); + $browser->closeWindow(); + \PHPUnit_Framework_Assert::assertEquals( + $content, + $newsletter->getText(), + 'Template content not correct information.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Newsletter preview opened in new window and has valid content.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueue.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueue.php new file mode 100644 index 0000000000000000000000000000000000000000..323867028a30c9a650e1e22eda7793c1754a082d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueue.php @@ -0,0 +1,73 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Newsletter\Test\Constraint; + +use Mtf\Constraint\AbstractAssertForm; +use Magento\Newsletter\Test\Fixture\Template; +use Magento\Newsletter\Test\Page\Adminhtml\TemplateQueue; + +/** + * Class AssertNewsletterQueue + * Assert that "Edit Queue" page opened and subject, sender name, sender email and template content correct + */ +class AssertNewsletterQueue extends AbstractAssertForm +{ + /** + * Skipped fields for verify data + * + * @var array + */ + protected $skippedFields = ['code']; + + /** + * Constraint severeness + * + * @var string + */ + protected $severeness = 'low'; + + /** + * Assert that "Edit Queue" page opened and subject, sender name, sender email and template content correct + * + * @param TemplateQueue $templateQueue + * @param Template $newsletter + * @return void + */ + public function processAssert(TemplateQueue $templateQueue, Template $newsletter) + { + $dataDiff = $this->verifyData($newsletter->getData(), $templateQueue->getEditForm()->getData($newsletter)); + \PHPUnit_Framework_Assert::assertEmpty($dataDiff, $dataDiff); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Edit Queue content equals to passed from fixture.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.php index 8d6b2e95eb6542337108df8fe0fe5bb7af24e44b..4c106dbe34c1d7fed0308abf6dc26a90d9ac21ec 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.php @@ -28,11 +28,20 @@ use Mtf\Fixture\InjectableFixture; /** * Class Template - * - * @package Magento\Newsletter\Test\Fixture + * Template fixture */ class Template extends InjectableFixture { + /** + * @var string + */ + protected $repositoryClass = 'Magento\Newsletter\Test\Repository\Template'; + + /** + * @var string + */ + protected $handlerInterface = 'Magento\Newsletter\Test\Handler\Template\TemplateInterface'; + protected $defaultDataSet = [ 'code' => 'TemplateName%isolation%', 'subject' => 'TemplateSubject%isolation%', diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.xml index 8cbfa452add0d2e1b3b9127eb71391094399a9a4..2e867e6a4919aee2207e0ba91309f7fbe225f4aa 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Template.xml @@ -115,4 +115,6 @@ <input/> </modified_at> </fields> + <repository_class>Magento\Newsletter\Test\Repository\Template</repository_class> + <handler_interface>Magento\Newsletter\Test\Handler\Newsletter\TemplateInterface</handler_interface> </fixture> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Handler/Template/Curl.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Handler/Template/Curl.php new file mode 100644 index 0000000000000000000000000000000000000000..f0dcdb4db2127396f664f9ea01c929e21ff62446 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Handler/Template/Curl.php @@ -0,0 +1,65 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Newsletter\Test\Handler\Template; + +use Mtf\System\Config; +use Mtf\Fixture\FixtureInterface; +use Mtf\Util\Protocol\CurlInterface; +use Mtf\Util\Protocol\CurlTransport; +use Mtf\Handler\Curl as AbstractCurl; +use Mtf\Util\Protocol\CurlTransport\BackendDecorator; + +/** + * Class Curl + * Creation Newsletter Template + */ +class Curl extends AbstractCurl implements TemplateInterface +{ + /** + * URL for newsletter template + * + * @var string + */ + protected $url = 'newsletter/template/save/'; + + /** + * @param FixtureInterface $fixture [optional] + * @throws \Exception + * @return mixed|void + */ + public function persist(FixtureInterface $fixture = null) + { + $url = $_ENV['app_backend_url'] . $this->url; + $data = $this->replaceMappingData($fixture->getData()); + $curl = new BackendDecorator(new CurlTransport(), new Config()); + $curl->write(CurlInterface::POST, $url, '1.0', [], $data); + $response = $curl->read(); + + if (!strpos($response, 'data-ui-id="messages-message-success"')) { + throw new \Exception("Newsletter template creation by curl was not successful! Response: $response"); + } + $curl->close(); + } +} diff --git a/app/code/Magento/Checkout/Block/Total/Tax.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Handler/Template/TemplateInterface.php similarity index 77% rename from app/code/Magento/Checkout/Block/Total/Tax.php rename to dev/tests/functional/tests/app/Magento/Newsletter/Test/Handler/Template/TemplateInterface.php index 678a3b30ab82f7a6fe04e836714532c8268588c6..953b67a499e0f2bedfa0eb9417b51730acfeb941 100644 --- a/app/code/Magento/Checkout/Block/Total/Tax.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Handler/Template/TemplateInterface.php @@ -21,17 +21,15 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Checkout\Block\Total; + +namespace Magento\Newsletter\Test\Handler\Template; + +use Mtf\Handler\HandlerInterface; /** - * Tax Total Row Renderer - * - * @author Magento Core Team <core@magentocommerce.com> + * Interface TemplateInterface */ -class Tax extends \Magento\Checkout\Block\Total\DefaultTotal +interface TemplateInterface extends HandlerInterface { - /** - * @var string - */ - protected $_template = 'total/tax.phtml'; + // } diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplatePreview.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplatePreview.php new file mode 100644 index 0000000000000000000000000000000000000000..8ec4c4de0eba0ef2f5167d5fa6c23914cf7de714 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplatePreview.php @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Newsletter\Test\Page\Adminhtml; + +use Mtf\Page\BackendPage; + +/** + * Class TemplatePreview + * TemplatePreview page + */ +class TemplatePreview extends BackendPage +{ + const MCA = 'newsletter/template/preview'; + + protected $_blocks = [ + 'content' => [ + 'name' => 'content', + 'class' => 'Magento\Newsletter\Test\Block\Adminhtml\Template\Preview', + 'locator' => 'body', + 'strategy' => 'css selector', + ], + ]; + + /** + * @return \Magento\Newsletter\Test\Block\Adminhtml\Template\Preview + */ + public function getContent() + { + return $this->getBlockInstance('content'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplatePreview.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplatePreview.xml new file mode 100644 index 0000000000000000000000000000000000000000..c60ff1c8025dd0f0e9d99d666cea92066b08982d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplatePreview.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page mca="newsletter/template/preview" > + <block> + <name>content</name> + <class>Magento\Newsletter\Test\Block\Adminhtml\Template\Preview</class> + <locator>body</locator> + <strategy>css selector</strategy> + </block> +</page> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.php new file mode 100644 index 0000000000000000000000000000000000000000..81897ec14f954455e2e4e1ae02e63be76ac08df0 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.php @@ -0,0 +1,81 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Newsletter\Test\Page\Adminhtml; + +use Mtf\Page\BackendPage; + +/** + * Class TemplateQueue + * TemplateQueue page + */ +class TemplateQueue extends BackendPage +{ + const MCA = 'newsletter/queue/edit'; + + protected $_blocks = [ + 'formPageActions' => [ + 'name' => 'formPageActions', + 'class' => 'Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions', + 'locator' => '.page-main-actions', + 'strategy' => 'css selector', + ], + 'editForm' => [ + 'name' => 'editForm', + 'class' => 'Magento\Backend\Test\Block\Widget\Form', + 'locator' => '#queue_edit_form', + 'strategy' => 'css selector', + ], + 'messagesBlock' => [ + 'name' => 'messagesBlock', + 'class' => 'Magento\Core\Test\Block\Messages', + 'locator' => '#messages', + 'strategy' => 'css selector', + ], + ]; + + /** + * @return \Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions + */ + public function getFormPageActions() + { + return $this->getBlockInstance('formPageActions'); + } + + /** + * @return \Magento\Backend\Test\Block\Widget\Form + */ + public function getEditForm() + { + return $this->getBlockInstance('editForm'); + } + + /** + * @return \Magento\Core\Test\Block\Messages + */ + public function getMessagesBlock() + { + return $this->getBlockInstance('messagesBlock'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.xml new file mode 100644 index 0000000000000000000000000000000000000000..996113f1aa1e77d2a3b45c29d25519ab5d6bc525 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Page/Adminhtml/TemplateQueue.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page mca="newsletter/queue/edit" > + <block> + <name>formPageActions</name> + <class>Magento\Newsletter\Test\Block\Adminhtml\Template\FormPageActions</class> + <locator>.page-main-actions</locator> + <strategy>css selector</strategy> + </block> + <block> + <name>editForm</name> + <class>Magento\Backend\Test\Block\Widget\Form</class> + <locator>#queue_edit_form</locator> + <strategy>css selector</strategy> + </block> + <block> + <name>messagesBlock</name> + <class>Magento\Core\Test\Block\Messages</class> + <locator>#messages</locator> + <strategy>css selector</strategy> + </block> +</page> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Repository/Template.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Repository/Template.php new file mode 100644 index 0000000000000000000000000000000000000000..b6966630cfd2ff2ee37682b70880ca807c0f8c21 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Repository/Template.php @@ -0,0 +1,51 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Newsletter\Test\Repository; + +use Mtf\Repository\AbstractRepository; + +/** + * Class UrlRewrite + * Data for creation url rewrite + */ +class Template extends AbstractRepository +{ + /** + * @param array $defaultConfig + * @param array $defaultData + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function __construct(array $defaultConfig = [], array $defaultData = []) + { + $this->_data['default'] = [ + 'code' => 'Newsletter Template %isolation%', + 'subject' => 'Newsletter Subject %isolation%', + 'sender_name' => 'Sender Name %isolation%', + 'sender_email' => 'support%isolation%@example.com', + 'text' => 'Template Content %isolation%' + ]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..65f3373f5cf37829c06a6816e577c75d746d9e24 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest.php @@ -0,0 +1,85 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Newsletter\Test\TestCase; + +use Mtf\TestCase\Injectable; +use Magento\Newsletter\Test\Fixture\Template; +use Magento\Newsletter\Test\Page\Adminhtml\TemplateIndex; + +/** + * Test Creation for Action for Newsletter Template (Preview and Queue) + * + * Test Flow: + * Preconditions: + * 1. Create newsletter + * + * Steps: + * 1. Open Backend + * 2. Go to Marketing > Newsletter Template + * 3. Find created template in grid + * 4. Select action in action dropdown for created template according to dataSet + * 5. Perform all assertions + * + * @group Newsletters_(MX) + * @ZephyrId MAGETWO-27043 + */ +class ActionNewsletterTemplateEntityTest extends Injectable +{ + /** + * Page with newsletter template grid + * + * @var TemplateIndex + */ + protected $templateIndex; + + /** + * Inject newsletter page + * + * @param TemplateIndex $templateIndex + * @return void + */ + public function __inject(TemplateIndex $templateIndex) + { + $this->templateIndex = $templateIndex; + } + + /** + * Action for Newsletter Template + * + * @param Template $newsletter + * @param string $action + * @return void + */ + public function test(Template $newsletter, $action) + { + // Preconditions + $newsletter->persist(); + + // Steps + $this->templateIndex->open(); + $this->templateIndex->getNewsletterTemplateGrid()->search(['code' => $newsletter->getCode()]); + $this->templateIndex->getNewsletterTemplateGrid()->performAction($action); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest/test.csv new file mode 100644 index 0000000000000000000000000000000000000000..54ade718a780af0929f5b2155e1ee12bd33058e7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/ActionNewsletterTemplateEntityTest/test.csv @@ -0,0 +1,3 @@ +"newsletter/dataSet";"action";"constraint" +"default";"Preview";"assertNewsletterPreview" +"default";"Queue Newsletter";"assertNewsletterQueue" diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/curl/di.xml new file mode 100644 index 0000000000000000000000000000000000000000..e0786a9dd5c3bc2f2c96a0718e020bcc9fa9717d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/curl/di.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> + <preference for="\Magento\Newsletter\Test\Handler\Template\TemplateInterface" type="\Magento\Newsletter\Test\Handler\Template\Curl" /> +</config> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/global/constraint.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/global/constraint.xml index 9321ac60842203820d61ed048bf5aab0ab3e5566..54d7d5337199f91a3f1212c0b84068c5fea931f4 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/global/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/global/constraint.xml @@ -30,6 +30,12 @@ <assertNewsletterInGrid module="Magento_Newsletter"> <severeness>low</severeness> </assertNewsletterInGrid> + <assertNewsletterPreview module="Magento_Newsletter"> + <severeness>low</severeness> + </assertNewsletterPreview> + <assertNewsletterQueue module="Magento_Newsletter"> + <severeness>low</severeness> + </assertNewsletterQueue> <assertCustomerIsSubscribedToNewsletter module="Magento_Newsletter"> <severeness>low</severeness> <require> diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/global/page.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/global/page.xml index a18cb41d5d14af89fc794f018086ffb21d38e976..648e5c7dbecc56cd9c3e129aaa7ca7c65c67f0b6 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/global/page.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/global/page.xml @@ -39,4 +39,14 @@ <area>adminhtml</area> <class>Magento\Newsletter\Test\Page\Adminhtml\SubscriberIndex</class> </subscriberIndex> + <newsletterQueue> + <mca>newsletter/queue/edit</mca> + <area>adminhtml</area> + <class>Magento\Newsletter\Test\Page\Adminhtml\TemplateQueue</class> + </newsletterQueue> + <newsletterPreview> + <mca>newsletter/template/preview</mca> + <area>adminhtml</area> + <class>Magento\Newsletter\Test\Page\Adminhtml\TemplatePreview</class> + </newsletterPreview> </page> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Product/Lowstock/Grid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Product/Lowstock/Grid.php new file mode 100644 index 0000000000000000000000000000000000000000..a4b8176c90d52cc99b1e3a9d51cb3d508c8d3d5b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/Product/Lowstock/Grid.php @@ -0,0 +1,43 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\Block\Adminhtml\Product\Lowstock; + +/** + * Class Grid + * Low Stock Report grid + */ +class Grid extends \Magento\Backend\Test\Block\Widget\Grid +{ + /** + * Filters array mapping + * + * @var array + */ + protected $filters = [ + 'name' => [ + 'selector' => 'input[name="name"]', + ], + ]; +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/SearchTermsGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/SearchTermsGrid.php new file mode 100644 index 0000000000000000000000000000000000000000..75e30e36aa9f53651600b0c7e77e5437d9c252ef --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Block/Adminhtml/SearchTermsGrid.php @@ -0,0 +1,56 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\Block\Adminhtml; + +/** + * Class SearchTermsGrid + * Search Terms report Grid + */ +class SearchTermsGrid extends \Magento\Backend\Test\Block\Widget\Grid +{ + /** + * Filters array mapping + * + * @var array + */ + protected $filters = [ + 'query_text' => [ + 'selector' => 'input[name="query_text"]' + ], + 'num_results' => [ + 'selector' => 'input[name="num_results[from]"]' + ], + 'popularity' => [ + 'selector' => 'input[name="popularity[from]"]' + ], + ]; + + /** + * Locator value for link in action column + * + * @var string + */ + protected $editLink = 'td[class*=col-query]'; +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertLowStockProductInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertLowStockProductInGrid.php new file mode 100644 index 0000000000000000000000000000000000000000..0fb1f7e61f6b7bd601e571c3d5fd2e041af527f5 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertLowStockProductInGrid.php @@ -0,0 +1,69 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\Constraint; + +use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Reports\Test\Page\Adminhtml\ProductLowStock; +use Mtf\Constraint\AbstractConstraint; + +/** + * Class AssertLowStockProductInGrid + * Assert that product with Low Stock is present in Low Stock grid + */ +class AssertLowStockProductInGrid extends AbstractConstraint +{ + /** + * Constraint severeness + * + * @var string + */ + protected $severeness = 'low'; + + /** + * Assert that product with Low Stock is present in Low Stock grid + * + * @param CatalogProductSimple $product + * @param ProductLowStock $productLowStock + * @return void + */ + public function processAssert(CatalogProductSimple $product, ProductLowStock $productLowStock) + { + $productLowStock->open(); + \PHPUnit_Framework_Assert::assertTrue( + $productLowStock->getLowStockGrid()->isRowVisible(['name' => $product->getName()]), + 'Product with Low Stock is absent in Low Stock grid.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Product with Low Stock is present in Low Stock grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php new file mode 100644 index 0000000000000000000000000000000000000000..efe147637d646d3f35d22172d4be3600cf61cd38 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php @@ -0,0 +1,83 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\Constraint; + +use Mtf\Constraint\AbstractAssertForm; +use Magento\Reports\Test\Page\Adminhtml\SearchIndex; +use Magento\CatalogSearch\Test\Page\Adminhtml\CatalogSearchEdit; + +/** + * Class AssertSearchTermReportForm + * Assert that Search Term Report form data equals to passed from dataSet + */ +class AssertSearchTermReportForm extends AbstractAssertForm +{ + /** + * Constraint severeness + * + * @var string + */ + protected $severeness = 'low'; + + /** + * Assert that Search Term Report form data equals to passed from dataSet + * + * @param CatalogSearchEdit $catalogSearchEdit + * @param SearchIndex $searchIndex + * @param string $productName + * @param int $countProducts + * @param int $countSearch + * @return void + */ + public function processAssert( + CatalogSearchEdit $catalogSearchEdit, + SearchIndex $searchIndex, + $productName, + $countProducts, + $countSearch + ) { + $filter = [ + 'query_text' => $productName, + 'num_results' => $countProducts, + 'popularity' => $countSearch, + ]; + $searchIndex->open(); + $searchIndex->getSearchGrid()->searchAndOpen($filter); + + $dataDiff = $this->verifyData($filter, $catalogSearchEdit->getForm()->getData()); + + \PHPUnit_Framework_Assert::assertEmpty($dataDiff, $dataDiff); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Search Term Report form data equals to passed from dataSet.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermsInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermsInGrid.php new file mode 100644 index 0000000000000000000000000000000000000000..944d48e78147d0a6ab5f46ab0b91cf3112bcd474 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermsInGrid.php @@ -0,0 +1,74 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\Constraint; + +use Mtf\Constraint\AbstractConstraint; +use Magento\Reports\Test\Page\Adminhtml\SearchIndex; + +/** + * Class AssertSearchTermsInGrid + * Assert that Search Terms report in Search Terms grid + */ +class AssertSearchTermsInGrid extends AbstractConstraint +{ + /** + * Constraint severeness + * + * @var string + */ + protected $severeness = 'low'; + + /** + * Assert that Search Terms report in grid + * + * @param SearchIndex $searchIndex + * @param string $productName + * @param int $countProducts + * @param int $countSearch + * @return void + */ + public function processAssert(SearchIndex $searchIndex, $productName, $countProducts, $countSearch) + { + $filter = [ + 'query_text' => $productName, + 'num_results' => $countProducts, + 'popularity' => $countSearch, + ]; + \PHPUnit_Framework_Assert::assertTrue( + $searchIndex->getSearchGrid()->isRowVisible($filter), + 'Search terms report is absent in Search Terms grid.' + ); + } + + /** + * Returns a string representation of the object + * + * @return string + */ + public function toString() + { + return 'Search terms report is present in Search Terms grid.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductLowStock.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductLowStock.php new file mode 100644 index 0000000000000000000000000000000000000000..a92866f0d5dcf3ab2345101ca7e7bb8eba2e9e00 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductLowStock.php @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\Page\Adminhtml; + +use Mtf\Page\BackendPage; + +/** + * Class ProductLowStock + * Product Low Stock page + */ +class ProductLowStock extends BackendPage +{ + const MCA = 'reports/report_product/lowstock'; + + protected $_blocks = [ + 'lowStockGrid' => [ + 'name' => 'lowStockGrid', + 'class' => 'Magento\Reports\Test\Block\Adminhtml\Product\Lowstock\Grid', + 'locator' => '#gridLowstock', + 'strategy' => 'css selector', + ], + ]; + + /** + * @return \Magento\Reports\Test\Block\Adminhtml\Product\Lowstock\Grid + */ + public function getLowStockGrid() + { + return $this->getBlockInstance('lowStockGrid'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductLowStock.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductLowStock.xml new file mode 100644 index 0000000000000000000000000000000000000000..117a4f2281e7cf1dc3c1959ae664b6af0db89fff --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductLowStock.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page mca="reports/report_product/lowstock" > + <block> + <name>lowStockGrid</name> + <class>Magento\Reports\Test\Block\Adminhtml\Product\Lowstock\Grid</class> + <locator>#gridLowstock</locator> + <strategy>css selector</strategy> + </block> +</page> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/SearchIndex.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/SearchIndex.php new file mode 100644 index 0000000000000000000000000000000000000000..435c5582e7d6c812ed1ca42001bc618bc0ebe7b6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/SearchIndex.php @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\Page\Adminhtml; + +use Mtf\Page\BackendPage; + +/** + * Class SearchIndex + * Search report page + */ +class SearchIndex extends BackendPage +{ + const MCA = 'reports/index/search'; + + protected $_blocks = [ + 'searchGrid' => [ + 'name' => 'searchGrid', + 'class' => 'Magento\Reports\Test\Block\Adminhtml\SearchTermsGrid', + 'locator' => '#searchReportGrid', + 'strategy' => 'css selector', + ], + ]; + + /** + * @return \Magento\Reports\Test\Block\Adminhtml\SearchTermsGrid + */ + public function getSearchGrid() + { + return $this->getBlockInstance('searchGrid'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/SearchIndex.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/SearchIndex.xml new file mode 100644 index 0000000000000000000000000000000000000000..fa1dbc9ce66285aab24b8836c96de93ecd4914ee --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/SearchIndex.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page mca="reports/index/search" > + <block> + <name>searchGrid</name> + <class>Magento\Reports\Test\Block\Adminhtml\SearchTermsGrid</class> + <locator>#searchReportGrid</locator> + <strategy>css selector</strategy> + </block> +</page> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..00521643b59f1cd548a360e683c8328c9bdcecd3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest.php @@ -0,0 +1,58 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\TestCase; + +use Mtf\TestCase\Injectable; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; + +/** + * Test Creation for LowStockProductsReportEntityTest + * + * Test Flow: + * Preconditions: + * 1. Product is created. + * + * Steps: + * 1. Login to backend. + * 2. Open Reports > Low Stock. + * 3. Perform appropriate assertions. + * + * @group Reports_(MX) + * @ZephyrId MAGETWO-27193 + */ +class LowStockProductsReportEntityTest extends Injectable +{ + /** + * Create product + * + * @param CatalogProductSimple $product + * @return void + */ + public function test(CatalogProductSimple $product) + { + // Preconditions + $product->persist(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest/test.csv new file mode 100644 index 0000000000000000000000000000000000000000..3546336dec8580974f767ffd329e34eac0144002 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/LowStockProductsReportEntityTest/test.csv @@ -0,0 +1,2 @@ +"product/dataSet";"constraint" +"low_stock_product";"assertLowStockProductInGrid" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5be39cf113524dc9f3a025e5705f6ab98626dc7e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest.php @@ -0,0 +1,137 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Reports\Test\TestCase; + +use Mtf\TestCase\Injectable; +use Mtf\Fixture\FixtureFactory; +use Magento\Cms\Test\Page\CmsIndex; +use Magento\Reports\Test\Page\Adminhtml\SearchIndex; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; + +/** + * Test Creation for SearchTermsReportEntity + * + * Test Flow: + * Preconditions: + * 1. Products is created. + * + * Steps: + * 1. Search products in frontend. + * 2. Login to backend. + * 3. Navigate to: Reports > Search Terms. + * 4. Perform appropriate assertions. + * + * @group Search_Terms_(MX) + * @ZephyrId MAGETWO-27106 + */ +class SearchTermsReportEntityTest extends Injectable +{ + /** + * Index page + * + * @var CmsIndex + */ + protected $cmsIndex; + + /** + * Search Index page + * + * @var SearchIndex + */ + protected $searchIndex; + + /** + * FixtureFactory + * + * @var FixtureFactory + */ + protected $fixtureFactory; + + /** + * Inject pages + * + * @param CmsIndex $cmsIndex + * @param SearchIndex $searchIndex + * @param FixtureFactory $fixtureFactory + * @return void + */ + public function __inject(CmsIndex $cmsIndex, SearchIndex $searchIndex, FixtureFactory $fixtureFactory) + { + $this->cmsIndex = $cmsIndex; + $this->searchIndex = $searchIndex; + $this->fixtureFactory = $fixtureFactory; + } + + /** + * Search Terms Report + * + * @param CatalogProductSimple $product + * @param int $countProducts + * @param int $countSearch + * @return array + */ + public function test(CatalogProductSimple $product, $countProducts, $countSearch) + { + $this->markTestIncomplete('MAGETWO-27150, MAGETWO-27151'); + // Preconditions + $productName = $this->createProducts($product, $countProducts); + + // Steps + $this->cmsIndex->open(); + $this->searchProducts($productName, $countSearch); + $this->searchIndex->open(); + + return ['productName' => $productName]; + } + + /** + * Create products + * + * @param CatalogProductSimple $product + * @param int $countProduct + * @return string + */ + protected function createProducts(CatalogProductSimple $product, $countProduct) + { + for ($i = 0; $i < $countProduct; $i++) { + $product->persist(); + } + return $product->getName(); + } + + /** + * Search products + * + * @param string $productName + * @param int $countSearch + * @return void + */ + protected function searchProducts($productName, $countSearch) + { + for ($i = 0; $i < $countSearch; $i++) { + $this->cmsIndex->getSearchBlock()->search($productName); + } + } +} diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest/test.csv new file mode 100644 index 0000000000000000000000000000000000000000..20bf7a1572c5af2e11fb21433949ef99481fb248 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SearchTermsReportEntityTest/test.csv @@ -0,0 +1,3 @@ +"product/dataSet";"countProducts";"countSearch";"constraint" +"100_dollar_product";"1";"2";"assertSearchTermsInGrid, assertSearchTermReportForm" +"100_dollar_product";"3";"1";"assertSearchTermsInGrid, assertSearchTermReportForm" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/constraint.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/constraint.xml new file mode 100644 index 0000000000000000000000000000000000000000..8145a448500f112a65b6d21f4edfaf4a0985efcf --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/constraint.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<constraint> + <assertSearchTermsInGrid module="Magento_Reports"> + <severeness>low</severeness> + </assertSearchTermsInGrid> + <assertSearchTermReportForm module="Magento_Reports"> + <severeness>low</severeness> + </assertSearchTermReportForm> + <assertLowStockProductInGrid module="Magento_Reports"> + <severeness>low</severeness> + </assertLowStockProductInGrid> +</constraint> diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/page.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/page.xml new file mode 100644 index 0000000000000000000000000000000000000000..54b687f57376d579ae8bee2037ff36686c94dde6 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/global/page.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" ?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<page> + <searchIndex> + <mca>reports/index/search</mca> + <area>adminhtml</area> + <class>Magento\Reports\Test\Page\Adminhtml\SearchIndex</class> + </searchIndex> + <productLowStock> + <mca>reports/report_product/lowstock</mca> + <area>adminhtml</area> + <class>Magento\Reports\Test\Page\Adminhtml\ProductLowStock</class> + </productLowStock> +</page> diff --git a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php index be0119f68993423ae74c061447a6d543c6e75b54..6459c5e26ce55645f018a7ad878165492dcbc173 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/AuthTest.php @@ -76,7 +76,7 @@ class AuthTest extends \Magento\TestFramework\TestCase\AbstractController /** * Check not logged state - * @covers \Magento\Backend\Controller\Adminhtml\Auth::loginAction + * @covers \Magento\Backend\Controller\Adminhtml\Auth\Login::execute */ public function testNotLoggedLoginAction() { @@ -90,7 +90,7 @@ class AuthTest extends \Magento\TestFramework\TestCase\AbstractController /** * Check logged state - * @covers \Magento\Backend\Controller\Adminhtml\Auth::loginAction + * @covers \Magento\Backend\Controller\Adminhtml\Auth\Login::execute * @magentoDbIsolation enabled */ public function testLoggedLoginAction() @@ -138,7 +138,7 @@ class AuthTest extends \Magento\TestFramework\TestCase\AbstractController } /** - * @covers \Magento\Backend\Controller\Adminhtml\Auth::logoutAction + * @covers \Magento\Backend\Controller\Adminhtml\Auth\Logout::execute * @magentoDbIsolation enabled */ public function testLogoutAction() @@ -156,8 +156,7 @@ class AuthTest extends \Magento\TestFramework\TestCase\AbstractController } /** - * @covers \Magento\Backend\Controller\Adminhtml\Auth::deniedJsonAction - * @covers \Magento\Backend\Controller\Adminhtml\Auth::_getDeniedJson + * @covers \Magento\Backend\Controller\Adminhtml\Auth\DeniedJson::execute * @magentoDbIsolation enabled */ public function testDeniedJsonAction() @@ -176,8 +175,7 @@ class AuthTest extends \Magento\TestFramework\TestCase\AbstractController } /** - * @covers \Magento\Backend\Controller\Adminhtml\Auth::deniedIframeAction - * @covers \Magento\Backend\Controller\Adminhtml\Auth::_getDeniedIframe + * @covers \Magento\Backend\Controller\Adminhtml\Auth\DeniedIframe::execute * @magentoDbIsolation enabled */ public function testDeniedIframeAction() diff --git a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/IndexTest.php b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/IndexTest.php index 28945c26a96bd84835ec435b156ece696a35c321..303eb719ec1beb8db5e22aa72deaed10136ebc3a 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/IndexTest.php @@ -30,7 +30,7 @@ class IndexTest extends \Magento\Backend\Utility\Controller { /** * Check not logged state - * @covers \Magento\Backend\Controller\Adminhtml\Index::indexAction + * @covers \Magento\Backend\Controller\Adminhtml\Index\Index::execute */ public function testNotLoggedIndexAction() { @@ -45,7 +45,7 @@ class IndexTest extends \Magento\Backend\Utility\Controller /** * Check logged state - * @covers \Magento\Backend\Controller\Adminhtml\Index::indexAction + * @covers \Magento\Backend\Controller\Adminhtml\Index\Index::execute * @magentoDbIsolation enabled */ public function testLoggedIndexAction() @@ -55,7 +55,7 @@ class IndexTest extends \Magento\Backend\Utility\Controller } /** - * @covers \Magento\Backend\Controller\Adminhtml\Index::globalSearchAction + * @covers \Magento\Backend\Controller\Adminhtml\Index\GlobalSearch::execute */ public function testGlobalSearchAction() { diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Action/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Action/AttributeTest.php index 99b99a25af28834c4396086fb3cc9b5a60cd02db..46541126f305045eb2be21e41a84cabba750f623 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Action/AttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Action/AttributeTest.php @@ -29,7 +29,7 @@ namespace Magento\Catalog\Controller\Adminhtml\Product\Action; class AttributeTest extends \Magento\Backend\Utility\Controller { /** - * @covers \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute::saveAction + * @covers \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute\Save::execute * * @magentoDataFixture Magento/Catalog/_files/product_simple.php */ @@ -65,7 +65,7 @@ class AttributeTest extends \Magento\Backend\Utility\Controller /** - * @covers \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute::validateAction + * @covers \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute\Validate::execute * * @dataProvider validateActionDataProvider * diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/DataTest.php index 7da4381e7649849687a7e56c6c3172c692f44036..7ccf67c76c489a5322c276e5d91f532eb64803c8 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/DataTest.php @@ -23,18 +23,77 @@ */ namespace Magento\Catalog\Helper; +use Magento\Tax\Model\ClassModel; +use Magento\Tax\Service\V1\TaxRuleFixtureFactory; +use Magento\Store\Model\ScopeInterface; +use Magento\Tax\Model\Config; + class DataTest extends \PHPUnit_Framework_TestCase { /** + * Tax helper + * * @var \Magento\Catalog\Helper\Data */ - protected $_helper; + private $helper; + + /** + * Object Manager + * + * @var \Magento\Framework\ObjectManager + */ + private $objectManager; + + /** + * Array of default tax classes ids + * + * Key is class name + * + * @var int[] + */ + private $taxClasses; + + /** + * Array of default tax rates ids. + * + * Key is rate percentage as string. + * + * @var int[] + */ + private $taxRates; + + /** + * Array of default tax rules ids. + * + * Key is rule code. + * + * @var int[] + */ + private $taxRules; + + /** + * Helps in creating required tax rules. + * + * @var TaxRuleFixtureFactory + */ + private $taxRuleFixtureFactory; + + /** + * @var \Magento\Framework\App\MutableScopeConfig + */ + private $scopeConfig; protected function setUp() { - $this->_helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Catalog\Helper\Data' - ); + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->helper = $this->objectManager->get('Magento\Catalog\Helper\Data'); + $this->taxRuleFixtureFactory = new TaxRuleFixtureFactory(); + $this->scopeConfig = $this->objectManager->get('Magento\Framework\App\MutableScopeConfig'); + } + + protected function tearDown() + { + $this->tearDownDefaultRules(); } /** @@ -51,7 +110,7 @@ class DataTest extends \PHPUnit_Framework_TestCase $objectManager->get('Magento\Framework\Registry')->register('current_category', $category); try { - $path = $this->_helper->getBreadcrumbPath(); + $path = $this->helper->getBreadcrumbPath(); $this->assertInternalType('array', $path); $this->assertEquals(array('category3', 'category4', 'category5'), array_keys($path)); $this->assertArrayHasKey('label', $path['category3']); @@ -72,7 +131,7 @@ class DataTest extends \PHPUnit_Framework_TestCase $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->get('Magento\Framework\Registry')->register('current_category', $category); try { - $this->assertSame($category, $this->_helper->getCategory()); + $this->assertSame($category, $this->helper->getCategory()); $objectManager->get('Magento\Framework\Registry')->unregister('current_category'); } catch (\Exception $e) { $objectManager->get('Magento\Framework\Registry')->unregister('current_category'); @@ -89,7 +148,7 @@ class DataTest extends \PHPUnit_Framework_TestCase $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->get('Magento\Framework\Registry')->register('current_product', $product); try { - $this->assertSame($product, $this->_helper->getProduct()); + $this->assertSame($product, $this->helper->getProduct()); $objectManager->get('Magento\Framework\Registry')->unregister('current_product'); } catch (\Exception $e) { $objectManager->get('Magento\Framework\Registry')->unregister('current_product'); @@ -100,17 +159,17 @@ class DataTest extends \PHPUnit_Framework_TestCase public function testSplitSku() { $sku = 'one-two-three'; - $this->assertEquals(array('on', 'e-', 'tw', 'o-', 'th', 're', 'e'), $this->_helper->splitSku($sku, 2)); + $this->assertEquals(array('on', 'e-', 'tw', 'o-', 'th', 're', 'e'), $this->helper->splitSku($sku, 2)); } public function testGetAttributeHiddenFields() { - $this->assertEquals(array(), $this->_helper->getAttributeHiddenFields()); + $this->assertEquals(array(), $this->helper->getAttributeHiddenFields()); /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->get('Magento\Framework\Registry')->register('attribute_type_hidden_fields', 'test'); try { - $this->assertEquals('test', $this->_helper->getAttributeHiddenFields()); + $this->assertEquals('test', $this->helper->getAttributeHiddenFields()); $objectManager->get('Magento\Framework\Registry')->unregister('attribute_type_hidden_fields'); } catch (\Exception $e) { $objectManager->get('Magento\Framework\Registry')->unregister('attribute_type_hidden_fields'); @@ -120,8 +179,8 @@ class DataTest extends \PHPUnit_Framework_TestCase public function testGetPriceScopeDefault() { - // $this->assertEquals(\Magento\Store\Model\Store::PRICE_SCOPE_GLOBAL, $this->_helper->getPriceScope()); - $this->assertNull($this->_helper->getPriceScope()); + // $this->assertEquals(\Magento\Store\Model\Store::PRICE_SCOPE_GLOBAL, $this->helper->getPriceScope()); + $this->assertNull($this->helper->getPriceScope()); } /** @@ -129,12 +188,12 @@ class DataTest extends \PHPUnit_Framework_TestCase */ public function testGetPriceScope() { - $this->assertEquals(\Magento\Store\Model\Store::PRICE_SCOPE_WEBSITE, $this->_helper->getPriceScope()); + $this->assertEquals(\Magento\Store\Model\Store::PRICE_SCOPE_WEBSITE, $this->helper->getPriceScope()); } public function testIsPriceGlobalDefault() { - $this->assertTrue($this->_helper->isPriceGlobal()); + $this->assertTrue($this->helper->isPriceGlobal()); } /** @@ -142,12 +201,12 @@ class DataTest extends \PHPUnit_Framework_TestCase */ public function testIsPriceGlobal() { - $this->assertFalse($this->_helper->isPriceGlobal()); + $this->assertFalse($this->helper->isPriceGlobal()); } public function testShouldSaveUrlRewritesHistoryDefault() { - $this->assertTrue($this->_helper->shouldSaveUrlRewritesHistory()); + $this->assertTrue($this->helper->shouldSaveUrlRewritesHistory()); } /** @@ -155,12 +214,12 @@ class DataTest extends \PHPUnit_Framework_TestCase */ public function testShouldSaveUrlRewritesHistory() { - $this->assertFalse($this->_helper->shouldSaveUrlRewritesHistory()); + $this->assertFalse($this->helper->shouldSaveUrlRewritesHistory()); } public function testIsUsingStaticUrlsAllowedDefault() { - $this->assertFalse($this->_helper->isUsingStaticUrlsAllowed()); + $this->assertFalse($this->helper->isUsingStaticUrlsAllowed()); } /** @@ -170,18 +229,18 @@ class DataTest extends \PHPUnit_Framework_TestCase */ public function testIsUsingStaticUrlsAllowed() { - $this->assertTrue($this->_helper->isUsingStaticUrlsAllowed()); - $this->_helper->setStoreId( + $this->assertTrue($this->helper->isUsingStaticUrlsAllowed()); + $this->helper->setStoreId( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Store\Model\StoreManagerInterface' )->getStore()->getId() ); - $this->assertTrue($this->_helper->isUsingStaticUrlsAllowed()); + $this->assertTrue($this->helper->isUsingStaticUrlsAllowed()); } public function testIsUrlDirectivesParsingAllowedDefault() { - $this->assertTrue($this->_helper->isUrlDirectivesParsingAllowed()); + $this->assertTrue($this->helper->isUrlDirectivesParsingAllowed()); } /** @@ -191,17 +250,280 @@ class DataTest extends \PHPUnit_Framework_TestCase */ public function testIsUrlDirectivesParsingAllowed() { - $this->assertFalse($this->_helper->isUrlDirectivesParsingAllowed()); - $this->_helper->setStoreId( + $this->assertFalse($this->helper->isUrlDirectivesParsingAllowed()); + $this->helper->setStoreId( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Store\Model\StoreManagerInterface' )->getStore()->getId() ); - $this->assertFalse($this->_helper->isUrlDirectivesParsingAllowed()); + $this->assertFalse($this->helper->isUrlDirectivesParsingAllowed()); } public function testGetPageTemplateProcessor() { - $this->assertInstanceOf('Magento\Framework\Filter\Template', $this->_helper->getPageTemplateProcessor()); + $this->assertInstanceOf('Magento\Framework\Filter\Template', $this->helper->getPageTemplateProcessor()); + } + + /** + * @param \Magento\Framework\Object $input + * @param float $expectOutputPrice + * @param string[] $configs + * @param string $productClassName + * + * @magentoDataFixture Magento/Catalog/_files/products.php + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Customer/_files/customer_address.php + * @magentoDbIsolation enabled + * @dataProvider getTaxPriceDataProvider + */ + public function testGetTaxPrice( + $input, + $expectOutputPrice, + $configs = [], + $productClassName = 'DefaultProductClass' + ) { + $this->setUpDefaultRules(); + $fixtureProductId = 1; + /** @var \Magento\Catalog\Model\Product $product */ + $product = $this->objectManager->create('Magento\Catalog\Model\Product')->load($fixtureProductId); + $product->setTaxClassId($this->taxClasses[$productClassName]); + $shippingAddress = $this->getCustomerAddress(); + $billingAddress = $shippingAddress; + foreach ($configs as $config) { + $this->scopeConfig->setValue($config['path'], $config['value'], ScopeInterface::SCOPE_STORE, 'default'); + } + + $price = $this->helper->getTaxPrice( + $product, + $input->getPrice(), + $input->getIncludingTax(), + $shippingAddress, + $billingAddress, + $this->taxClasses['DefaultCustomerClass'], + $input->getStore(), + $input->getPriceIncludesTax(), + $input->getRoundPrice() + ); + $this->assertEquals($expectOutputPrice, $price); + } + + /** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function getTaxPriceDataProvider() + { + return [ + 'price is 0' => [ + (new \Magento\Framework\Object())->setPrice(0), + 0 + ], + 'no price conversion, round' => [ + (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), + '3.26' + ], + 'no price conversion, no round' => [ + (new \Magento\Framework\Object())->setPrice(3.256), + '3.256' + ], + 'price conversion, display including tax, round' => [ + (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), + '3.5', + [ + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, + 'value' => '0', + ], + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, + 'value' => Config::DISPLAY_TYPE_INCLUDING_TAX, + ], + ] + ], + 'price conversion, display including tax, no round' => [ + (new \Magento\Framework\Object())->setPrice(3.256), + '3.5', // rounding issue: old code expects 3.5002 + [ + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, + 'value' => '0', + ], + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, + 'value' => Config::DISPLAY_TYPE_INCLUDING_TAX, + ], + ] + ], + 'price conversion, display including tax, high rate product tax class, cross boarder trade, round' => [ + (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), + '3.98', // rounding issue: old code expects 3.97 + [ + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, + 'value' => '0', + ], + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, + 'value' => Config::DISPLAY_TYPE_INCLUDING_TAX, + ], + [ + 'path' => Config::CONFIG_XML_PATH_CROSS_BORDER_TRADE_ENABLED, + 'value' => '1', + ], + ], + 'HigherProductClass', + ], + 'price include tax, display including tax, round' => [ + (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), + '3.26', + [ + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, + 'value' => '1', + ], + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, + 'value' => Config::DISPLAY_TYPE_INCLUDING_TAX, + ], + ] + ], + 'price include tax, display excluding tax, round' => [ + (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), + '3.03', + [ + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, + 'value' => '1', + ], + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, + 'value' => Config::DISPLAY_TYPE_EXCLUDING_TAX, + ], + ] + ], + 'price include tax, display excluding tax, request including tax, round' => [ + (new \Magento\Framework\Object())->setPrice(3.256) + ->setRoundPrice(true) + ->setIncludingTax(true), + '3.26', + [ + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, + 'value' => '1', + ], + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, + 'value' => Config::DISPLAY_TYPE_EXCLUDING_TAX, + ], + ] + ], + 'price include tax, display excluding tax, high rate product tax class, round' => [ + (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), + '2.67', + [ + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, + 'value' => '1', + ], + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, + 'value' => Config::DISPLAY_TYPE_EXCLUDING_TAX, + ], + ], + 'HigherProductClass', + ], + 'price include tax, display excluding tax, high rate product tax class, cross boarder trade, round' => [ + (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), + '2.67', + [ + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, + 'value' => '1', + ], + [ + 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, + 'value' => Config::DISPLAY_TYPE_EXCLUDING_TAX, + ], + [ + 'path' => Config::CONFIG_XML_PATH_CROSS_BORDER_TRADE_ENABLED, + 'value' => '1', + ], + ], + 'HigherProductClass', + ], + ]; + } + + /** + * Helper function that sets up some default rules + */ + private function setUpDefaultRules() + { + $this->taxClasses = $this->taxRuleFixtureFactory->createTaxClasses([ + ['name' => 'DefaultCustomerClass', 'type' => ClassModel::TAX_CLASS_TYPE_CUSTOMER], + ['name' => 'DefaultProductClass', 'type' => ClassModel::TAX_CLASS_TYPE_PRODUCT], + ['name' => 'HigherProductClass', 'type' => ClassModel::TAX_CLASS_TYPE_PRODUCT], + ]); + + $this->taxRates = $this->taxRuleFixtureFactory->createTaxRates([ + ['percentage' => 7.5, 'country' => 'US', 'region' => 42], + ['percentage' => 7.5, 'country' => 'US', 'region' => 12], // Default store rate + ]); + + $higherRates = $this->taxRuleFixtureFactory->createTaxRates([ + ['percentage' => 22, 'country' => 'US', 'region' => 42], + ['percentage' => 10, 'country' => 'US', 'region' => 12], // Default store rate + ]); + + $this->taxRules = $this->taxRuleFixtureFactory->createTaxRules([ + [ + 'code' => 'Default Rule', + 'customer_tax_class_ids' => [$this->taxClasses['DefaultCustomerClass'], 3], + 'product_tax_class_ids' => [$this->taxClasses['DefaultProductClass']], + 'tax_rate_ids' => array_values($this->taxRates), + 'sort_order' => 0, + 'priority' => 0, + ], + [ + 'code' => 'Higher Rate Rule', + 'customer_tax_class_ids' => [$this->taxClasses['DefaultCustomerClass'], 3], + 'product_tax_class_ids' => [$this->taxClasses['HigherProductClass']], + 'tax_rate_ids' => array_values($higherRates), + 'sort_order' => 0, + 'priority' => 0, + ], + ]); + + // For cleanup + $this->taxRates = array_merge($this->taxRates, $higherRates); + } + + /** + * Get fixture customer address + * + * @return \Magento\Customer\Model\Address + */ + private function getCustomerAddress() + { + $fixtureCustomerId = 1; + $customerAddress = $this->objectManager->create('Magento\Customer\Model\Address')->load($fixtureCustomerId); + /** Set data which corresponds tax class fixture */ + $customerAddress->setCountryId('US')->setRegionId(42)->save(); + return $customerAddress; + } + + /** + * Helper function that tears down some default rules + */ + private function tearDownDefaultRules() + { + if ($this->taxRules) { + $this->taxRuleFixtureFactory->deleteTaxRules(array_values($this->taxRules)); + } + if ($this->taxRates) { + $this->taxRuleFixtureFactory->deleteTaxRates(array_values($this->taxRates)); + } + if ($this->taxClasses) { + $this->taxRuleFixtureFactory->deleteTaxClasses(array_values($this->taxClasses)); + } } } diff --git a/dev/tests/integration/testsuite/Magento/Tax/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/Tax/Helper/DataTest.php index bafb54e5c3ca5827f164893cbd99fbc3f5b1631e..a60008ed37d6365a141e086d26ac50dfeb34283e 100644 --- a/dev/tests/integration/testsuite/Magento/Tax/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/Tax/Helper/DataTest.php @@ -23,11 +23,6 @@ */ namespace Magento\Tax\Helper; -use Magento\Tax\Model\ClassModel; -use Magento\Tax\Service\V1\TaxRuleFixtureFactory; -use Magento\Store\Model\ScopeInterface; -use Magento\Tax\Model\Config; - class DataTest extends \PHPUnit_Framework_TestCase { /** @@ -44,55 +39,11 @@ class DataTest extends \PHPUnit_Framework_TestCase */ private $objectManager; - /** - * Array of default tax classes ids - * - * Key is class name - * - * @var int[] - */ - private $taxClasses; - - /** - * Array of default tax rates ids. - * - * Key is rate percentage as string. - * - * @var int[] - */ - private $taxRates; - - /** - * Array of default tax rules ids. - * - * Key is rule code. - * - * @var int[] - */ - private $taxRules; - - /** - * Helps in creating required tax rules. - * - * @var TaxRuleFixtureFactory - */ - private $taxRuleFixtureFactory; - - /** @var \Magento\Framework\App\MutableScopeConfig */ - private $scopeConfig; - public function setUp() { $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** @var $helper \Magento\Tax\Helper\Data */ $this->helper = $this->objectManager->get('Magento\Tax\Helper\Data'); - $this->taxRuleFixtureFactory = new TaxRuleFixtureFactory(); - $this->scopeConfig = $this->objectManager->get('Magento\Framework\App\MutableScopeConfig'); - } - - protected function tearDown() - { - $this->tearDownDefaultRules(); } /** @@ -110,263 +61,4 @@ class DataTest extends \PHPUnit_Framework_TestCase { $this->assertEquals(1, $this->helper->getDefaultProductTaxClass()); } - - /** - * @param \Magento\Framework\Object $input - * @param float $expectOutputPrice - * @param string[] $configs - * @param string $productClassName - * - * @magentoDataFixture Magento/Catalog/_files/products.php - * @magentoDataFixture Magento/Customer/_files/customer.php - * @magentoDataFixture Magento/Customer/_files/customer_address.php - * @magentoDbIsolation enabled - * @dataProvider getPriceDataProvider - */ - public function testGetPrice($input, $expectOutputPrice, $configs = [], $productClassName = 'DefaultProductClass') - { - $this->setUpDefaultRules(); - $fixtureProductId = 1; - /** @var \Magento\Catalog\Model\Product $product */ - $product = $this->objectManager->create('Magento\Catalog\Model\Product')->load($fixtureProductId); - $product->setTaxClassId($this->taxClasses[$productClassName]); - $shippingAddress = $this->getCustomerAddress(); - $billingAddress = $shippingAddress; - foreach ($configs as $config) { - $this->scopeConfig->setValue($config['path'], $config['value'], ScopeInterface::SCOPE_STORE, 'default'); - } - - $price = $this->helper->getPrice( - $product, - $input->getPrice(), - $input->getIncludingTax(), - $shippingAddress, - $billingAddress, - $this->taxClasses['DefaultCustomerClass'], - $input->getStore(), - $input->getPriceIncludesTax(), - $input->getRoundPrice() - ); - $this->assertEquals($expectOutputPrice, $price); - } - - /** - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function getPriceDataProvider() - { - return [ - 'price is 0' => [ - (new \Magento\Framework\Object())->setPrice(0), - 0 - ], - 'no price conversion, round' => [ - (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), - '3.26' - ], - 'no price conversion, no round' => [ - (new \Magento\Framework\Object())->setPrice(3.256), - '3.256' - ], - 'price conversion, display including tax, round' => [ - (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), - '3.5', - [ - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, - 'value' => '0', - ], - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, - 'value' => Config::DISPLAY_TYPE_INCLUDING_TAX, - ], - ] - ], - 'price conversion, display including tax, no round' => [ - (new \Magento\Framework\Object())->setPrice(3.256), - '3.5', // rounding issue: old code expects 3.5002 - [ - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, - 'value' => '0', - ], - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, - 'value' => Config::DISPLAY_TYPE_INCLUDING_TAX, - ], - ] - ], - 'price conversion, display including tax, high rate product tax class, cross boarder trade, round' => [ - (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), - '3.98', // rounding issue: old code expects 3.97 - [ - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, - 'value' => '0', - ], - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, - 'value' => Config::DISPLAY_TYPE_INCLUDING_TAX, - ], - [ - 'path' => Config::CONFIG_XML_PATH_CROSS_BORDER_TRADE_ENABLED, - 'value' => '1', - ], - ], - 'HigherProductClass', - ], - 'price include tax, display including tax, round' => [ - (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), - '3.26', - [ - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, - 'value' => '1', - ], - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, - 'value' => Config::DISPLAY_TYPE_INCLUDING_TAX, - ], - ] - ], - 'price include tax, display excluding tax, round' => [ - (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), - '3.03', - [ - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, - 'value' => '1', - ], - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, - 'value' => Config::DISPLAY_TYPE_EXCLUDING_TAX, - ], - ] - ], - 'price include tax, display excluding tax, request including tax, round' => [ - (new \Magento\Framework\Object())->setPrice(3.256) - ->setRoundPrice(true) - ->setIncludingTax(true), - '3.26', - [ - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, - 'value' => '1', - ], - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, - 'value' => Config::DISPLAY_TYPE_EXCLUDING_TAX, - ], - ] - ], - 'price include tax, display excluding tax, high rate product tax class, round' => [ - (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), - '2.67', - [ - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, - 'value' => '1', - ], - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, - 'value' => Config::DISPLAY_TYPE_EXCLUDING_TAX, - ], - ], - 'HigherProductClass', - ], - 'price include tax, display excluding tax, high rate product tax class, cross boarder trade, round' => [ - (new \Magento\Framework\Object())->setPrice(3.256)->setRoundPrice(true), - '2.67', - [ - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, - 'value' => '1', - ], - [ - 'path' => Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, - 'value' => Config::DISPLAY_TYPE_EXCLUDING_TAX, - ], - [ - 'path' => Config::CONFIG_XML_PATH_CROSS_BORDER_TRADE_ENABLED, - 'value' => '1', - ], - ], - 'HigherProductClass', - ], - ]; - } - - /** - * Helper function that sets up some default rules - */ - private function setUpDefaultRules() - { - $this->taxClasses = $this->taxRuleFixtureFactory->createTaxClasses([ - ['name' => 'DefaultCustomerClass', 'type' => ClassModel::TAX_CLASS_TYPE_CUSTOMER], - ['name' => 'DefaultProductClass', 'type' => ClassModel::TAX_CLASS_TYPE_PRODUCT], - ['name' => 'HigherProductClass', 'type' => ClassModel::TAX_CLASS_TYPE_PRODUCT], - ]); - - $this->taxRates = $this->taxRuleFixtureFactory->createTaxRates([ - ['percentage' => 7.5, 'country' => 'US', 'region' => 42], - ['percentage' => 7.5, 'country' => 'US', 'region' => 12], // Default store rate - ]); - - $higherRates = $this->taxRuleFixtureFactory->createTaxRates([ - ['percentage' => 22, 'country' => 'US', 'region' => 42], - ['percentage' => 10, 'country' => 'US', 'region' => 12], // Default store rate - ]); - - $this->taxRules = $this->taxRuleFixtureFactory->createTaxRules([ - [ - 'code' => 'Default Rule', - 'customer_tax_class_ids' => [$this->taxClasses['DefaultCustomerClass'], 3], - 'product_tax_class_ids' => [$this->taxClasses['DefaultProductClass']], - 'tax_rate_ids' => array_values($this->taxRates), - 'sort_order' => 0, - 'priority' => 0, - ], - [ - 'code' => 'Higher Rate Rule', - 'customer_tax_class_ids' => [$this->taxClasses['DefaultCustomerClass'], 3], - 'product_tax_class_ids' => [$this->taxClasses['HigherProductClass']], - 'tax_rate_ids' => array_values($higherRates), - 'sort_order' => 0, - 'priority' => 0, - ], - ]); - - // For cleanup - $this->taxRates = array_merge($this->taxRates, $higherRates); - } - - /** - * Helper function that tears down some default rules - */ - private function tearDownDefaultRules() - { - if ($this->taxRules) { - $this->taxRuleFixtureFactory->deleteTaxRules(array_values($this->taxRules)); - } - if ($this->taxRates) { - $this->taxRuleFixtureFactory->deleteTaxRates(array_values($this->taxRates)); - } - if ($this->taxClasses) { - $this->taxRuleFixtureFactory->deleteTaxClasses(array_values($this->taxClasses)); - } - } - - /** - * Get fixture customer address - * - * @return \Magento\Customer\Model\Address - */ - private function getCustomerAddress() - { - $fixtureCustomerId = 1; - $customerAddress = $this->objectManager->create('Magento\Customer\Model\Address')->load($fixtureCustomerId); - /** Set data which corresponds tax class fixture */ - $customerAddress->setCountryId('US')->setRegionId(42)->save(); - return $customerAddress; - } } diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/StaticFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/StaticFilesTest.php index b81f07eba9023942433fa43c227a1452840d2167..c2d49fb844ecc4fd5908e3d3570c3a353a460f82 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/StaticFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/StaticFilesTest.php @@ -127,6 +127,8 @@ class StaticFilesTest extends \PHPUnit_Framework_TestCase return 'Magento/backend'; case 'install': return 'Magento/basic'; + case 'doc': + return 'Magento/blank'; default: throw new \LogicException('Unable to determine theme path'); } diff --git a/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/AuthTest.php b/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/AuthTest.php index ce0c856e232513b732beb2b6f8a6b732a1b3aa19..f61c085906b8fd7133f71ce9690f910cea7cf528 100644 --- a/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/AuthTest.php +++ b/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/AuthTest.php @@ -32,7 +32,7 @@ class AuthTest extends \Magento\Backend\Utility\Controller { /** * Test form existence - * @covers \Magento\User\Controller\Adminhtml\Auth::forgotpasswordAction + * @covers \Magento\User\Controller\Adminhtml\Auth\Forgotpassword::execute */ public function testFormForgotpasswordAction() { @@ -44,7 +44,7 @@ class AuthTest extends \Magento\Backend\Utility\Controller /** * Test redirection to startup page after success password recovering posting * - * @covers \Magento\User\Controller\Adminhtml\Auth::forgotpasswordAction + * @covers \Magento\User\Controller\Adminhtml\Auth\Forgotpassword::execute */ public function testForgotpasswordAction() { @@ -62,8 +62,7 @@ class AuthTest extends \Magento\Backend\Utility\Controller /** * Test reset password action * - * @covers \Magento\User\Controller\Adminhtml\Auth::resetPasswordAction - * @covers \Magento\User\Controller\Adminhtml\Auth::_validateResetPasswordLinkToken + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::execute * @magentoDataFixture Magento/User/_files/dummy_user.php */ public function testResetPasswordAction() @@ -91,8 +90,7 @@ class AuthTest extends \Magento\Backend\Utility\Controller } /** - * @covers \Magento\User\Controller\Adminhtml\Auth::resetPasswordAction - * @covers \Magento\User\Controller\Adminhtml\Auth::_validateResetPasswordLinkToken + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::execute */ public function testResetPasswordActionWithDummyToken() { @@ -107,8 +105,7 @@ class AuthTest extends \Magento\Backend\Utility\Controller /** * @dataProvider resetPasswordDataProvider - * @covers \Magento\User\Controller\Adminhtml\Auth::resetPasswordPostAction - * @covers \Magento\User\Controller\Adminhtml\Auth::_validateResetPasswordLinkToken + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::execute * @magentoDataFixture Magento/User/_files/dummy_user.php */ public function testResetPasswordPostAction($password, $passwordConfirmation, $isPasswordChanged) @@ -180,8 +177,7 @@ class AuthTest extends \Magento\Backend\Utility\Controller } /** - * @covers \Magento\User\Controller\Adminhtml\Auth::resetPasswordPostAction - * @covers \Magento\User\Controller\Adminhtml\Auth::_validateResetPasswordLinkToken + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::execute * @magentoDataFixture Magento/User/_files/dummy_user.php */ public function testResetPasswordPostActionWithDummyToken() @@ -202,8 +198,7 @@ class AuthTest extends \Magento\Backend\Utility\Controller } /** - * @covers \Magento\User\Controller\Adminhtml\Auth::resetPasswordPostAction - * @covers \Magento\User\Controller\Adminhtml\Auth::_validateResetPasswordLinkToken + * @covers \Magento\User\Controller\Adminhtml\Auth\ResetPassword::execute * @magentoDataFixture Magento/User/_files/dummy_user.php */ public function testResetPasswordPostActionWithInvalidPassword() diff --git a/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/User/RoleTest.php b/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/User/RoleTest.php index f6f57d4d4baffdacfa3c9d4124c0d5f2abdd43f7..b2ec0cea90a2b3dc1ace66a882f02691ac782068 100644 --- a/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/User/RoleTest.php +++ b/dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/User/RoleTest.php @@ -45,7 +45,7 @@ class RoleTest extends \Magento\Backend\Utility\Controller } /** - * @covers \Magento\User\Controller\Adminhtml\User\Role::editrolegridAction + * @covers \Magento\User\Controller\Adminhtml\User\Role\Editrolegrid::execute */ public function testEditrolegridAction() { @@ -56,7 +56,7 @@ class RoleTest extends \Magento\Backend\Utility\Controller } /** - * @covers \Magento\User\Controller\Adminhtml\User\Role::roleGridAction + * @covers \Magento\User\Controller\Adminhtml\User\Role\RoleGrid::execute */ public function testRoleGridAction() { diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Model/Product/PriceTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Model/Product/PriceTest.php index dc15afc0a125b02b9eaf0e9449b4e4e245efb683..16b3a626b3f79af9de05810b536087f935b41f46 100644 --- a/dev/tests/unit/testsuite/Magento/Bundle/Model/Product/PriceTest.php +++ b/dev/tests/unit/testsuite/Magento/Bundle/Model/Product/PriceTest.php @@ -53,7 +53,7 @@ class PriceTest extends \PHPUnit_Framework_TestCase /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $taxHelperMock; + protected $catalogHelperMock; /** * @var \PHPUnit_Framework_MockObject_MockObject @@ -78,7 +78,7 @@ class PriceTest extends \PHPUnit_Framework_TestCase $this->localeDateMock = $this->getMock('\Magento\Framework\Stdlib\DateTime\TimezoneInterface'); $this->customerSessionMock = $this->getMock('\Magento\Customer\Model\Session', array(), array(), '', false); $this->eventManagerMock = $this->getMock('\Magento\Framework\Event\ManagerInterface'); - $this->taxHelperMock = $this->getMock('\Magento\Tax\Helper\Data', array(), array(), '', false); + $this->catalogHelperMock = $this->getMock('\Magento\Catalog\Helper\Data', array(), array(), '', false); $this->storeMock = $this->getMock('\Magento\Store\Model\Store', array(), array(), '', false); $this->model = new \Magento\Bundle\Model\Product\Price( @@ -87,7 +87,7 @@ class PriceTest extends \PHPUnit_Framework_TestCase $this->localeDateMock, $this->customerSessionMock, $this->eventManagerMock, - $this->taxHelperMock + $this->catalogHelperMock ); } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/SaveTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/SaveTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c144c696fd813e565681c4e58e43a4aa753a5cef --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/SaveTest.php @@ -0,0 +1,258 @@ +<?php +/** + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute; + +/** + * @SuppressWarnings(PHPMD.TooManyFields) + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class SaveTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute\Save */ + protected $object; + /** @var \Magento\Catalog\Helper\Product\Edit\Action\Attribute|\PHPUnit_Framework_MockObject_MockObject */ + protected $attributeHelper; + /** @var \Magento\CatalogInventory\Service\V1\Data\StockItemBuilder|\PHPUnit_Framework_MockObject_MockObject */ + protected $stockItemBuilder; + /** @var \Magento\CatalogInventory\Model\Indexer\Stock\Processor|\PHPUnit_Framework_MockObject_MockObject */ + protected $stockIndexerProcessor; + + /** @var \Magento\Backend\App\Action\Context|\PHPUnit_Framework_MockObject_MockObject */ + protected $context; + /** @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $request; + /** @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ + protected $response; + /** @var \Magento\Framework\ObjectManager|\PHPUnit_Framework_MockObject_MockObject */ + protected $objectManager; + /** @var \Magento\Framework\Event\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $eventManager; + /** @var \Magento\Framework\UrlInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $url; + /** @var \Magento\Framework\App\Response\RedirectInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $redirect; + /** @var \Magento\Framework\App\ActionFlag|\PHPUnit_Framework_MockObject_MockObject */ + protected $actionFlag; + /** @var \Magento\Framework\App\ViewInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $view; + /** @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $messageManager; + /** @var \Magento\Backend\Model\Session|\PHPUnit_Framework_MockObject_MockObject */ + protected $session; + /** @var \Magento\Framework\AuthorizationInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $authorization; + /** @var \Magento\Backend\Model\Auth|\PHPUnit_Framework_MockObject_MockObject */ + protected $auth; + /** @var \Magento\Backend\Helper\Data|\PHPUnit_Framework_MockObject_MockObject */ + protected $helper; + /** @var \Magento\Backend\Model\UrlInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $backendUrl; + /** @var \Magento\Core\App\Action\FormKeyValidator|\PHPUnit_Framework_MockObject_MockObject */ + protected $formKeyValidator; + /** @var \Magento\Framework\App\Action\Title|\PHPUnit_Framework_MockObject_MockObject */ + protected $title; + /** @var \Magento\Framework\Locale\ResolverInterface|\PHPUnit_Framework_MockObject_MockObject */ + protected $localeResolver; + + /** @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject */ + protected $product; + /** @var \Magento\CatalogInventory\Service\V1\StockItemService|\PHPUnit_Framework_MockObject_MockObject */ + protected $stockItemService; + /** @var \Magento\CatalogInventory\Service\V1\Data\StockItem|\PHPUnit_Framework_MockObject_MockObject */ + protected $stockItem; + /** @var \Magento\CatalogInventory\Helper\Data|\PHPUnit_Framework_MockObject_MockObject */ + protected $inventoryHelper; + + protected function setUp() + { + $this->prepareContext(); + + $this->attributeHelper = $this->getMock( + 'Magento\Catalog\Helper\Product\Edit\Action\Attribute', + ['getProductIds', 'getSelectedStoreId'], + [], + '', + false + ); + + $this->stockItemBuilder = $this->getMock( + 'Magento\CatalogInventory\Service\V1\Data\StockItemBuilder', + ['mergeDataObjectWithArray'], + [], + '', + false + ); + + $this->stockIndexerProcessor = $this->getMock( + 'Magento\CatalogInventory\Model\Indexer\Stock\Processor', + ['reindexList'], + [], + '', + false + ); + + $this->object = (new \Magento\TestFramework\Helper\ObjectManager($this))->getObject( + 'Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute\Save', + [ + 'context' => $this->context, + 'attributeHelper' => $this->attributeHelper, + 'stockIndexerProcessor' => $this->stockIndexerProcessor, + 'stockItemBuilder' => $this->stockItemBuilder, + ] + ); + + } + + /** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + protected function prepareContext() + { + $this->request = $this->getMock( + 'Magento\Framework\App\RequestInterface', + ['getParam', 'getModuleName', 'setModuleName', 'getActionName', 'setActionName'], + [], + '', + false + ); + $this->response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); + $this->objectManager = $this->getMock( + 'Magento\Framework\ObjectManager', + ['configure', 'create', 'get'], + [], + '', + false + ); + $this->eventManager = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); + $this->url = $this->getMock('Magento\Framework\UrlInterface', [], [], '', false); + $this->redirect = $this->getMock('Magento\Framework\App\Response\RedirectInterface', [], [], '', false); + $this->actionFlag = $this->getMock('Magento\Framework\App\ActionFlag', [], [], '', false); + $this->view = $this->getMock('Magento\Framework\App\ViewInterface', [], [], '', false); + $this->messageManager = $this->getMock('Magento\Framework\Message\ManagerInterface', [], [], '', false); + $this->session = $this->getMock('Magento\Backend\Model\Session', [], [], '', false); + $this->authorization = $this->getMock('Magento\Framework\AuthorizationInterface', [], [], '', false); + $this->auth = $this->getMock('Magento\Backend\Model\Auth', [], [], '', false); + $this->helper = $this->getMock('Magento\Backend\Helper\Data', [], [], '', false); + $this->backendUrl = $this->getMock('Magento\Backend\Model\UrlInterface', [], [], '', false); + $this->formKeyValidator = $this->getMock('Magento\Core\App\Action\FormKeyValidator', [], [], '', false); + $this->title = $this->getMock('Magento\Framework\App\Action\Title', [], [], '', false); + $this->localeResolver = $this->getMock('Magento\Framework\Locale\ResolverInterface', [], [], '', false); + + $this->context = $this->context = $this->getMock( + 'Magento\Backend\App\Action\Context', + [ + 'getRequest', + 'getResponse', + 'getObjectManager', + 'getEventManager', + 'getUrl', + 'getRedirect', + 'getActionFlag', + 'getView', + 'getMessageManager', + 'getSession', + 'getAuthorization', + 'getAuth', + 'getHelper', + 'getBackendUrl', + 'getFormKeyValidator', + 'getTitle', + 'getLocaleResolver', + ], + [], + '', + false + ); + $this->context->expects($this->any())->method('getRequest')->will($this->returnValue($this->request)); + $this->context->expects($this->any())->method('getResponse')->will($this->returnValue($this->response)); + $this->context->expects($this->any())->method('getObjectManager') + ->will($this->returnValue($this->objectManager)); + $this->context->expects($this->any())->method('getEventManager')->will($this->returnValue($this->eventManager)); + $this->context->expects($this->any())->method('getUrl')->will($this->returnValue($this->url)); + $this->context->expects($this->any())->method('getRedirect')->will($this->returnValue($this->redirect)); + $this->context->expects($this->any())->method('getActionFlag')->will($this->returnValue($this->actionFlag)); + $this->context->expects($this->any())->method('getView')->will($this->returnValue($this->view)); + $this->context->expects($this->any())->method('getMessageManager') + ->will($this->returnValue($this->messageManager)); + $this->context->expects($this->any())->method('getSession')->will($this->returnValue($this->session)); + $this->context->expects($this->any())->method('getAuthorization') + ->will($this->returnValue($this->authorization)); + $this->context->expects($this->any())->method('getAuth')->will($this->returnValue($this->auth)); + $this->context->expects($this->any())->method('getHelper')->will($this->returnValue($this->helper)); + $this->context->expects($this->any())->method('getBackendUrl')->will($this->returnValue($this->backendUrl)); + $this->context->expects($this->any())->method('getFormKeyValidator') + ->will($this->returnValue($this->formKeyValidator)); + $this->context->expects($this->any())->method('getTitle')->will($this->returnValue($this->title)); + $this->context->expects($this->any())->method('getLocaleResolver') + ->will($this->returnValue($this->localeResolver)); + + $this->product = $this->getMock( + 'Magento\Catalog\Model\Product', + ['isProductsHasSku', '__wakeup'], + [], + '', + false + ); + $this->stockItemService = $this->getMock( + 'Magento\CatalogInventory\Service\V1\StockItemService', + ['getStockItem', 'saveStockItem'], + [], + '', + false + ); + $this->stockItem = $this->getMock('Magento\CatalogInventory\Service\V1\Data\StockItem', [], [], '', false); + $this->inventoryHelper + = $this->getMock('Magento\CatalogInventory\Helper\Data', ['getConfigItemOptions'], [], '', false); + + $this->objectManager->expects($this->any())->method('create')->will($this->returnValueMap([ + ['Magento\Catalog\Model\Product', [], $this->product], + ['Magento\CatalogInventory\Service\V1\StockItemService', [], $this->stockItemService], + ])); + + $this->objectManager->expects($this->any())->method('get')->will($this->returnValueMap([ + ['Magento\CatalogInventory\Helper\Data', $this->inventoryHelper], + ])); + } + + public function testExecuteThatProductIdsAreObtainedFromAttributeHelper() + { + $this->attributeHelper->expects($this->any())->method('getProductIds')->will($this->returnValue([5])); + $this->attributeHelper->expects($this->any())->method('getSelectedStoreId')->will($this->returnValue([1])); + $this->inventoryHelper->expects($this->any())->method('getConfigItemOptions')->will($this->returnValue([])); + $this->product->expects($this->any())->method('isProductsHasSku')->with([5])->will($this->returnValue(true)); + $this->stockItemService->expects($this->any())->method('getStockItem')->with(5) + ->will($this->returnValue($this->stockItem)); + $this->stockIndexerProcessor->expects($this->any())->method('reindexList')->with([5]); + + $this->request->expects($this->any())->method('getParam')->will($this->returnValueMap([ + ['inventory', [], [7]] + ])); + + $this->messageManager->expects($this->never())->method('addError'); + $this->messageManager->expects($this->never())->method('addException'); + + $this->object->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/ShippingTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/ShippingTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d8691787acb26377214ae6f5c04f1f2f80e91cee --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/ShippingTest.php @@ -0,0 +1,85 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Block\Cart; + +class ShippingTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\TestFramework\Helper\ObjectManager */ + protected $objectManager; + + protected $shippingBlock; + + protected function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + } + + public function testGetShippingPriceHtml() + { + $shippingRateMock = $this->getMockBuilder('\Magento\Sales\Model\Quote\Address\Rate') + ->disableOriginalConstructor() + ->getMock(); + + $shippingPriceHtml = "$3.25 ($3.56 Incl Tax)"; + + $priceBlockMock = $this->getMockBuilder('\Magento\Checkout\Block\Shipping\Price') + ->disableOriginalConstructor() + ->setMethods(['setShippingRate', 'toHtml']) + ->getMock(); + + $priceBlockMock->expects($this->once()) + ->method('setShippingRate') + ->with($shippingRateMock); + + $priceBlockMock->expects($this->once()) + ->method('toHtml') + ->will($this->returnValue($shippingPriceHtml)); + + $layoutMock = $this->getMockBuilder('\Magento\Framework\View\Layout') + ->disableOriginalConstructor() + ->getMock(); + + $layoutMock->expects($this->once()) + ->method('getBlock') + ->with('checkout.shipping.price') + ->will($this->returnValue($priceBlockMock)); + + $contextMock = $this->getMockBuilder('\Magento\Framework\View\Element\Template\Context') + ->disableOriginalConstructor() + ->setMethods(['getLayout']) + ->getMock(); + + $contextMock->expects($this->once()) + ->method('getLayout') + ->will($this->returnValue($layoutMock)); + + /** @var \Magento\Checkout\Block\Cart\Shipping $shippingBlock */ + $shippingBlock = $this->objectManager->getObject( + '\Magento\Checkout\Block\Cart\Shipping', + ['context' => $contextMock] + ); + + $this->assertEquals($shippingPriceHtml, $shippingBlock->getShippingPriceHtml($shippingRateMock)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/Sidebar/TotalsTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/Sidebar/TotalsTest.php new file mode 100644 index 0000000000000000000000000000000000000000..a0965a93edda6a76102eb9e42c109b38915c77d9 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/Sidebar/TotalsTest.php @@ -0,0 +1,87 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Block\Cart\Sidebar; + +use Magento\Framework\Object; + +class TotalsTest extends \PHPUnit_Framework_TestCase +{ + const SUBTOTAL = 10; + + /** + * @var \Magento\Checkout\Block\Cart\Sidebar\Totals + */ + protected $totalsObj; + + /** + * @var \Magento\Sales\Model\Quote|\PHPUnit_Framework_MockObject_MockObject + */ + protected $quote; + + protected function setUp() + { + parent::setUp(); + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->quote = $this->getMockBuilder('Magento\Sales\Model\Quote') + ->disableOriginalConstructor() + ->setMethods(['getTotals', '__wakeup']) + ->getMock(); + + $checkoutSession = $this->getMockBuilder('\Magento\Checkout\Model\Session') + ->disableOriginalConstructor() + ->setMethods(['getQuote', '__wakeup']) + ->getMock(); + + $checkoutSession->expects($this->once()) + ->method('getQuote') + ->will($this->returnValue($this->quote)); + + $this->totalsObj = $objectManager->getObject( + '\Magento\Checkout\Block\Cart\Sidebar\Totals', + ['checkoutSession' => $checkoutSession] + ); + } + + public function testGetSubtotal() + { + $subtotal = new Object(['value' => self::SUBTOTAL]); + $totals = ['subtotal' => $subtotal]; + $this->quote->expects($this->once()) + ->method('getTotals') + ->will($this->returnValue($totals)); + + $this->assertEquals(self::SUBTOTAL, $this->totalsObj->getSubtotal()); + } + + public function testGetSubtotalZero() + { + $totals = []; + $this->quote->expects($this->once()) + ->method('getTotals') + ->will($this->returnValue($totals)); + + $this->assertEquals(0, $this->totalsObj->getSubtotal()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php index 7f3b690b39a455e6ba5c520e49d6fbae33e0f8f8..8f5c374ee0f5a2760c84cbc685638ff3baa739f9 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php @@ -129,4 +129,43 @@ class SidebarTest extends \PHPUnit_Framework_TestCase $block->setData('custom_quote', $quote); $this->assertEquals($product->getIdentities(), $block->getIdentities()); } + + public function testGetTotalsHtml() + { + $totalsHtml = "$134.36"; + $totalsBlockMock = $this->getMockBuilder('\Magento\Checkout\Block\Shipping\Price') + ->disableOriginalConstructor() + ->setMethods(['toHtml']) + ->getMock(); + + $totalsBlockMock->expects($this->once()) + ->method('toHtml') + ->will($this->returnValue($totalsHtml)); + + $layoutMock = $this->getMockBuilder('\Magento\Framework\View\Layout') + ->disableOriginalConstructor() + ->getMock(); + + $layoutMock->expects($this->once()) + ->method('getBlock') + ->with('checkout.cart.minicart.totals') + ->will($this->returnValue($totalsBlockMock)); + + $contextMock = $this->getMockBuilder('\Magento\Framework\View\Element\Template\Context') + ->disableOriginalConstructor() + ->setMethods(['getLayout']) + ->getMock(); + + $contextMock->expects($this->once()) + ->method('getLayout') + ->will($this->returnValue($layoutMock)); + + /** @var \Magento\Checkout\Block\Cart\SideBar $sidebarBlock */ + $sidebarBlock = $this->_objectManager->getObject( + '\Magento\Checkout\Block\Cart\SideBar', + ['context' => $contextMock] + ); + + $this->assertEquals($totalsHtml, $sidebarBlock->getTotalsHtml()); + } } diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Item/Price/RendererTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Item/Price/RendererTest.php new file mode 100644 index 0000000000000000000000000000000000000000..59a461d7081e7429ae2abb695a81326f2d4c3548 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Item/Price/RendererTest.php @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Block\Item\Price; + +use Magento\Checkout\Block\Item\Price\Renderer; + +class RendererTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Renderer + */ + protected $renderer; + + protected function setUp() + { + $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->renderer = $objectManagerHelper->getObject( + 'Magento\Checkout\Block\Item\Price\Renderer' + ); + } + + public function testSetItem() + { + $item = $this->getMockBuilder('Magento\Sales\Model\Quote\Item\AbstractItem') + ->disableOriginalConstructor() + ->getMock(); + + $this->renderer->setItem($item); + $this->assertEquals($item, $this->renderer->getItem()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Onepage/AbstractOnepageTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Onepage/AbstractOnepageTest.php new file mode 100644 index 0000000000000000000000000000000000000000..57d9eea9583d9883a5813db2b7400c0245e9c2bd --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Onepage/AbstractOnepageTest.php @@ -0,0 +1,85 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Block\Onepage; + +class AbstractOnepageTest extends \PHPUnit_Framework_TestCase +{ + /** @var \Magento\TestFramework\Helper\ObjectManager */ + protected $objectManager; + + protected $shippingBlock; + + protected function setUp() + { + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + } + + public function testGetShippingPriceHtml() + { + $shippingRateMock = $this->getMockBuilder('\Magento\Sales\Model\Quote\Address\Rate') + ->disableOriginalConstructor() + ->getMock(); + + $shippingPriceHtml = "$3.25 ($3.56 Incl Tax)"; + + $priceBlockMock = $this->getMockBuilder('\Magento\Checkout\Block\Shipping\Price') + ->disableOriginalConstructor() + ->setMethods(['setShippingRate', 'toHtml']) + ->getMock(); + + $priceBlockMock->expects($this->once()) + ->method('setShippingRate') + ->with($shippingRateMock); + + $priceBlockMock->expects($this->once()) + ->method('toHtml') + ->will($this->returnValue($shippingPriceHtml)); + + $layoutMock = $this->getMockBuilder('\Magento\Framework\View\Layout') + ->disableOriginalConstructor() + ->getMock(); + + $layoutMock->expects($this->once()) + ->method('getBlock') + ->with('checkout.shipping.price') + ->will($this->returnValue($priceBlockMock)); + + $contextMock = $this->getMockBuilder('\Magento\Framework\View\Element\Template\Context') + ->disableOriginalConstructor() + ->setMethods(['getLayout']) + ->getMock(); + + $contextMock->expects($this->once()) + ->method('getLayout') + ->will($this->returnValue($layoutMock)); + + /** @var \Magento\Checkout\Block\Onepage\AbstractOnepage $onepage */ + $onepage = $this->objectManager->getObject( + '\Magento\Checkout\Block\Cart\Shipping', + ['context' => $contextMock] + ); + + $this->assertEquals($shippingPriceHtml, $onepage->getShippingPriceHtml($shippingRateMock)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Onepage/ProgressTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Onepage/ProgressTest.php index 07d4674b5b13409bd2f6868fb01c848d81c6a170..ca4d602ff0e6b65bea773f97206a10b60cbb579a 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Block/Onepage/ProgressTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Onepage/ProgressTest.php @@ -98,37 +98,17 @@ class ProgressTest extends \PHPUnit_Framework_TestCase } /** - * @param bool $inclTax + * Test getShippingRate method */ - private function _prepareTestGetShippingPrice($inclTax) + public function testGetShippingRate() { $rate = $this->getMock('Magento\Sales\Model\Quote\Address\Rate', ['__wakeup'], [], '', false); - $rate->setPrice(self::SHIPPING_PRICE); $this->shippingAddress->setShippingMethod(self::SHIPPING_METHOD); $this->shippingAddress->expects($this->once()) ->method('getShippingRateByCode') ->with(self::SHIPPING_METHOD) ->will($this->returnValue($rate)); - $this->taxHelper->expects($this->once()) - ->method('getShippingPrice') - ->with(self::SHIPPING_PRICE, $inclTax ? $this->isTrue() : $this->isFalse(), $this->shippingAddress) - ->will($this->returnValue(self::SHIPPING_PRICE_WITH_TAX)); - $this->store->expects($this->once()) - ->method('formatPrice') - ->with(self::SHIPPING_PRICE_WITH_TAX) - ->will($this->returnValue(self::SHIPPING_PRICE_FORMATTED)); - } - - public function testGetShippingPriceInclTax() - { - $this->_prepareTestGetShippingPrice(true); - $this->assertEquals(self::SHIPPING_PRICE_FORMATTED, $this->model->getShippingPriceInclTax()); - } - - public function testGetShippingPriceExclTax() - { - $this->_prepareTestGetShippingPrice(false); - $this->assertEquals(self::SHIPPING_PRICE_FORMATTED, $this->model->getShippingPriceExclTax()); + $this->assertEquals($rate, $this->model->getShippingRate()); } } diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Shipping/PriceTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Shipping/PriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..f94db86a1ae0c059ab6b04f137d4278aa4f76f23 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Shipping/PriceTest.php @@ -0,0 +1,101 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Checkout\Block\Shipping; + +use Magento\Framework\Object; + +class PriceTest extends \PHPUnit_Framework_TestCase +{ + const SUBTOTAL = 10; + + /** + * @var \Magento\Checkout\Block\Shipping\Price + */ + protected $priceObj; + + /** + * @var \Magento\Sales\Model\Quote|\PHPUnit_Framework_MockObject_MockObject + */ + protected $quote; + + /** + * @var \Magento\Store\Model\Store|\PHPUnit_Framework_MockObject_MockObject + */ + protected $store; + + protected function setUp() + { + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->store = $this->getMockBuilder('Magento\Store\Model\Store') + ->disableOriginalConstructor() + ->setMethods(['convertPrice', '__wakeup']) + ->getMock(); + + $this->quote = $this->getMockBuilder('Magento\Sales\Model\Quote') + ->disableOriginalConstructor() + ->setMethods(['getStore', '__wakeup']) + ->getMock(); + + $this->quote->expects($this->once()) + ->method('getStore') + ->will($this->returnValue($this->store)); + + $checkoutSession = $this->getMockBuilder('\Magento\Checkout\Model\Session') + ->disableOriginalConstructor() + ->setMethods(['getQuote', '__wakeup']) + ->getMock(); + + $checkoutSession->expects($this->once()) + ->method('getQuote') + ->will($this->returnValue($this->quote)); + + $this->priceObj = $objectManager->getObject( + '\Magento\Checkout\Block\Shipping\Price', + ['checkoutSession' => $checkoutSession] + ); + } + + public function testGetShippingPrice() + { + $shippingPrice = 5; + $convertedPrice = "$5"; + + $shippingRateMock = $this->getMockBuilder('\Magento\Sales\Model\Quote\Address\Rate') + ->disableOriginalConstructor() + ->setMethods(['getPrice', '__wakeup']) + ->getMock(); + $shippingRateMock->expects($this->once()) + ->method('getPrice') + ->will($this->returnValue($shippingPrice)); + + $this->store->expects($this->once()) + ->method('convertPrice') + ->with($shippingPrice, true, true) + ->will($this->returnValue($convertedPrice)); + + $this->priceObj->setShippingRate($shippingRateMock); + $this->assertEquals($convertedPrice, $this->priceObj->getShippingPrice()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/SalesRule/Model/ValidatorTest.php b/dev/tests/unit/testsuite/Magento/SalesRule/Model/ValidatorTest.php index a2c29e03ce83d9ba41162ae13eb947f9a0912b1f..d9b847c6c4b3c0ff57c43dd1b1a3e7b3838141c0 100644 --- a/dev/tests/unit/testsuite/Magento/SalesRule/Model/ValidatorTest.php +++ b/dev/tests/unit/testsuite/Magento/SalesRule/Model/ValidatorTest.php @@ -196,7 +196,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase '', false ); - $taxData = $this->getMock('Magento\Tax\Helper\Data', [], [], '', false); + $catalogData = $this->getMock('Magento\Catalog\Helper\Data', [], [], '', false); $utility = $this->getMock('Magento\SalesRule\Model\Utility', [], [], '', false); /** @var \Magento\SalesRule\Model\Validator|\PHPUnit_Framework_MockObject_MockObject $validator */ @@ -207,7 +207,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase 'context' => $context, 'registry' => $registry, 'collectionFactory' => $collectionFactory, - 'taxData' => $taxData, + 'catalogData' => $catalogData, 'utility' => $utility, 'rulesApplier' => $rulesApplier ], diff --git a/dev/tests/unit/testsuite/Magento/Tax/Block/Checkout/Cart/Sidebar/TotalsTest.php b/dev/tests/unit/testsuite/Magento/Tax/Block/Checkout/Cart/Sidebar/TotalsTest.php new file mode 100644 index 0000000000000000000000000000000000000000..231fae9eb1fdde322c8afbb4f896f8b5353c2eac --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Tax/Block/Checkout/Cart/Sidebar/TotalsTest.php @@ -0,0 +1,220 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Tax\Block\Checkout\Cart\Sidebar; + +use Magento\Framework\Object; + +class TotalsTest extends \PHPUnit_Framework_TestCase +{ + const SUBTOTAL_EXCL_TAX = 9.8; + const SUBTOTAL_INCL_TAX = 10.3; + const SUBTOTAL = 10; + + /** + * @var \Magento\Tax\Block\Checkout\Cart\Sidebar\Totals + */ + protected $totalsObj; + + /** + * @var \Magento\Sales\Model\Quote|\PHPUnit_Framework_MockObject_MockObject + */ + protected $quote; + + /** + * @var \Magento\Tax\Model\Config|\PHPUnit_Framework_MockObject_MockObject + */ + protected $taxConfig; + + /** + * @var \Magento\Tax\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + */ + protected $taxHelper; + + protected function setUp() + { + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->quote = $this->getMockBuilder('Magento\Sales\Model\Quote') + ->disableOriginalConstructor() + ->setMethods(['getTotals', '__wakeup']) + ->getMock(); + + $checkoutSession = $this->getMockBuilder('\Magento\Checkout\Model\Session') + ->disableOriginalConstructor() + ->setMethods(['getQuote', '__wakeup']) + ->getMock(); + + $checkoutSession->expects($this->any()) + ->method('getQuote') + ->will($this->returnValue($this->quote)); + + $this->taxHelper = $this->getMockBuilder('\Magento\Tax\Helper\Data') + ->disableOriginalConstructor() + ->setMethods([ + 'getIncExcText' + ]) + ->getMock(); + + $this->taxConfig = $this->getMockBuilder('\Magento\Tax\Model\Config') + ->disableOriginalConstructor() + ->setMethods([ + 'displayCartSubtotalInclTax', 'displayCartSubtotalExclTax', 'displayCartSubtotalBoth' + ]) + ->getMock(); + + $this->totalsObj = $objectManager->getObject( + '\Magento\Tax\Block\Checkout\Cart\Sidebar\Totals', + [ + 'checkoutSession' => $checkoutSession, + 'taxHelper' => $this->taxHelper, + 'taxConfig' => $this->taxConfig, + ] + ); + } + + /** + * @dataProvider getSubtotalInclTaxDataProvider + */ + public function testGetSubtotalInclTax($totals, $expectedValue) + { + $this->quote->expects($this->once()) + ->method('getTotals') + ->will($this->returnValue($totals)); + + $this->assertEquals($expectedValue, $this->totalsObj->getSubtotalInclTax()); + } + + public function getSubtotalInclTaxDataProvider() + { + $data = [ + 'incl' => [ + 'totals' => [ + 'subtotal' => new Object( + [ + 'value_incl_tax' => self::SUBTOTAL_INCL_TAX, + 'value' => self::SUBTOTAL, + ] + ), + ], + 'expected' => self::SUBTOTAL_INCL_TAX, + ], + 'no_incl_value' => [ + 'totals' => [ + 'subtotal' => new Object( + [ + 'value' => self::SUBTOTAL, + ] + ), + ], + 'expected' => self::SUBTOTAL, + ], + 'no_subtotal' => [ + 'totals' => [], + 'expected' => 0, + ] + ]; + return $data; + } + + /** + * @dataProvider getSubtotalExclTaxDataProvider + */ + public function testGetSubtotalExclTax($totals, $expectedValue) + { + $this->quote->expects($this->once()) + ->method('getTotals') + ->will($this->returnValue($totals)); + + $this->assertEquals($expectedValue, $this->totalsObj->getSubtotalExclTax()); + } + + public function getSubtotalExclTaxDataProvider() + { + $data = [ + 'excl' => [ + 'totals' => [ + 'subtotal' => new Object( + [ + 'value_excl_tax' => self::SUBTOTAL_EXCL_TAX, + 'value' => self::SUBTOTAL, + ] + ), + ], + 'expected' => self::SUBTOTAL_EXCL_TAX, + ], + 'no_excl_value' => [ + 'totals' => [ + 'subtotal' => new Object( + [ + 'value' => self::SUBTOTAL, + ] + ), + ], + 'expected' => self::SUBTOTAL, + ], + 'no_subtotal' => [ + 'totals' => [], + 'expected' => 0, + ] + ]; + return $data; + } + + public function testGetDisplaySubtotalInclTax() + { + $this->taxConfig->expects($this->once()) + ->method('displayCartSubtotalInclTax'); + + $this->totalsObj->getDisplaySubtotalInclTax(); + } + + public function testGetDisplaySubtotalExclTax() + { + $this->taxConfig->expects($this->once()) + ->method('displayCartSubtotalExclTax'); + + $this->totalsObj->getDisplaySubtotalExclTax(); + } + + public function testGetDisplaySubtotalBoth() + { + $this->taxConfig->expects($this->once()) + ->method('displayCartSubtotalBoth'); + + $this->totalsObj->getDisplaySubtotalBoth(); + } + + public function testGetIncExcTaxLabel() + { + $flag = true; + $text = "Incl. Tax"; + $expected = " (Incl. Tax)"; + $this->taxHelper->expects($this->once()) + ->method('getIncExcText') + ->with($flag) + ->will($this->returnValue($text)); + + $this->assertEquals($expected, $this->totalsObj->getIncExcTaxLabel($flag)); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Tax/Block/Checkout/Shipping/PriceTest.php b/dev/tests/unit/testsuite/Magento/Tax/Block/Checkout/Shipping/PriceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..56acf3d7be556c98553bd6e0d779c64316c936d7 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Tax/Block/Checkout/Shipping/PriceTest.php @@ -0,0 +1,167 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Tax\Block\Checkout\Shipping; + +use Magento\Framework\Object; + +class PriceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Tax\Block\Checkout\Shipping\Price + */ + protected $priceObj; + + /** + * @var \Magento\Sales\Model\Quote|\PHPUnit_Framework_MockObject_MockObject + */ + protected $quote; + + /** + * @var \Magento\Store\Model\Store|\PHPUnit_Framework_MockObject_MockObject + */ + protected $store; + + /** + * @var \Magento\Tax\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + */ + protected $taxHelper; + + protected function setUp() + { + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->store = $this->getMockBuilder('Magento\Store\Model\Store') + ->disableOriginalConstructor() + ->setMethods(['convertPrice', '__wakeup']) + ->getMock(); + + $this->quote = $this->getMockBuilder('Magento\Sales\Model\Quote') + ->disableOriginalConstructor() + ->setMethods(['getStore', '__wakeup', 'getCustomerTaxClassId']) + ->getMock(); + + $this->quote->expects($this->any()) + ->method('getStore') + ->will($this->returnValue($this->store)); + + $checkoutSession = $this->getMockBuilder('\Magento\Checkout\Model\Session') + ->disableOriginalConstructor() + ->setMethods(['getQuote', '__wakeup']) + ->getMock(); + + $checkoutSession->expects($this->any()) + ->method('getQuote') + ->will($this->returnValue($this->quote)); + + $this->taxHelper = $this->getMockBuilder('\Magento\Tax\Helper\Data') + ->disableOriginalConstructor() + ->setMethods([ + 'getShippingPrice', 'displayShippingPriceIncludingTax', 'displayShippingBothPrices' + ]) + ->getMock(); + + $this->priceObj = $objectManager->getObject( + '\Magento\Tax\Block\Checkout\Shipping\Price', + [ + 'checkoutSession' => $checkoutSession, + 'taxHelper' => $this->taxHelper, + ] + ); + } + + /** + * @param float $shippingPrice + * @return \Magento\Sales\Model\Quote\Address\Rate|\PHPUnit_Framework_MockObject_MockObject + */ + protected function setupShippingRate($shippingPrice) + { + $shippingRateMock = $this->getMockBuilder('\Magento\Sales\Model\Quote\Address\Rate') + ->disableOriginalConstructor() + ->setMethods(['getPrice', '__wakeup']) + ->getMock(); + $shippingRateMock->expects($this->once()) + ->method('getPrice') + ->will($this->returnValue($shippingPrice)); + return $shippingRateMock; + } + + public function testGetShippingPriceExclTax() + { + $shippingPrice = 5; + $shippingPriceExclTax = 4.5; + $convertedPrice = "$4.50"; + + $shippingRateMock = $this->setupShippingRate($shippingPrice); + + $this->taxHelper->expects($this->once()) + ->method('getShippingPrice') + ->will($this->returnValue($shippingPriceExclTax)); + + $this->store->expects($this->once()) + ->method('convertPrice') + ->with($shippingPriceExclTax, true, true) + ->will($this->returnValue($convertedPrice)); + + $this->priceObj->setShippingRate($shippingRateMock); + $this->assertEquals($convertedPrice, $this->priceObj->getShippingPriceExclTax()); + } + + public function testGetShippingPriceInclTax() + { + $shippingPrice = 5; + $shippingPriceInclTax = 5.5; + $convertedPrice = "$5.50"; + + $shippingRateMock = $this->setupShippingRate($shippingPrice); + + $this->taxHelper->expects($this->once()) + ->method('getShippingPrice') + ->will($this->returnValue($shippingPriceInclTax)); + + $this->store->expects($this->once()) + ->method('convertPrice') + ->with($shippingPriceInclTax, true, true) + ->will($this->returnValue($convertedPrice)); + + $this->priceObj->setShippingRate($shippingRateMock); + $this->assertEquals($convertedPrice, $this->priceObj->getShippingPriceExclTax()); + } + + + public function testDisplayShippingPriceInclTax() + { + $this->taxHelper->expects($this->once()) + ->method('displayShippingPriceIncludingTax'); + + $this->priceObj->displayShippingPriceInclTax(); + } + + public function testDisplayShippingBothPrices() + { + $this->taxHelper->expects($this->once()) + ->method('displayShippingBothPrices'); + + $this->priceObj->displayShippingBothPrices(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Tax/Block/Item/Price/RendererTest.php b/dev/tests/unit/testsuite/Magento/Tax/Block/Item/Price/RendererTest.php new file mode 100644 index 0000000000000000000000000000000000000000..3557f30c30df0391d3aea07ce9109a2d7ade4b98 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Tax/Block/Item/Price/RendererTest.php @@ -0,0 +1,82 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Tax\Block\Item\Price; + +use Magento\Framework\Object; + +class RendererTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Tax\Block\Item\Price\Renderer + */ + protected $renderer; + + /** + * @var \Magento\Tax\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + */ + protected $taxHelper; + + protected function setUp() + { + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->taxHelper = $this->getMockBuilder('\Magento\Tax\Helper\Data') + ->disableOriginalConstructor() + ->setMethods([ + 'displayCartPriceExclTax', 'displayCartBothPrices', 'displayCartPriceInclTax' + ]) + ->getMock(); + + $this->renderer = $objectManager->getObject( + '\Magento\Tax\Block\Item\Price\Renderer', + [ + 'taxHelper' => $this->taxHelper, + ] + ); + } + + public function testDisplayPriceInclTax() + { + $this->taxHelper->expects($this->once()) + ->method('displayCartPriceInclTax'); + + $this->renderer->displayPriceInclTax(); + } + + public function testDisplayPriceExclTax() + { + $this->taxHelper->expects($this->once()) + ->method('displayCartPriceExclTax'); + + $this->renderer->displayPriceExclTax(); + } + + public function testDisplayBothPrices() + { + $this->taxHelper->expects($this->once()) + ->method('displayCartBothPrices'); + + $this->renderer->displayBothPrices(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Tax/Pricing/AdjustmentTest.php b/dev/tests/unit/testsuite/Magento/Tax/Pricing/AdjustmentTest.php index ed4708b27ca52b1ad1eaeab53a2ff7c11b942c1b..e51ef07a8792000d0920ac56509e1f474e4926b2 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Pricing/AdjustmentTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Pricing/AdjustmentTest.php @@ -38,6 +38,11 @@ class AdjustmentTest extends \PHPUnit_Framework_TestCase */ protected $taxHelper; + /** + * @var \Magento\Catalog\Helper\Data | \PHPUnit_Framework_MockObject_MockObject + */ + protected $catalogHelper; + /** * @var int */ @@ -46,7 +51,8 @@ class AdjustmentTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->taxHelper = $this->getMock('Magento\Tax\Helper\Data', [], [], '', false); - $this->adjustment = new Adjustment($this->taxHelper, $this->sortOrder); + $this->catalogHelper = $this->getMock('Magento\Catalog\Helper\Data', [], [], '', false); + $this->adjustment = new Adjustment($this->taxHelper, $this->catalogHelper, $this->sortOrder); } public function testGetAdjustmentCode() @@ -115,12 +121,8 @@ class AdjustmentTest extends \PHPUnit_Framework_TestCase $this->taxHelper->expects($this->any()) ->method('priceIncludesTax') ->will($this->returnValue($isPriceIncludesTax)); - $this->taxHelper->expects($this->any()) - ->method('getPrice') - ->with($object, $amount) - ->will($this->returnValue($price)); - $this->taxHelper->expects($this->any()) - ->method('getPriceUnrounded') + $this->catalogHelper->expects($this->any()) + ->method('getTaxPrice') ->with($object, $amount) ->will($this->returnValue($price)); @@ -151,12 +153,8 @@ class AdjustmentTest extends \PHPUnit_Framework_TestCase $this->taxHelper->expects($this->any()) ->method('priceIncludesTax') ->will($this->returnValue($isPriceIncludesTax)); - $this->taxHelper->expects($this->any()) - ->method('getPrice') - ->with($object, $amount, !$isPriceIncludesTax) - ->will($this->returnValue($price)); - $this->taxHelper->expects($this->any()) - ->method('getPriceUnrounded') + $this->catalogHelper->expects($this->any()) + ->method('getTaxPrice') ->with($object, $amount, !$isPriceIncludesTax) ->will($this->returnValue($price)); diff --git a/dev/tests/unit/testsuite/Magento/Weee/Block/Item/Price/RendererTest.php b/dev/tests/unit/testsuite/Magento/Weee/Block/Item/Price/RendererTest.php new file mode 100644 index 0000000000000000000000000000000000000000..2229ad11bcd70c4c0a54d2cbef4c779c8d13d12a --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Weee/Block/Item/Price/RendererTest.php @@ -0,0 +1,499 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Weee\Block\Item\Price; + +use Magento\Framework\Object; +use Magento\Weee\Model\Tax as WeeeDisplayConfig; + +class RendererTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Weee\Block\Item\Price\Renderer + */ + protected $renderer; + + /** + * @var \Magento\Weee\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + */ + protected $weeeHelper; + + /** + * @var \Magento\Directory\Model\PriceCurrency|\PHPUnit_Framework_MockObject_MockObject + */ + protected $priceCurrency; + + /** + * @var \Magento\Sales\Model\Quote\Item|\PHPUnit_Framework_MockObject_MockObject + */ + protected $item; + + protected function setUp() + { + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->weeeHelper = $this->getMockBuilder('\Magento\Weee\Helper\Data') + ->disableOriginalConstructor() + ->setMethods([ + 'isEnabled', 'typeOfDisplay', 'getWeeeTaxInclTax', 'getRowWeeeTaxInclTax' + ]) + ->getMock(); + + $this->priceCurrency = $this->getMockBuilder('\Magento\Directory\Model\PriceCurrency') + ->disableOriginalConstructor() + ->setMethods(['format']) + ->getMock(); + + $this->item = $this->getMockBuilder('\Magento\Sales\Model\Quote\Item') + ->disableOriginalConstructor() + ->setMethods([ + '__wakeup', + 'getWeeeTaxAppliedAmount', + 'getPriceInclTax', + 'getRowTotalInclTax', + 'getCalculationPrice', + 'getRowTotal', + 'getWeeeTaxAppliedRowAmount', + ]) + ->getMock(); + + $this->renderer = $objectManager->getObject( + '\Magento\Weee\Block\Item\Price\Renderer', + [ + 'weeeHelper' => $this->weeeHelper, + 'priceCurrency' => $this->priceCurrency, + ] + ); + $this->renderer->setItem($this->item); + } + + /** + * @param bool $isWeeeEnabled + * @param bool #showWeeeDetails + * @param bool $hasWeeeAmount + * @dataProvider testDisplayPriceWithWeeeDetailsDataProvider + */ + public function testDisplayPriceWithWeeeDetails($isWeeeEnabled, $showWeeeDetails, $hasWeeeAmount, $expectedValue) + { + $this->weeeHelper->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue($isWeeeEnabled)); + + $this->weeeHelper->expects($this->any()) + ->method('typeOfDisplay') + ->with([WeeeDisplayConfig::DISPLAY_INCL_DESCR], 'sales', null) + ->will($this->returnValue($showWeeeDetails)); + + $this->item->expects($this->any()) + ->method('getWeeeTaxAppliedAmount') + ->will($this->returnValue($hasWeeeAmount)); + + $this->assertEquals($expectedValue, $this->renderer->displayPriceWithWeeeDetails()); + } + + public function testDisplayPriceWithWeeeDetailsDataProvider() + { + $data = [ + 'weee_disabled_true_true' => [ + 'isWeeeEnabled' => false, + 'showWeeeDetails' => true, + 'hasWeeeAmount' => true, + 'expectedValue' => false, + ], + 'weee_disabled_true_false' => [ + 'isWeeeEnabled' => false, + 'showWeeeDetails' => true, + 'hasWeeeAmount' => false, + 'expectedValue' => false, + ], + 'weee_disabled_false_true' => [ + 'isWeeeEnabled' => false, + 'showWeeeDetails' => false, + 'hasWeeeAmount' => true, + 'expectedValue' => false, + ], + 'weee_disabled_false_false' => [ + 'isWeeeEnabled' => false, + 'showWeeeDetails' => false, + 'hasWeeeAmount' => false, + 'expectedValue' => false, + ], + 'weee_enabled_showdetail_true' => [ + 'isWeeeEnabled' => true, + 'showWeeeDetails' => true, + 'hasWeeeAmount' => true, + 'expectedValue' => true, + ], + 'weee_enabled_showdetail_false' => [ + 'isWeeeEnabled' => true, + 'showWeeeDetails' => true, + 'hasWeeeAmount' => false, + 'expectedValue' => false, + ], + 'weee_enabled_not_showing_detail_true' => [ + 'isWeeeEnabled' => true, + 'showWeeeDetails' => false, + 'hasWeeeAmount' => true, + 'expectedValue' => false, + ], + 'weee_enabled_not_showing_detail_false' => [ + 'isWeeeEnabled' => true, + 'showWeeeDetails' => false, + 'hasWeeeAmount' => false, + 'expectedValue' => false, + ], + ]; + + return $data; + } + + /** + * @param $priceInclTax + * @param $weeeTaxInclTax + * @param $weeeEnabled + * @param $includeWeee + * @param $expectedValue + * @dataProvider testGetDisplayPriceDataProvider + */ + public function testGetUnitDisplayPriceInclTax( + $priceInclTax, + $weeeTaxInclTax, + $weeeEnabled, + $includeWeee, + $expectedValue + ) { + $this->weeeHelper->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue($weeeEnabled)); + + $this->weeeHelper->expects($this->any()) + ->method('getWeeeTaxInclTax') + ->with($this->item) + ->will($this->returnValue($weeeTaxInclTax)); + + $this->item->expects($this->once()) + ->method('getPriceInclTax') + ->will($this->returnValue($priceInclTax)); + + $this->weeeHelper->expects($this->any()) + ->method('typeOfDisplay') + ->with([WeeeDisplayConfig::DISPLAY_INCL_DESCR, WeeeDisplayConfig::DISPLAY_INCL], 'sales') + ->will($this->returnValue($includeWeee)); + + $this->assertEquals($expectedValue, $this->renderer->getUnitDisplayPriceInclTax()); + + } + + /** + * @param $priceExclTax + * @param $weeeTaxExclTax + * @param $weeeEnabled + * @param $includeWeee + * @param $expectedValue + * @dataProvider testGetDisplayPriceDataProvider + */ + public function testGetUnitDisplayPriceExclTax( + $priceExclTax, + $weeeTaxExclTax, + $weeeEnabled, + $includeWeee, + $expectedValue + ) { + $this->weeeHelper->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue($weeeEnabled)); + + $this->item->expects($this->any()) + ->method('getWeeeTaxAppliedAmount') + ->will($this->returnValue($weeeTaxExclTax)); + + $this->item->expects($this->once()) + ->method('getCalculationPrice') + ->will($this->returnValue($priceExclTax)); + + $this->weeeHelper->expects($this->any()) + ->method('typeOfDisplay') + ->with([WeeeDisplayConfig::DISPLAY_INCL_DESCR, WeeeDisplayConfig::DISPLAY_INCL], 'sales') + ->will($this->returnValue($includeWeee)); + + $this->assertEquals($expectedValue, $this->renderer->getUnitDisplayPriceExclTax()); + + } + + /** + * @param $rowTotal + * @param $rowWeeeTaxExclTax + * @param $weeeEnabled + * @param $includeWeee + * @param $expectedValue + * @dataProvider testGetDisplayPriceDataProvider + */ + public function testGetRowDisplayPriceExclTax( + $rowTotal, + $rowWeeeTaxExclTax, + $weeeEnabled, + $includeWeee, + $expectedValue + ) { + $this->weeeHelper->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue($weeeEnabled)); + + $this->item->expects($this->any()) + ->method('getWeeeTaxAppliedRowAmount') + ->will($this->returnValue($rowWeeeTaxExclTax)); + + $this->item->expects($this->once()) + ->method('getRowTotal') + ->will($this->returnValue($rowTotal)); + + $this->weeeHelper->expects($this->any()) + ->method('typeOfDisplay') + ->with([WeeeDisplayConfig::DISPLAY_INCL_DESCR, WeeeDisplayConfig::DISPLAY_INCL], 'sales') + ->will($this->returnValue($includeWeee)); + + $this->assertEquals($expectedValue, $this->renderer->getRowDisplayPriceExclTax()); + + } + + /** + * @param $rowTotalInclTax + * @param $rowWeeeTaxInclTax + * @param $weeeEnabled + * @param $includeWeee + * @param $expectedValue + * @dataProvider testGetDisplayPriceDataProvider + */ + public function testGetRowDisplayPriceInclTax( + $rowTotalInclTax, + $rowWeeeTaxInclTax, + $weeeEnabled, + $includeWeee, + $expectedValue + ) { + $this->weeeHelper->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue($weeeEnabled)); + + $this->weeeHelper->expects($this->any()) + ->method('getRowWeeeTaxInclTax') + ->with($this->item) + ->will($this->returnValue($rowWeeeTaxInclTax)); + + $this->item->expects($this->once()) + ->method('getRowTotalInclTax') + ->will($this->returnValue($rowTotalInclTax)); + + $this->weeeHelper->expects($this->any()) + ->method('typeOfDisplay') + ->with([WeeeDisplayConfig::DISPLAY_INCL_DESCR, WeeeDisplayConfig::DISPLAY_INCL], 'sales') + ->will($this->returnValue($includeWeee)); + + $this->assertEquals($expectedValue, $this->renderer->getRowDisplayPriceInclTax()); + + } + + public function testGetDisplayPriceDataProvider() + { + $data = [ + 'weee_disabled_true' => [ + 'price' => 100, + 'weee' => 10, + 'weee_enabled' => false, + 'include_weee' => true, + 'expected_value' => 100, + ], + 'weee_disabled_false' => [ + 'price' => 100, + 'weee' => 10, + 'weee_enabled' => false, + 'include_weee' => false, + 'expected_value' => 100, + ], + 'weee_enabled_include_weee' =>[ + 'price' => 100, + 'weee' => 10, + 'weee_enabled' => true, + 'include_weee' => true, + 'expected_value' => 110, + ], + 'weee_enabled_not_include_weee' =>[ + 'price' => 100, + 'weee' => 10, + 'weee_enabled' => true, + 'include_weee' => false, + 'expected_value' => 100, + ], + ]; + return $data; + } + + /** + * @param $priceInclTax + * @param $weeeTaxInclTax + * @param $weeeEnabled + * @param $expectedValue + * @dataProvider testGetFinalDisplayPriceDataProvider + */ + public function testGetFinalUnitDisplayPriceInclTax( + $priceInclTax, + $weeeTaxInclTax, + $weeeEnabled, + $expectedValue + ) { + $this->weeeHelper->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue($weeeEnabled)); + + $this->weeeHelper->expects($this->any()) + ->method('getWeeeTaxInclTax') + ->with($this->item) + ->will($this->returnValue($weeeTaxInclTax)); + + $this->item->expects($this->once()) + ->method('getPriceInclTax') + ->will($this->returnValue($priceInclTax)); + + $this->assertEquals($expectedValue, $this->renderer->getFinalUnitDisplayPriceInclTax()); + + } + + /** + * @param $priceExclTax + * @param $weeeTaxExclTax + * @param $weeeEnabled + * @param $expectedValue + * @dataProvider testGetFinalDisplayPriceDataProvider + */ + public function testGetFinalUnitDisplayPriceExclTax( + $priceExclTax, + $weeeTaxExclTax, + $weeeEnabled, + $expectedValue + ) { + $this->weeeHelper->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue($weeeEnabled)); + + $this->item->expects($this->any()) + ->method('getWeeeTaxAppliedAmount') + ->will($this->returnValue($weeeTaxExclTax)); + + $this->item->expects($this->once()) + ->method('getCalculationPrice') + ->will($this->returnValue($priceExclTax)); + + $this->assertEquals($expectedValue, $this->renderer->getFinalUnitDisplayPriceExclTax()); + + } + + /** + * @param $rowTotal + * @param $rowWeeeTaxExclTax + * @param $weeeEnabled + * @param $expectedValue + * @dataProvider testGetFinalDisplayPriceDataProvider + */ + public function testGetFianlRowDisplayPriceExclTax( + $rowTotal, + $rowWeeeTaxExclTax, + $weeeEnabled, + $expectedValue + ) { + $this->weeeHelper->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue($weeeEnabled)); + + $this->item->expects($this->any()) + ->method('getWeeeTaxAppliedRowAmount') + ->will($this->returnValue($rowWeeeTaxExclTax)); + + $this->item->expects($this->once()) + ->method('getRowTotal') + ->will($this->returnValue($rowTotal)); + + $this->assertEquals($expectedValue, $this->renderer->getFinalRowDisplayPriceExclTax()); + + } + + /** + * @param $rowTotalInclTax + * @param $rowWeeeTaxInclTax + * @param $weeeEnabled + * @param $expectedValue + * @dataProvider testGetFinalDisplayPriceDataProvider + */ + public function testGetFinalRowDisplayPriceInclTax( + $rowTotalInclTax, + $rowWeeeTaxInclTax, + $weeeEnabled, + $expectedValue + ) { + $this->weeeHelper->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue($weeeEnabled)); + + $this->weeeHelper->expects($this->any()) + ->method('getRowWeeeTaxInclTax') + ->with($this->item) + ->will($this->returnValue($rowWeeeTaxInclTax)); + + $this->item->expects($this->once()) + ->method('getRowTotalInclTax') + ->will($this->returnValue($rowTotalInclTax)); + + $this->assertEquals($expectedValue, $this->renderer->getFinalRowDisplayPriceInclTax()); + + } + + public function testGetFinalDisplayPriceDataProvider() + { + $data = [ + 'weee_disabled_true' => [ + 'price' => 100, + 'weee' => 10, + 'weee_enabled' => false, + 'expected_value' => 100, + ], + 'weee_enabled_include_weee' =>[ + 'price' => 100, + 'weee' => 10, + 'weee_enabled' => true, + 'expected_value' => 110, + ], + ]; + return $data; + } + + public function testFormatPrice() + { + $price = 10; + $formattedPrice ="$10.00"; + $this->priceCurrency->expects($this->once()) + ->method('format') + ->with($price) + ->will($this->returnValue($formattedPrice)); + + $this->assertEquals($formattedPrice, $this->renderer->formatPrice($price)); + } +} diff --git a/lib/internal/Magento/Framework/AppInterface.php b/lib/internal/Magento/Framework/AppInterface.php index cf5e5daaa9d6941286f35e668ff8367c0ef36721..bdb85fda79d5586131215e3b59dd4ee8b88dc653 100644 --- a/lib/internal/Magento/Framework/AppInterface.php +++ b/lib/internal/Magento/Framework/AppInterface.php @@ -35,7 +35,7 @@ interface AppInterface /** * Magento version */ - const VERSION = '0.1.0-alpha90'; + const VERSION = '0.1.0-alpha91'; /** * Launch application diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 56b95e3a75371b38603e463edeaa6557b8fad63a..4e38d9c4816d4ec0d94a2a7c62b17f7bc4750981 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -2,7 +2,7 @@ "name": "magento/framework", "description": "N/A", "type": "magento2-library", - "version": "0.1.0-alpha90", + "version": "0.1.0-alpha91", "require": { "php": "~5.4.11|~5.5.0", "ext-spl": "*",