File tree Expand file tree Collapse file tree 5 files changed +11
-18
lines changed
Downloadable/view/adminhtml/web
UrlRewrite/view/adminhtml/templates Expand file tree Collapse file tree 5 files changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -69,12 +69,12 @@ public function __construct(
69
69
* Assign stock status information to product
70
70
*
71
71
* @param Product $product
72
- * @param int $stockStatus
72
+ * @param int $status
73
73
* @return void
74
74
*/
75
- public function assignStatusToProduct (Product $ product , $ stockStatus = null )
75
+ public function assignStatusToProduct (Product $ product , $ status = null )
76
76
{
77
- if ($ stockStatus === null ) {
77
+ if ($ status === null ) {
78
78
$ websiteId = $ product ->getStore ()->getWebsiteId ();
79
79
$ stockStatus = $ this ->stockRegistryProvider ->getStockStatus ($ product ->getId (), $ websiteId );
80
80
$ status = $ stockStatus ->getStockStatus ();
Original file line number Diff line number Diff line change @@ -34,10 +34,7 @@ public function execute(EventObserver $observer)
34
34
{
35
35
$ product = $ observer ->getEvent ()->getProduct ();
36
36
if ($ product instanceof \Magento \Catalog \Model \Product) {
37
- $ this ->stockHelper ->assignStatusToProduct (
38
- $ product ,
39
- $ product ->getStockStatus ()
40
- );
37
+ $ this ->stockHelper ->assignStatusToProduct ($ product );
41
38
}
42
39
}
43
40
}
Original file line number Diff line number Diff line change @@ -57,24 +57,17 @@ protected function setUp()
57
57
58
58
public function testAddInventoryData ()
59
59
{
60
- $ stockStatus = true ;
61
-
62
60
$ product = $ this ->getMockBuilder ('Magento\Catalog\Model\Product ' )
63
61
->disableOriginalConstructor ()
64
- ->setMethods (['getStockStatus ' ])
65
62
->getMock ();
66
63
67
- $ product ->expects ($ this ->once ())
68
- ->method ('getStockStatus ' )
69
- ->will ($ this ->returnValue ($ stockStatus ));
70
-
71
64
$ this ->event ->expects ($ this ->once ())
72
65
->method ('getProduct ' )
73
66
->will ($ this ->returnValue ($ product ));
74
67
75
68
$ this ->stockHelper ->expects ($ this ->once ())
76
69
->method ('assignStatusToProduct ' )
77
- ->with ($ product, $ stockStatus )
70
+ ->with ($ product )
78
71
->will ($ this ->returnSelf ());
79
72
80
73
$ this ->observer ->execute ($ this ->eventObserver );
Original file line number Diff line number Diff line change @@ -65,7 +65,10 @@ define([
65
65
if ( productType . type . current === 'downloadable' ) {
66
66
weight . change ( false ) ;
67
67
weight . $weightSwitcher ( ) . one ( 'change' , function ( ) {
68
- $ ( document ) . trigger ( 'setTypeProduct' , null ) ;
68
+ $ ( document ) . trigger (
69
+ 'setTypeProduct' ,
70
+ productType . type . init === 'downloadable' ? 'virtual' : productType . type . init
71
+ ) ;
69
72
} ) ;
70
73
this . show ( ) ;
71
74
} else {
Original file line number Diff line number Diff line change 13
13
<div class="content" style="clear: both;">
14
14
<input type="hidden" name="categories" id="product_categories" value="" />
15
15
<?php if ($ block ->getRoot ()): ?>
16
- <div data-mage-init=' <?php
16
+ <div data-mage-init=" <?php
17
17
echo $ block ->escapeHtml ($ this ->helper ('Magento\Framework\Json\Helper\Data ' )->jsonEncode ([
18
18
'categoryTree ' => [
19
19
'data ' => $ block ->getTreeArray (null ),
20
20
'url ' => $ block ->getLoadTreeUrl (),
21
21
],
22
22
]));
23
- ?> ' class="jstree-default"></div>
23
+ ?> " class="jstree-default"></div>
24
24
<?php endif ; ?>
25
25
</div>
26
26
</fieldset>
You can’t perform that action at this time.
0 commit comments