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 13
13
<element name =" selectableProductOptions" type =" select" selector =" #attribute{{var1}} option:not([disabled])" parameterized =" true" />
14
14
<element name =" productAttributeTitle1" type =" text" selector =" #product-options-wrapper div[tabindex='0'] label" />
15
15
<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']" />
16
17
<element name =" productAttributeOptions1" type =" select" selector =" #product-options-wrapper div[tabindex='0'] option" />
17
18
<element name =" productAttributeOptionsSelectButton" type =" select" selector =" #product-options-wrapper .super-attribute-select" />
18
19
<element name =" productAttributeOptionsError" type =" text" selector =" //div[@class='mage-error']" />
Original file line number Diff line number Diff line change 48
48
49
49
<!-- Add tier price in one product -->
50
50
<createData entity =" tierProductPrice" stepKey =" addTierPrice" >
51
- <requiredEntity createDataKey =" createFirstSimpleProduct" />
51
+ <requiredEntity createDataKey =" createFirstSimpleProduct" />
52
52
</createData >
53
53
<actionGroup ref =" AdminLoginActionGroup" stepKey =" loginAsAdmin" />
54
54
</before >
109
109
<expectedResult type =" string" >Buy {{tierProductPrice.quantity}} for ${{tierProductPrice.price}} each and save 27%</expectedResult >
110
110
<actualResult type =" variable" >tierPriceText</actualResult >
111
111
</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" />
112
115
</test >
113
116
</tests >
Original file line number Diff line number Diff line change @@ -740,21 +740,19 @@ define([
740
740
* @private
741
741
*/
742
742
_displayTierPriceBlock : function ( optionId ) {
743
- var options , tierPriceHtml ;
743
+ var tierPrices = typeof optionId != 'undefined' && this . options . spConfig . optionPrices [ optionId ] . tierPrices ;
744
744
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 ) {
749
746
750
747
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 ( ) ;
758
756
}
759
757
} else {
760
758
$ ( this . options . tierPriceBlockSelector ) . hide ( ) ;
You can’t perform that action at this time.
0 commit comments