File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed
app/code/Magento/ConfigurableProduct Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 1313 <element name =" selectableProductOptions" type =" select" selector =" #attribute{{var1}} option:not([disabled])" parameterized =" true" />
1414 <element name =" productAttributeTitle1" type =" text" selector =" #product-options-wrapper div[tabindex='0'] label" />
1515 <element name =" productPrice" type =" text" selector =" div.price-box.price-final_price" />
16+ <element name =" tierPriceBlock" type =" block" selector =" div[data-role='tier-price-block']" />
1617 <element name =" productAttributeOptions1" type =" select" selector =" #product-options-wrapper div[tabindex='0'] option" />
1718 <element name =" productAttributeOptionsSelectButton" type =" select" selector =" #product-options-wrapper .super-attribute-select" />
1819 <element name =" productAttributeOptionsError" type =" text" selector =" //div[@class='mage-error']" />
Original file line number Diff line number Diff line change 4848
4949 <!-- Add tier price in one product -->
5050 <createData entity =" tierProductPrice" stepKey =" addTierPrice" >
51- <requiredEntity createDataKey =" createFirstSimpleProduct" />
51+ <requiredEntity createDataKey =" createFirstSimpleProduct" />
5252 </createData >
5353 <actionGroup ref =" AdminLoginActionGroup" stepKey =" loginAsAdmin" />
5454 </before >
109109 <expectedResult type =" string" >Buy {{tierProductPrice.quantity}} for ${{tierProductPrice.price}} each and save 27%</expectedResult >
110110 <actualResult type =" variable" >tierPriceText</actualResult >
111111 </assertEquals >
112+ <seeElement selector =" {{StorefrontProductInfoMainSection.tierPriceBlock}}" stepKey =" seeTierPriceBlock" />
113+ <selectOption userInput =" $$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$" selector =" {{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey =" selectOption2" />
114+ <dontSeeElement selector =" {{StorefrontProductInfoMainSection.tierPriceBlock}}" stepKey =" dontSeeTierPriceBlock" />
112115 </test >
113116</tests >
Original file line number Diff line number Diff line change @@ -740,21 +740,19 @@ define([
740740 * @private
741741 */
742742 _displayTierPriceBlock : function ( optionId ) {
743- var options , tierPriceHtml ;
743+ var tierPrices = typeof optionId != 'undefined' && this . options . spConfig . optionPrices [ optionId ] . tierPrices ;
744744
745- if ( typeof optionId != 'undefined' &&
746- this . options . spConfig . optionPrices [ optionId ] . tierPrices != [ ] // eslint-disable-line eqeqeq
747- ) {
748- options = this . options . spConfig . optionPrices [ optionId ] ;
745+ if ( _ . isArray ( tierPrices ) && tierPrices . length > 0 ) {
749746
750747 if ( this . options . tierPriceTemplate ) {
751- tierPriceHtml = mageTemplate ( this . options . tierPriceTemplate , {
752- 'tierPrices' : options . tierPrices ,
753- '$t' : $t ,
754- 'currencyFormat' : this . options . spConfig . currencyFormat ,
755- 'priceUtils' : priceUtils
756- } ) ;
757- $ ( this . options . tierPriceBlockSelector ) . html ( tierPriceHtml ) . show ( ) ;
748+ $ ( this . options . tierPriceBlockSelector ) . html (
749+ mageTemplate ( this . options . tierPriceTemplate , {
750+ 'tierPrices' : tierPrices ,
751+ '$t' : $t ,
752+ 'currencyFormat' : this . options . spConfig . currencyFormat ,
753+ 'priceUtils' : priceUtils
754+ } )
755+ ) . show ( ) ;
758756 }
759757 } else {
760758 $ ( this . options . tierPriceBlockSelector ) . hide ( ) ;
You can’t perform that action at this time.
0 commit comments