2018-11-25 13:43:30 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Webkul\API\Http\Controllers\Shop;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Presenter Class for cart and mini cart(if implemented)
|
|
|
|
|
*/
|
2018-11-25 15:21:21 +00:00
|
|
|
class Presenter {
|
2018-11-25 13:43:30 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* presenter method will handle the cart and collect all the necessary data to be displayed on the onepage cart
|
|
|
|
|
*/
|
2018-11-25 15:21:21 +00:00
|
|
|
public function onePagePresenter($cart) {
|
2018-11-25 13:43:30 +00:00
|
|
|
$cartSummary['grand_total'] = $cart->grand_total;
|
|
|
|
|
$cartSummary['tax_total'] = $cart->tax_total;
|
|
|
|
|
$cartSummary['total_items'] = $cart->items_count;
|
|
|
|
|
$cartSummary['total_items_qty'] = $cart->items_qty;
|
|
|
|
|
$cartSummary['total_items_qty'] = $cart->items_qty;
|
|
|
|
|
|
|
|
|
|
return $cartSummary;
|
|
|
|
|
}
|
|
|
|
|
}
|