File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -164,18 +164,21 @@ public function getAbandonedCartsRecovered()
164
164
->where (['isRecovered ' => 1 ])
165
165
->column ();
166
166
if ($ ids ) {
167
- $ orders = Order::find ($ ids )->sum ('totalPrice ' );
168
- return $ orders ;
167
+ $ orders = Order::find ()
168
+ ->where (['commerce_orders.id ' => $ ids ])
169
+ ->select ('SUM(totalPrice) as total ' )
170
+ ->column ();
171
+ return $ orders [0 ];
169
172
}
170
173
return false ;
171
174
}
172
175
173
176
public function getAbandondedCartsConversion ()
174
177
{
175
- $ recovered = $ this ->_createAbandonedCartsQuery ()->where ('clicked = 1 ' )->count ();
178
+ $ recovered = $ this ->_createAbandonedCartsQuery ()->where ('isRecovered = 1 ' )->count ();
176
179
$ total = $ this ->getAbandonedCartsTotal ();
177
180
if ($ total > 0 && $ recovered > 0 ) {
178
- $ percent = ($ recovered / 100 ) * $ total ;
181
+ $ percent = ($ recovered / $ total ) * 100 ;
179
182
return $ percent ;
180
183
}
181
184
return 0 ;
Original file line number Diff line number Diff line change 20
20
If a new cart is found it will be marked as scheduled and added to the queue.<br />
21
21
Items in the queue will be scheduled as per your settings.
22
22
</p >
23
- {% if carts | length %}<p ><em >Showing the last {{ carts | length }} out of {{ totalCarts }} | Ordered by last update </em ></p >{% endif %}
23
+ {% if carts | length %}<p ><em >Showing the last {{ carts | length }} out of {{ totalCarts }}</em ></p >{% endif %}
24
24
</div >
25
25
</div >
26
26
</div >
You can’t perform that action at this time.
0 commit comments