Customers Add+Edit, API WP

This commit is contained in:
Kevin Adametz 2020-06-12 14:46:51 +02:00
parent dc63fa9fb2
commit 75a0f9a38a
120 changed files with 11894 additions and 6134 deletions

View file

@ -6,10 +6,9 @@ namespace App\Http\Controllers\Web;
use App\Http\Controllers\Controller;
use App\Models\Product;
use App\Models\ShoppingInstance;
use Validator;
use App\Services\Util;
use Yard;
use Input;
use Request;
class CardController extends Controller
{
@ -53,7 +52,7 @@ class CardController extends Controller
if($product->images->count()){
$image = $product->images->first()->slug;
}
$quantity = Input::get('quantity') ? Input::get('quantity') : 1;
$quantity = Request::get('quantity') ? Request::get('quantity') : 1;
Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]);
Yard::instance('shopping')->reCalculateShippingPrice();
@ -66,8 +65,8 @@ class CardController extends Controller
public function showCard(){
if(Input::get('selected_country')){
Yard::instance('shopping')->setShippingCountryWithPrice(Input::get('selected_country'));
if(Request::get('selected_country')){
Yard::instance('shopping')->setShippingCountryWithPrice(Request::get('selected_country'));
}else{
Yard::instance('shopping')->reCalculateShippingPrice();
}
@ -79,7 +78,7 @@ class CardController extends Controller
public function updateCard(){
$data = Input::all();
$data = Request::all();
if(isset($data['quantity'])){
foreach ($data['quantity'] as $rowId => $qty){
Yard::instance('shopping')->update($rowId, $qty);