Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order Invoice create page doesn't show order items properly for bundle product Fixed Issue #27350 #27602

Merged
merged 5 commits into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?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="StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest">
<annotations>
<features value="Bundle"/>
<stories value="Bundle product details page"/>
<title value="Customer should be able to see all the bundle items in invoice view"/>
<description value="Customer should be able to see all the bundle items in invoice view"/>
<severity value="MAJOR"/>
<testCaseId value="MC-37515"/>
<group value="Bundle"/>
</annotations>
<before>
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
<createData entity="SimpleProduct2" stepKey="firstSimpleProduct"/>
<createData entity="SimpleProduct2" stepKey="secondSimpleProduct"/>
<createData entity="CustomerEntityOne" stepKey="createCustomer"/>
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
</before>
<after>
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
<deleteData createDataKey="firstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
<deleteData createDataKey="secondSimpleProduct" stepKey="deleteSecondSimpleProduct"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<!-- Create new bundle product -->
<actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createBundleProduct">
<argument name="productType" value="bundle"/>
</actionGroup>

<!-- Fill all main fields -->
<actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainProductFields"/>

<!-- Add first bundle option to the product -->
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addFirstBundleOption">
<argument name="x" value="0"/>
<argument name="n" value="1"/>
<argument name="prodOneSku" value="$firstSimpleProduct.sku$"/>
<argument name="prodTwoSku" value="$secondSimpleProduct.sku$$"/>
<argument name="optionTitle" value="{{CheckboxOption.title}}"/>
<argument name="inputType" value="{{CheckboxOption.type}}"/>
</actionGroup>

<!-- Save product form -->
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveWithThreeOptions"/>

<!--Login customer on storefront-->
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer">
<argument name="Customer" value="$$createCustomer$$" />
</actionGroup>

<!--Open Product Page-->
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
<argument name="productUrl" value="{{BundleProduct.name}}"/>
</actionGroup>

<!-- Add bundle to cart -->
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickAddToCart">
<argument name="productUrl" value="{{BundleProduct.name}}"/>
</actionGroup>
<checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '1')}}" stepKey="selectOption2Product1"/>
<checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '2')}}" stepKey="selectOption2Product2"/>
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart">
<argument name="quantity" value="1"/>
</actionGroup>

<!--Navigate to checkout-->
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/>
<!-- Click next button to open payment section -->
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
<!-- Click place order -->
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>

<!-- Order review page has address that was created during checkout -->
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById">
<argument name="orderId" value="{$grabOrderNumber}"/>
</actionGroup>

<!-- Open create invoice page -->
<actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/>

<!-- Assert item options display -->
<see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $firstSimpleProduct.sku$" stepKey="seeFirstProductInList"/>
<see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $secondSimpleProduct.sku$" stepKey="seeSecondProductInList"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<?php $items = $block->getChildren($_item); ?>
<?php $_count = count($items) ?>
<?php $_index = 0 ?>
<?php $canEditItemQty = true ?>
<?php
/** @var \Magento\Catalog\Helper\Data $catalogHelper */
$catalogHelper = $block->getData('catalogHelper');
Expand All @@ -37,7 +38,7 @@ $catalogHelper = $block->getData('catalogHelper');
<?php if ($_item->getOrderItem()->getParentItem()): ?>
<?php
if ($shipTogether) {
continue;
$canEditItemQty = false;
}
?>
<?php $attributes = $block->getSelectionAttributes($_item) ?>
Expand Down Expand Up @@ -130,7 +131,7 @@ $catalogHelper = $block->getData('catalogHelper');
</td>
<td class="col-qty-invoice">
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
<?php if ($block->canEditQty()): ?>
<?php if ($block->canEditQty() && $canEditItemQty): ?>
<input type="text"
class="input-text admin__control-text qty-input"
name="invoice[items][<?= $block->escapeHtmlAttr($_item->getOrderItemId()) ?>]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
<element name="discountAmountColumn" type="text" selector=".order-invoice-tables .col-discount .price"/>
<element name="totalColumn" type="text" selector=".order-invoice-tables .col-total .price"/>
<element name="updateQty" type="button" selector=".order-invoice-tables tfoot button[data-ui-id='order-items-update-button']"/>
<element name="bundleItem" type="text" selector="#invoice_item_container .option-value"/>
</section>
</sections>