diff --git a/packages/Sarga/API/Http/Controllers/Checkout.php b/packages/Sarga/API/Http/Controllers/Checkout.php index ce5126137..cf65cbb19 100644 --- a/packages/Sarga/API/Http/Controllers/Checkout.php +++ b/packages/Sarga/API/Http/Controllers/Checkout.php @@ -61,7 +61,7 @@ class Checkout extends CheckoutController if (Cart::hasError() || ! Cart::saveCustomerAddress($data) || ! $shippingMethod || ! Cart::saveShippingMethod($shippingMethod)) { - abort(400); + return response(['message'=>'error. wrong shipment method or address'],400); } Cart::collectTotals(); diff --git a/packages/Sarga/API/Http/Resources/Checkout/CartItemResource.php b/packages/Sarga/API/Http/Resources/Checkout/CartItemResource.php index 1c6bd6f67..d069e1b7b 100644 --- a/packages/Sarga/API/Http/Resources/Checkout/CartItemResource.php +++ b/packages/Sarga/API/Http/Resources/Checkout/CartItemResource.php @@ -22,25 +22,17 @@ class CartItemResource extends JsonResource 'name' => $this->name, 'base_total_weight' => $this->base_total_weight, 'price' => $this->price, - 'formatted_price' => core()->formatPrice($this->price, $this->cart->cart_currency_code), - 'base_price' => $this->base_price, - 'formatted_base_price' => core()->formatBasePrice($this->base_price), + 'formatted_price' => core()->formatPrice($this->base_price, $this->cart->cart_currency_code), 'custom_price' => $this->custom_price, 'formatted_custom_price' => core()->formatPrice($this->custom_price, $this->cart->cart_currency_code), 'total' => $this->total, - 'formatted_total' => core()->formatPrice($this->total, $this->cart->cart_currency_code), - 'base_total' => $this->base_total, - 'formatted_base_total' => core()->formatBasePrice($this->base_total), + 'formatted_total' => core()->formatPrice($this->base_total, $this->cart->cart_currency_code), 'tax_percent' => $this->tax_percent, 'tax_amount' => $this->tax_amount, - 'formatted_tax_amount' => core()->formatPrice($this->tax_amount, $this->cart->cart_currency_code), - 'base_tax_amount' => $this->base_tax_amount, - 'formatted_base_tax_amount' => core()->formatBasePrice($this->base_tax_amount), + 'formatted_tax_amount' => core()->formatPrice($this->base_tax_amount, $this->cart->cart_currency_code), 'discount_percent' => $this->discount_percent, 'discount_amount' => $this->discount_amount, - 'formatted_discount_amount' => core()->formatPrice($this->discount_amount, $this->cart->cart_currency_code), - 'base_discount_amount' => $this->base_discount_amount, - 'formatted_base_discount_amount'=> core()->formatBasePrice($this->base_discount_amount), + 'formatted_discount_amount' => core()->formatPrice($this->base_discount_amount, $this->cart->cart_currency_code), 'additional' => is_array($this->resource->additional) ? $this->resource->additional : json_decode($this->resource->additional, true), diff --git a/packages/Sarga/API/Http/Resources/Checkout/CartResource.php b/packages/Sarga/API/Http/Resources/Checkout/CartResource.php index ec04ccd75..20e999997 100644 --- a/packages/Sarga/API/Http/Resources/Checkout/CartResource.php +++ b/packages/Sarga/API/Http/Resources/Checkout/CartResource.php @@ -36,21 +36,13 @@ class CartResource extends JsonResource 'items_count' => $this->items_count, 'items_qty' => (int) $this->items_qty, 'grand_total' => (double) $this->grand_total, - 'formatted_grand_total' => core()->formatPrice($this->grand_total, $this->cart_currency_code), - 'base_grand_total' => (double) $this->base_grand_total, - 'formatted_base_grand_total' => core()->formatBasePrice($this->base_grand_total), + 'formatted_grand_total' => core()->formatPrice($this->base_grand_total), 'sub_total' => (double) $this->sub_total, - 'formatted_sub_total' => core()->formatPrice($this->sub_total, $this->cart_currency_code), - 'base_sub_total' => (double) $this->base_sub_total, - 'formatted_base_sub_total' => core()->formatBasePrice($this->base_sub_total), + 'formatted_sub_total' => core()->formatPrice($this->base_sub_total, $this->cart_currency_code), 'tax_total' => (double) $this->tax_total, - 'formatted_tax_total' => core()->formatPrice($this->tax_total, $this->cart_currency_code), - 'base_tax_total' => (double) $this->base_tax_total, - 'formatted_base_tax_total' => core()->formatBasePrice($this->base_tax_total), + 'formatted_tax_total' => core()->formatPrice($this->base_tax_total, $this->cart_currency_code), 'discount' => (double) $this->discount_amount, - 'formatted_discount' => core()->formatPrice($this->discount_amount, $this->cart_currency_code), - 'base_discount' => (double) $this->base_discount_amount, - 'formatted_base_discount' => core()->formatBasePrice($this->base_discount_amount), + 'formatted_discount' => core()->formatPrice($this->base_discount_amount, $this->cart_currency_code), 'checkout_method' => $this->checkout_method, 'vendors' => $this->groupByVendors($this->items), 'selected_shipping_rate' => new CartShippingRateResource($this->selected_shipping_rate), @@ -61,8 +53,7 @@ class CartResource extends JsonResource 'formatted_taxes' => json_encode($formatedTaxes, JSON_FORCE_OBJECT), 'base_taxes' => json_encode($baseTaxes, JSON_FORCE_OBJECT), 'formatted_base_taxes' => json_encode($formatedBaseTaxes, JSON_FORCE_OBJECT), - 'formatted_discounted_sub_total' => core()->formatPrice($this->sub_total - $this->discount_amount, $this->cart_currency_code), - 'formatted_base_discounted_sub_total'=> core()->formatPrice($this->base_sub_total - $this->base_discount_amount, $this->cart_currency_code), + 'formatted_discounted_sub_total' => core()->formatPrice($this->base_sub_total - $this->base_discount_amount, $this->cart_currency_code) ]; } diff --git a/packages/Sarga/Payment/Config/paymentmethods.php b/packages/Sarga/Payment/Config/paymentmethods.php index afa4b2059..a92b0ac39 100644 --- a/packages/Sarga/Payment/Config/paymentmethods.php +++ b/packages/Sarga/Payment/Config/paymentmethods.php @@ -18,7 +18,7 @@ return [ ], 'terminal100' => [ 'code' => 'terminal100', - 'title' => "I\\'ll pay by card on terminal", + 'title' => "I\\'ll pay by card on terminal with deposit 100%", 'description' => '50% deposit is taken before delivery', 'class' => 'Sarga\Payment\Methods\Terminal100', 'active' => true, @@ -26,7 +26,7 @@ return [ ], 'terminal50' => [ 'code' => 'terminal50', - 'title' => "I\\'ll pay by card on terminal", + 'title' => "I\\'ll pay by card on terminal with deposit 50%", 'description' => '50% deposit is taken before delivery', 'class' => 'Sarga\Payment\Methods\Terminal50', 'active' => true,