File tree 2 files changed +36
-0
lines changed
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Ordergroove \Subscription \Model \Carrier ;
4
+
5
+ class Flatrate{
6
+
7
+ protected $ _checkoutSession ;
8
+ protected $ _scopeConfig ;
9
+ protected $ _customerSession ;
10
+
11
+ public function __construct (
12
+ \Magento \Checkout \Model \Session $ checkoutSession ,
13
+ \Magento \Framework \App \Config \ScopeConfigInterface $ scopeConfig ,
14
+ \Magento \Store \Model \StoreManagerInterface $ storeManager ,
15
+ \Magento \Customer \Model \Session $ customerSession
16
+ ) {
17
+ $ this ->_storeManager = $ storeManager ;
18
+ $ this ->_checkoutSession = $ checkoutSession ;
19
+ $ this ->_scopeConfig = $ scopeConfig ;
20
+ $ this ->_customerSession = $ customerSession ;
21
+ }
22
+
23
+ public function afterCollectRates (\Magento \OfflineShipping \Model \Carrier \Flatrate $ Flatrate , $ result )
24
+ {
25
+ $ url = $ this ->_storeManager ->getStore ()->getCurrentUrl (false );
26
+ $ path = parse_url ($ url )['path ' ];
27
+ if ($ path == '/ordergroove/subscription/placeorder ' ) {
28
+ return $ result ;
29
+ }
30
+ return false ;
31
+ }
32
+
33
+ }
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" ?>
2
2
<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
3
xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
4
+ <type name =" Magento\OfflineShipping\Model\Carrier\Flatrate" >
5
+ <plugin name =" ordergroove_disable_flatrate_on_checkout" type =" Ordergroove\Subscription\Model\Carrier\DisableFlatratePlugin" sortOrder =" 1" />
6
+ </type >
4
7
<type name =" Magento\Config\Model\Config\TypePool" >
5
8
<arguments >
6
9
<argument name =" sensitive" xsi : type =" array" >
You can’t perform that action at this time.
0 commit comments