diff --git a/app/code/Magento/Catalog/Plugin/Block/Topmenu.php b/app/code/Magento/Catalog/Plugin/Block/Topmenu.php index 35ce327c74ead..44f9193ab4012 100644 --- a/app/code/Magento/Catalog/Plugin/Block/Topmenu.php +++ b/app/code/Magento/Catalog/Plugin/Block/Topmenu.php @@ -14,11 +14,6 @@ */ class Topmenu { - /** - * Cache tag for menu block - */ - private $cacheTag = "top_menu"; - /** * Catalog category * @@ -124,7 +119,6 @@ public function beforeGetIdentities(\Magento\Theme\Block\Html\Topmenu $subject) $subject->addIdentity(Category::CACHE_TAG); $rootId = $this->storeManager->getStore()->getRootCategoryId(); $storeId = $this->storeManager->getStore()->getId(); - $currentCategory = $this->getCurrentCategory(); /** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $collection */ $collection = $this->getCategoryTree($storeId, $rootId); $mapping = [$rootId => $subject->getMenu()]; // use nodes stack to avoid recursion @@ -134,9 +128,6 @@ public function beforeGetIdentities(\Magento\Theme\Block\Html\Topmenu $subject) } $subject->addIdentity(Category::CACHE_TAG . '_' . $category->getId()); } - if ($currentCategory) { - $subject->addIdentity($this->cacheTag . '_' . Category::CACHE_TAG . '_' . $currentCategory->getId()); - } } /** diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml index ce7d962f3ec77..fba28b3feaff1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml @@ -13,8 +13,6 @@ - - diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CheckCurrentCategoryIsHighlightedAndProductsDisplayed.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CheckCurrentCategoryIsHighlightedAndProductsDisplayed.xml deleted file mode 100644 index 7d09cb419f312..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CheckCurrentCategoryIsHighlightedAndProductsDisplayed.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - <description value="Сheck that current category is highlighted and all products displayed for it"/> - <severity value="MAJOR"/> - <testCaseId value="MAGETWO-99028"/> - <useCaseId value="MAGETWO-98748"/> - <group value="Catalog"/> - </annotations> - <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <createData entity="SimpleSubCategory" stepKey="category1"/> - <createData entity="SimpleSubCategory" stepKey="category2"/> - <createData entity="SimpleSubCategory" stepKey="category3"/> - <createData entity="SimpleSubCategory" stepKey="category4"/> - <createData entity="SimpleProduct" stepKey="product1"> - <requiredEntity createDataKey="category1"/> - </createData> - <createData entity="SimpleProduct" stepKey="product2"> - <requiredEntity createDataKey="category1"/> - </createData> - </before> - <after> - <deleteData createDataKey="product1" stepKey="deleteProduct1"/> - <deleteData createDataKey="product2" stepKey="deleteProduct2"/> - <deleteData createDataKey="category1" stepKey="deleteCategory1"/> - <deleteData createDataKey="category2" stepKey="deleteCategory2"/> - <deleteData createDataKey="category3" stepKey="deleteCategory3"/> - <deleteData createDataKey="category4" stepKey="deleteCategory4"/> - <actionGroup ref="logout" stepKey="logout"/> - </after> - <!--Open Storefront home page--> - <comment userInput="Open Storefront home page" stepKey="openStorefrontHomePage"/> - <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontHomePage"/> - <waitForPageLoad stepKey="waitForSimpleProductPage"/> - <!--Click on first category--> - <comment userInput="Click on first category" stepKey="openFirstCategoryPage"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$category1.name$$)}}" stepKey="clickCategory1Name"/> - <waitForPageLoad stepKey="waitForCategory1Page"/> - <!--Check if current category is highlighted and the others are not--> - <comment userInput="Check if current category is highlighted and the others are not" stepKey="checkCateg1NameIsHighlighted"/> - <grabAttributeFrom selector="{{AdminCategorySidebarTreeSection.categoryHighlighted($$category1.name$$)}}" userInput="class" stepKey="grabCategory1Class"/> - <assertContains expectedType="string" expected="active" actual="$grabCategory1Class" stepKey="assertCategory1IsHighlighted"/> - <executeJS function="return document.querySelectorAll('{{AdminCategorySidebarTreeSection.categoryNotHighlighted}}').length" stepKey="highlightedAmount"/> - <assertEquals expectedType="int" expected="1" actual="$highlightedAmount" stepKey="assertRestCategories1IsNotHighlighted"/> - <!--See products in the category page--> - <comment userInput="See products in the category page" stepKey="seeProductsInCategoryPage"/> - <seeElement selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo($product1.name$)}}" stepKey="seeProduct1InCategoryPage"/> - <seeElement selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo($product2.name$)}}" stepKey="seeProduct2InCategoryPage"/> - <!--Click on second category--> - <comment userInput="Click on second category" stepKey="openSecondCategoryPage"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$category2.name$$)}}" stepKey="clickCategory2Name"/> - <waitForPageLoad stepKey="waitForCategory2Page"/> - <!--Check if current category is highlighted and the others are not--> - <comment userInput="Check if current category is highlighted and the others are not" stepKey="checkCateg2NameIsHighlighted"/> - <grabAttributeFrom selector="{{AdminCategorySidebarTreeSection.categoryHighlighted($$category2.name$$)}}" userInput="class" stepKey="grabCategory2Class"/> - <assertContains expectedType="string" expected="active" actual="$grabCategory2Class" stepKey="assertCategory2IsHighlighted"/> - <executeJS function="return document.querySelectorAll('{{AdminCategorySidebarTreeSection.categoryNotHighlighted}}').length" stepKey="highlightedAmount2"/> - <assertEquals expectedType="int" expected="1" actual="$highlightedAmount2" stepKey="assertRestCategories1IsNotHighlighted2"/> - </test> -</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml deleted file mode 100644 index f52bdb1851b5e..0000000000000 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml +++ /dev/null @@ -1,128 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="NoOptionAvailableToConfigureDisabledProductTest"> - <annotations> - <stories value="Disabled Product"/> - <title value="Disabled variation of configurable product can't be added to shopping cart via admin"/> - <description value="Disabled variation of configurable product can't be added to shopping cart via admin"/> - <severity value="AVERAGE"/> - <testCaseId value="MC-17373"/> - <useCaseId value="MAGETWO-72172"/> - <group value="ConfigurableProduct"/> - </annotations> - <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> - <!--Create category--> - <comment userInput="Create category" stepKey="commentCreateCategory"/> - <createData entity="SimpleSubCategory" stepKey="createCategory"/> - <!-- Create the configurable product based on the data in the data folder --> - <comment userInput="Create the configurable product based on the data in the data folder" stepKey="createConfigurableProduct"/> - <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> - <requiredEntity createDataKey="createCategory"/> - </createData> - <!-- Create the configurable product with two options based on the default attribute set --> - <comment userInput="Create the configurable product with two options based on the default attribute set" stepKey="configurableProductWithTwoOptions"/> - <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> - <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </createData> - <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </createData> - <createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </createData> - <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </createData> - <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </getData> - <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </getData> - <getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </getData> - <!-- Create the 2 children that will be a part of the configurable product --> - <comment userInput="Create the 2 children that will be a part of the configurable product" stepKey="createTwoChildrenProducts"/> - <createData entity="ApiSimpleProductWithPrice50" stepKey="createConfigChildProduct1"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption1"/> - </createData> - <createData entity="ApiSimpleProductWithPrice60" stepKey="createConfigChildProduct2"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption2"/> - </createData> - <createData entity="ApiSimpleProductWithPrice70" stepKey="createConfigChildProduct3"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption3"/> - </createData> - <!-- Assign two products to the configurable product --> - <comment userInput="Assign two products to the configurable product" stepKey="assignToConfigurableProduct"/> - <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> - <requiredEntity createDataKey="createConfigProduct"/> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption1"/> - <requiredEntity createDataKey="getConfigAttributeOption2"/> - <requiredEntity createDataKey="getConfigAttributeOption3"/> - </createData> - <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> - <requiredEntity createDataKey="createConfigProduct"/> - <requiredEntity createDataKey="createConfigChildProduct1"/> - </createData> - <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> - <requiredEntity createDataKey="createConfigProduct"/> - <requiredEntity createDataKey="createConfigChildProduct2"/> - </createData> - <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3"> - <requiredEntity createDataKey="createConfigProduct"/> - <requiredEntity createDataKey="createConfigChildProduct3"/> - </createData> - <!--Create Customer--> - <comment userInput="Create customer" stepKey="commentCreateCustomer"/> - <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> - </before> - <after> - <!--Delete created data--> - <comment userInput="Delete created data" stepKey="deleteData"/> - <deleteData createDataKey="createCategory" stepKey="deleteCategory2"/> - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> - <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> - <deleteData createDataKey="createConfigChildProduct3" stepKey="deleteConfigChildProduct3"/> - <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> - <deleteData createDataKey="createCustomer" stepKey="deleteCreatedCustomer"/> - <actionGroup ref="logout" stepKey="logout"/> - </after> - <!--Disable child product --> - <comment userInput="Disable child product" stepKey="disableChildProduct"/> - <amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct1.id$$)}}" stepKey="goToEditPage"/> - <waitForPageLoad stepKey="waitForChildProductPageLoad"/> - <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="disableProduct"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> - <!--Go to created customer page--> - <comment userInput="Go to created customer page" stepKey="goToCreatedCustomerPage"/> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickToAddProduct"/> - <waitForPageLoad stepKey="waitForProductsOpened"/> - <!--Find created configurable product and click on "Configure" link--> - <comment userInput="Find created configurable product and click on Configure link" stepKey="goToConfigurableLink"/> - <click selector="{{AdminOrderFormConfigureProductSection.configure($$createConfigProduct.id$$)}}" stepKey="clickOnConfigure"/> - <!--Click on attribute drop-down and check no option 1 is available--> - <comment userInput="Click on attribute drop-down and check no option 1 is available" stepKey="commentNoOptionIsAvailable"/> - <waitForElement selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="waitForShippingSectionLoaded"/> - <click selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="clickToSelectOption"/> - <dontSee userInput="$$createConfigProductAttributeOption1.option[store_labels][1][label]$$" stepKey="dontSeeOption1"/> - </test> -</tests> diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php index 6058523ac584c..341ee16ae910b 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php @@ -55,6 +55,7 @@ public function __construct( ForwardFactory $resultForwardFactory ) { parent::__construct($context); + $productHelper->setSkipSaleableCheck(true); $this->escaper = $escaper; $this->resultPageFactory = $resultPageFactory; $this->resultForwardFactory = $resultForwardFactory; diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml index 4f065ec7eb748..8c093891ac46d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml @@ -9,7 +9,6 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminOrderFormConfigureProductSection"> - <element name="configure" type="button" selector="//a[@product_id='{{productId}}']" parameterized="true"/> <element name="optionSelect" type="select" selector="//div[contains(@class,'product-options')]//select[//label[text() = '{{option}}']]" parameterized="true"/> <element name="optionSelectNew" type="select" selector="//label[text()='{{option1}}']/following-sibling::div/select" parameterized="true"/> <element name="quantity" type="input" selector="#product_composite_configure_input_qty"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml index 5613334c464bb..d087b291de87c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml @@ -77,12 +77,6 @@ <field key="qty">2</field> </createData> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - - <!--Go to bundle product page and save it to force "in stock" status--> - <actionGroup ref="goToProductPageViaID" stepKey="goToBundleProductPage"> - <argument name="productId" value="$product.id$"/> - </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveBundleProduct"/> </before> <!--Create new customer order--> diff --git a/app/code/Magento/Theme/Block/Html/Topmenu.php b/app/code/Magento/Theme/Block/Html/Topmenu.php index fe5fe686e4854..fd8aaa7708cf3 100644 --- a/app/code/Magento/Theme/Block/Html/Topmenu.php +++ b/app/code/Magento/Theme/Block/Html/Topmenu.php @@ -74,16 +74,6 @@ protected function getCacheLifetime() return parent::getCacheLifetime() ?: 3600; } - /** - * Get cache key informative items - * - * @return array - */ - public function getCacheKeyInfo() - { - return array_merge(parent::getCacheKeyInfo(), $this->getIdentities()); - } - /** * Get top menu html *