commit
4d0bc20820
|
|
@ -4,14 +4,11 @@ namespace Webkul\Cart;
|
|||
|
||||
use Carbon\Carbon;
|
||||
|
||||
//Cart repositories
|
||||
use Webkul\Cart\Repositories\CartRepository;
|
||||
use Webkul\Cart\Repositories\CartItemRepository;
|
||||
|
||||
//Customer repositories
|
||||
use Webkul\Customer\Repositories\CustomerRepository;
|
||||
|
||||
//Product Repository
|
||||
use Webkul\Product\Repositories\ProductRepository;
|
||||
|
||||
use Cookie;
|
||||
|
|
@ -24,21 +21,20 @@ use Cookie;
|
|||
* @author Prashant Singh <prashant.singh852@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class Cart {
|
||||
|
||||
protected $cart;
|
||||
protected $cart; //cart repository instance
|
||||
|
||||
protected $cartItem;
|
||||
protected $cartItem; //cart_item repository instance
|
||||
|
||||
protected $customer;
|
||||
protected $customer; //customer repository instance
|
||||
|
||||
//Cookie expiry limit in minutes
|
||||
protected $minutes;
|
||||
protected $product; //product repository instance
|
||||
|
||||
protected $product;
|
||||
|
||||
public function __construct(CartRepository $cart, CartItemRepository $cartItem, CustomerRepository $customer, $minutes = 150, ProductRepository $product) {
|
||||
public function __construct(CartRepository $cart,
|
||||
CartItemRepository $cartItem,
|
||||
CustomerRepository $customer,
|
||||
ProductRepository $product) {
|
||||
|
||||
$this->customer = $customer;
|
||||
|
||||
|
|
@ -46,34 +42,41 @@ class Cart {
|
|||
|
||||
$this->cartItem = $cartItem;
|
||||
|
||||
$this->minutes = $minutes;
|
||||
|
||||
$this->product = $product;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create New Cart
|
||||
* Cart, Cookie &
|
||||
* Session.
|
||||
* Create new cart
|
||||
* instance with the
|
||||
* current item added.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
* @param Integer $id
|
||||
* @param Mixed $data
|
||||
*
|
||||
* @return Mixed
|
||||
*/
|
||||
public function createNewCart($id, $data) {
|
||||
|
||||
$cartData['channel_id'] = core()->getCurrentChannel()->id;
|
||||
|
||||
if(auth()->guard('customer')->check()) {
|
||||
$data['customer_id'] = auth()->guard('customer')->user()->id;
|
||||
$cartData['customer_id'] = auth()->guard('customer')->user()->id;
|
||||
|
||||
$cartData['customer_full_name'] = auth()->guard('customer')->first_name .' '. auth()->guard('customer')->last_name;
|
||||
$cartData['customer_full_name'] = auth()->guard('customer')->user()->first_name .' '. auth()->guard('customer')->user()->last_name;
|
||||
}
|
||||
|
||||
if($cart = $this->cart->create($cartData)) {
|
||||
|
||||
$data['cart_id'] = $cart->id;
|
||||
$data['product_id'] = $id;
|
||||
|
||||
if($result = $cart->items()->create($data)) {
|
||||
if ($data['is_configurable'] == "true") {
|
||||
$temp = $data['super_attribute'];
|
||||
|
||||
unset($data['super_attribute']);
|
||||
|
||||
$data['additional'] = json_encode($temp);
|
||||
}
|
||||
|
||||
if($result = $this->cartItem->create($data)) {
|
||||
session()->put('cart', $cart);
|
||||
|
||||
session()->flash('success', 'Item Added To Cart Successfully');
|
||||
|
|
@ -86,21 +89,28 @@ class Cart {
|
|||
return redirect()->back();
|
||||
}
|
||||
|
||||
/*
|
||||
handle the after login event for the customers
|
||||
when their are pruoducts in the session or cookie
|
||||
of the logged in user.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Add Items in a
|
||||
* cart with some
|
||||
* cart and item
|
||||
* details.
|
||||
*
|
||||
* @param @id
|
||||
* @param $data
|
||||
*
|
||||
* @return Mixed
|
||||
*/
|
||||
public function add($id, $data) {
|
||||
|
||||
// session()->forget('cart');
|
||||
// return redirect()->back();
|
||||
|
||||
if(session()->has('cart')) {
|
||||
$cart = session()->get('cart');
|
||||
|
||||
$cartItems = $cart->items;
|
||||
$cartItems = $cart->items()->get();
|
||||
|
||||
if(isset($cartItems)) {
|
||||
|
||||
foreach($cartItems as $cartItem) {
|
||||
if($cartItem->product_id == $id) {
|
||||
$prevQty = $cartItem->quantity;
|
||||
|
|
@ -119,6 +129,14 @@ class Cart {
|
|||
|
||||
$data['product_id'] = $id;
|
||||
|
||||
if ($data['is_configurable'] == "true") {
|
||||
$temp = $data['super_attribute'];
|
||||
|
||||
unset($data['super_attribute']);
|
||||
|
||||
$data['additional'] = json_encode($temp);
|
||||
}
|
||||
|
||||
$cart->items()->create($data);
|
||||
|
||||
session()->flash('success', 'Item Successfully Added To Cart');
|
||||
|
|
@ -138,6 +156,7 @@ class Cart {
|
|||
* use detach to remove the
|
||||
* current product from cart tables
|
||||
*
|
||||
* @param Integer $id
|
||||
* @return Mixed
|
||||
*/
|
||||
public function remove($id) {
|
||||
|
|
@ -146,12 +165,13 @@ class Cart {
|
|||
}
|
||||
|
||||
/**
|
||||
* Function to handle merge
|
||||
* and sync the cookies products
|
||||
* with the existing data of cart
|
||||
* in the cart tables;
|
||||
*/
|
||||
|
||||
* This function handles
|
||||
* when guest has some of
|
||||
* cart products and then
|
||||
* logs in.
|
||||
*
|
||||
* @return Redirect
|
||||
*/
|
||||
public function mergeCart() {
|
||||
if(session()->has('cart')) {
|
||||
$cart = session()->get('cart');
|
||||
|
|
@ -168,7 +188,7 @@ class Cart {
|
|||
|
||||
foreach($cartItems as $key => $cartItem) {
|
||||
|
||||
if($cartItem->product_id == $customerCartItem->id) {
|
||||
if($cartItem->product_id == $customerCartItem->product_id) {
|
||||
|
||||
$customerItemQuantity = $customerCartItem->quantity;
|
||||
|
||||
|
|
@ -176,9 +196,9 @@ class Cart {
|
|||
|
||||
$customerCartItem->update(['cart_id' => $customerCart->id, 'quantity' => $cartItemQuantity + $customerItemQuantity]);
|
||||
|
||||
$cartItem->destroy();
|
||||
$this->cartItem->delete($cartItem->id);
|
||||
|
||||
unset($cartItems[$key]);
|
||||
$cartItems->forget($key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -202,36 +222,4 @@ class Cart {
|
|||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the session
|
||||
* maintained for cart
|
||||
* on customer logout.
|
||||
*
|
||||
* @return Mixed
|
||||
*/
|
||||
public function destroyCart() {
|
||||
if(session()->has('cart')) {
|
||||
session()->forget('cart');
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the session
|
||||
* maintained for cart
|
||||
* on customer logout.
|
||||
*
|
||||
* @return Mixed
|
||||
*/
|
||||
public function saveCustomerAddress($data)
|
||||
{
|
||||
if(!$cart = session()->get('cart'))
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,16 +5,16 @@ namespace Webkul\Cart\Http\Controllers;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
//Cart repositories
|
||||
use Webkul\Cart\Repositories\CartRepository;
|
||||
use Webkul\Cart\Repositories\CartItemRepository;
|
||||
|
||||
//Product Repository
|
||||
use Webkul\Product\Repositories\ProductRepository;
|
||||
|
||||
//Customer repositories
|
||||
use Webkul\Customer\Repositories\CustomerRepository;
|
||||
|
||||
use Webkul\Product\Product\ProductImage;
|
||||
use Webkul\Product\Product\View as ProductView;
|
||||
|
||||
use Cart;
|
||||
use Cookie;
|
||||
|
||||
|
|
@ -45,7 +45,9 @@ class CartController extends Controller
|
|||
|
||||
protected $product;
|
||||
|
||||
public function __construct(CartRepository $cart, CartItemRepository $cartItem, CustomerRepository $customer, ProductRepository $product) {
|
||||
protected $productView;
|
||||
|
||||
public function __construct(CartRepository $cart, CartItemRepository $cartItem, CustomerRepository $customer, ProductRepository $product, ProductImage $productImage, ProductView $productView) {
|
||||
|
||||
$this->middleware('customer')->except(['add', 'remove', 'test']);
|
||||
|
||||
|
|
@ -56,6 +58,12 @@ class CartController extends Controller
|
|||
$this->cartItem = $cartItem;
|
||||
|
||||
$this->product = $product;
|
||||
|
||||
$this->productImage = $productImage;
|
||||
|
||||
$this->productView = $productView;
|
||||
|
||||
$this->_config = request('_config');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -100,14 +108,76 @@ class CartController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* This is a test for
|
||||
* relationship existence
|
||||
* from cart item to product
|
||||
* Method to populate
|
||||
* the cart page which
|
||||
* will be populated
|
||||
* before the checkout
|
||||
* process.
|
||||
*
|
||||
* @return Mixed
|
||||
*/
|
||||
public function beforeCheckout() {
|
||||
if(auth()->guard('customer')->check()) {
|
||||
$cart = $this->cart->findOneByField('customer_id', auth()->guard('customer')->user()->id);
|
||||
|
||||
if(isset($cart)) {
|
||||
$cart = $this->cart->findOneByField('id', 144);
|
||||
|
||||
$cartItems = $this->cart->items($cart['id']);
|
||||
|
||||
$products = array();
|
||||
|
||||
foreach($cartItems as $cartItem) {
|
||||
$image = $this->productImage->getGalleryImages($cartItem->product);
|
||||
|
||||
if(isset($image[0]['small_image_url'])) {
|
||||
$products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, $image[0]['small_image_url'], $cartItem->quantity];
|
||||
}
|
||||
else {
|
||||
$products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, 'null', $cartItem->quantity];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(session()->has('cart')) {
|
||||
$cart = session()->get('cart');
|
||||
|
||||
if(isset($cart)) {
|
||||
$cart = $this->cart->findOneByField('id', 144);
|
||||
|
||||
$cartItems = $this->cart->items($cart['id']);
|
||||
|
||||
$products = array();
|
||||
|
||||
foreach($cartItems as $cartItem) {
|
||||
$image = $this->productImage->getGalleryImages($cartItem->product);
|
||||
|
||||
if(isset($image[0]['small_image_url'])) {
|
||||
$products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, $image[0]['small_image_url'], $cartItem->quantity];
|
||||
}
|
||||
else {
|
||||
$products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, 'null', $cartItem->quantity];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return view($this->_config['view'])->with('products', $products);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will return
|
||||
* the quantities from
|
||||
* inventory sources whose
|
||||
* status are not false.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function test() {
|
||||
$cart = $this->cart->findOneByField('id', 110);
|
||||
public function canAddOrUpdate() {
|
||||
$cart = $this->cart->findOneByField('id', 144);
|
||||
|
||||
$items = $cart->items;
|
||||
|
||||
|
|
@ -120,15 +190,56 @@ class CartController extends Controller
|
|||
foreach($items as $item) {
|
||||
$inventories = $item->product->inventories;
|
||||
|
||||
foreach($inventories as $inventory) {
|
||||
$totalQty = $totalQty + $inventory->qty;
|
||||
$inventory_sources = $item->product->inventory_sources;
|
||||
|
||||
$totalQty = 0;
|
||||
foreach($inventory_sources as $inventory_source) {
|
||||
|
||||
if($inventory_source->status!=0) {
|
||||
foreach($inventories as $inventory) {
|
||||
$totalQty = $totalQty + $inventory->qty;
|
||||
}
|
||||
|
||||
array_push($allProdQty1, $totalQty);
|
||||
|
||||
$allProdQty[$item->product->id] = $totalQty;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
array_push($allProdQty1, $totalQty);
|
||||
|
||||
$allProdQty[$item->product->id] = $totalQty;
|
||||
}
|
||||
|
||||
dd($allProdQty, $allProdQty1);
|
||||
dd($allProdQty);
|
||||
|
||||
foreach ($items as $item) {
|
||||
$inventories = $item->product->inventory_sources->where('status', '=', '1');
|
||||
|
||||
foreach($inventories as $inventory) {
|
||||
dump($inventory->status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function test() {
|
||||
$cart = $this->cart->findOneByField('id', 144);
|
||||
|
||||
$cartItems = $this->cart->items($cart['id']);
|
||||
|
||||
$products = array();
|
||||
|
||||
foreach($cartItems as $cartItem) {
|
||||
$image = $this->productImage->getGalleryImages($cartItem->product);
|
||||
|
||||
dump($cartItem->product);
|
||||
|
||||
if(isset($image[0]['small_image_url'])) {
|
||||
$products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, $image[0]['small_image_url'], $cartItem->quantity];
|
||||
}
|
||||
else {
|
||||
$products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, 'null', $cartItem->quantity];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dd($products);
|
||||
}
|
||||
}
|
||||
|
|
@ -6,19 +6,19 @@ use Illuminate\View\View;
|
|||
use Illuminate\Support\Collection;
|
||||
|
||||
use Webkul\Cart\Repositories\CartRepository;
|
||||
|
||||
use Webkul\Cart\Repositories\CartItemRepository;
|
||||
|
||||
//Product Image Helper Class
|
||||
use Webkul\Product\Product\ProductImage;
|
||||
|
||||
use Cookie;
|
||||
use Cart;
|
||||
|
||||
/**
|
||||
* cart List Composer on Navigation Menu
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class CartComposer
|
||||
{
|
||||
|
||||
|
|
@ -35,10 +35,12 @@ class CartComposer
|
|||
* @param View $view
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(CartRepository $cart, CartItemRepository $cartItem) {
|
||||
public function __construct(CartRepository $cart, CartItemRepository $cartItem, ProductImage $productImage) {
|
||||
$this->cart = $cart;
|
||||
|
||||
$this->cartItem = $cartItem;
|
||||
|
||||
$this->productImage = $productImage;
|
||||
}
|
||||
|
||||
public function compose(View $view) {
|
||||
|
|
@ -46,30 +48,51 @@ class CartComposer
|
|||
$cart = $this->cart->findOneByField('customer_id', auth()->guard('customer')->user()->id);
|
||||
|
||||
if(isset($cart)) {
|
||||
$cart_items = $this->cart->items($cart['id']);
|
||||
$cart = $this->cart->findOneByField('id', 144);
|
||||
|
||||
$cart_products = array();
|
||||
$cartItems = $this->cart->items($cart['id']);
|
||||
|
||||
foreach($cart_items as $cart_item) {
|
||||
array_push($cart_products, $this->cartItem->getProduct($cart_item->id));
|
||||
}
|
||||
$products = array();
|
||||
|
||||
$view->with('cart', $cart_products);
|
||||
}
|
||||
} else {
|
||||
if(Cookie::has('cart_session_id')) {
|
||||
$cart = $this->cart->findOneByField('session_id', Cookie::get('cart_session_id'));
|
||||
foreach($cartItems as $cartItem) {
|
||||
$image = $this->productImage->getGalleryImages($cartItem->product);
|
||||
|
||||
if(isset($cart)) {
|
||||
$cart_items = $this->cart->items($cart['id']);
|
||||
|
||||
$cart_products = array();
|
||||
|
||||
foreach($cart_items as $cart_item) {
|
||||
array_push($cart_products, $this->cartItem->getProduct($cart_item->id));
|
||||
if(isset($image[0]['small_image_url'])) {
|
||||
$products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, $image[0]['small_image_url'], $cartItem->quantity];
|
||||
}
|
||||
else {
|
||||
$products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, 'null', $cartItem->quantity];
|
||||
}
|
||||
|
||||
$view->with('cart', $cart_products);
|
||||
}
|
||||
session()->put('cart', $cart);
|
||||
|
||||
$view->with('cart', $products);
|
||||
}
|
||||
} else {
|
||||
if(session()->has('cart')) {
|
||||
$cart = session()->get('cart');
|
||||
|
||||
if(isset($cart)) {
|
||||
$cart = $this->cart->findOneByField('id', 144);
|
||||
|
||||
$cartItems = $this->cart->items($cart['id']);
|
||||
|
||||
$products = array();
|
||||
|
||||
foreach($cartItems as $cartItem) {
|
||||
$image = $this->productImage->getGalleryImages($cartItem->product);
|
||||
|
||||
if(isset($image[0]['small_image_url'])) {
|
||||
$products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, $image[0]['small_image_url'], $cartItem->quantity];
|
||||
}
|
||||
else {
|
||||
$products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, 'null', $cartItem->quantity];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$view->with('cart', $products);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,11 +15,6 @@ class Cart extends Model
|
|||
|
||||
protected $hidden = ['coupon_code'];
|
||||
|
||||
public function with_products() {
|
||||
|
||||
return $this->belongsToMany(Product::class, 'cart_items')->withPivot('id', 'product_id','quantity', 'cart_id');
|
||||
}
|
||||
|
||||
public function items() {
|
||||
return $this->hasMany('Webkul\Cart\Models\CartItem');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,8 +140,7 @@ class Core
|
|||
|
||||
$channel = $this->getCurrentChannel();
|
||||
|
||||
$currencyCode = $channel->base_currency->code;
|
||||
// $currencyCode = $channel->base_currency;
|
||||
$currencyCode = $channel->base_currency;
|
||||
|
||||
return currency($price, $currencyCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,10 @@ class RegistrationController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* For showing the registration form
|
||||
* Opens up the
|
||||
* user's sign up
|
||||
* form.
|
||||
*
|
||||
* @return view
|
||||
*/
|
||||
public function show()
|
||||
|
|
@ -40,9 +43,11 @@ class RegistrationController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* For collecting the registration
|
||||
* data from the registraion form
|
||||
* @return view
|
||||
* Method to store
|
||||
* user's sign up
|
||||
* form data to DB
|
||||
*
|
||||
* @return Mixed
|
||||
*/
|
||||
public function create(Request $request)
|
||||
{
|
||||
|
|
@ -52,13 +57,17 @@ class RegistrationController extends Controller
|
|||
'first_name' => 'string|required',
|
||||
'last_name' => 'string|required',
|
||||
'email' => 'email|required',
|
||||
'password' => 'confirmed|min:6|required'
|
||||
|
||||
'password' => 'confirmed|min:6|required',
|
||||
'agreement' => 'confirmed'
|
||||
]);
|
||||
|
||||
$registrationData = $request->except('_token');
|
||||
$data = request()->input();
|
||||
|
||||
if ($this->customer->create($registrationData)) {
|
||||
$data['password'] = bcrypt($data['password']);
|
||||
|
||||
// $registrationData = $request->except('_token');
|
||||
|
||||
if ($this->customer->create($data)) {
|
||||
|
||||
session()->flash('success', 'Account created successfully.');
|
||||
|
||||
|
|
|
|||
|
|
@ -9,4 +9,16 @@ class ProductInventory extends Model
|
|||
public $timestamps = false;
|
||||
|
||||
protected $fillable = ['qty', 'product_id', 'inventory_source_id'];
|
||||
|
||||
/**
|
||||
* Use by cart for
|
||||
* checking the
|
||||
* inventory source
|
||||
* status
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
// public function checkInventoryStatus() {
|
||||
// return $this->leftjoin('inventory_sources', 'inventory_sources.id', 'inventory_source_id')->select('status')->where('status', '=','1');
|
||||
// }
|
||||
}
|
||||
|
|
@ -16,6 +16,10 @@ Route::group(['middleware' => ['web']], function () {
|
|||
|
||||
Route::get('test', 'Webkul\Cart\Http\Controllers\CartController@test');
|
||||
|
||||
Route::get('cart', 'Webkul\Cart\Http\Controllers\CartController@beforeCheckout')->defaults('_config', [
|
||||
'view' => 'shop::store.cart.index'
|
||||
]);
|
||||
|
||||
Route::post('/checkout/save-address', 'Webkul\Cart\Http\Controllers\CheckoutController@saveAddress')->name('shop.checkout.save-address');
|
||||
|
||||
Route::post('/checkout/save-shipping', 'Webkul\Cart\Http\Controllers\CheckoutController@saveShipping')->name('shop.checkout.save-shipping');
|
||||
|
|
|
|||
|
|
@ -11,19 +11,22 @@
|
|||
</ul>
|
||||
<div class="dropdown-cart" :class="{ show: toggle }">
|
||||
<div class="dropdown-header">
|
||||
<p class="heading">Cart Subtotal - $80</p>
|
||||
<p class="heading">Cart Subtotal - $ {{ subtotal }}</p>
|
||||
<i class="icon icon-menu-close" @click="dropOrHide"></i>
|
||||
</div>
|
||||
|
||||
<div class="dropdown-content">
|
||||
<div class="item">
|
||||
<div class="item-image">
|
||||
<img />
|
||||
<div class="item" v-for="(item, index) in items" :key="index">
|
||||
<div class="item-image" v-if="item[2]!='null'">
|
||||
<img :src="item[2]"/>
|
||||
</div>
|
||||
<div class="item-image" v-else>
|
||||
<img :src="placeholder"/>
|
||||
</div>
|
||||
<div class="item-details">
|
||||
<div class="item-name">Some Item Name</div>
|
||||
<div class="item-price">$ Some Price</div>
|
||||
<div class="item-qty">Some Quantity</div>
|
||||
<div class="item-name">{{item[0]}}</div>
|
||||
<div class="item-price">$ {{ item[1] }}</div>
|
||||
<div class="item-qty">Quantity - {{ item[3] }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -41,14 +44,16 @@
|
|||
|
||||
export default {
|
||||
props: {
|
||||
items: Array,
|
||||
items: Object,
|
||||
},
|
||||
|
||||
data(){
|
||||
return {
|
||||
toggle: true,
|
||||
totalitems: 0,
|
||||
cart_items: []
|
||||
totalitems: parseInt(0),
|
||||
cart_items: [],
|
||||
placeholder: "http://localhost/bagisto/public/themes/default/assets/images/product/small-product-placeholder.png",
|
||||
subtotal : parseInt(0)
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -59,8 +64,9 @@ export default {
|
|||
},
|
||||
|
||||
mounted: function() {
|
||||
if(this.items != undefined)
|
||||
if(this.items != undefined) {
|
||||
this.initializeDropdown();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
@ -73,8 +79,13 @@ export default {
|
|||
},
|
||||
|
||||
initializeDropdown: function() {
|
||||
this.totalitems = this.items.length;
|
||||
this.cart_items = this.items;
|
||||
|
||||
var item;
|
||||
for(item in this.cart_items) {
|
||||
this.subtotal = this.subtotal + parseInt(this.cart_items[item][1]);
|
||||
this.totalitems = this.totalitems + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -89,6 +100,7 @@ export default {
|
|||
background: #FFFFFF;
|
||||
border: 1px solid #E8E8E8;
|
||||
box-shadow: 1px 3px 6px 0 rgba(0,0,0,0.40);
|
||||
color: #242424;
|
||||
padding: 20px;
|
||||
border-radius: 1px;
|
||||
right: 10%;
|
||||
|
|
@ -112,34 +124,47 @@ export default {
|
|||
width: 22px;
|
||||
}
|
||||
|
||||
.dropdown-cart > .dropdown-header p.heading {
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
.dropdown-content {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
.dropdown-content .item{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border-bottom: 1px solid #E8E8E8;
|
||||
padding-top: 9px;
|
||||
padding-bottom: 9px;
|
||||
}
|
||||
|
||||
.dropdown-content .item img{
|
||||
height: 75px;
|
||||
width: 75px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.dropdown-content .item-details{
|
||||
height: 75px;
|
||||
}
|
||||
|
||||
.item-details .item-name {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 9px;
|
||||
}
|
||||
|
||||
.item-details .item-price {
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 9px;
|
||||
}
|
||||
|
||||
.item-details .item-qty {
|
||||
margin-bottom: 10px;
|
||||
font-weight: lighter;
|
||||
margin-bottom: 9px;
|
||||
}
|
||||
|
||||
.dropdown-footer {
|
||||
|
|
@ -147,6 +172,7 @@ export default {
|
|||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.dropdown-footer button {
|
||||
|
|
|
|||
|
|
@ -618,6 +618,7 @@ section.slider-block {
|
|||
margin-bottom: 5%;
|
||||
|
||||
div.slider-content {
|
||||
position: relative;
|
||||
height: 500px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
|
@ -626,7 +627,7 @@ section.slider-block {
|
|||
ul.slider-images {
|
||||
|
||||
li{
|
||||
//both rules are equivalent to display none
|
||||
//both combined are equivalent to display none
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
|
@ -634,7 +635,7 @@ section.slider-block {
|
|||
li.show {
|
||||
display:block;
|
||||
visibility: visible;
|
||||
width: 80%;
|
||||
width: 100%;
|
||||
animation-name: example;
|
||||
animation-duration: 4s;
|
||||
}
|
||||
|
|
@ -654,7 +655,7 @@ section.slider-block {
|
|||
position: absolute;
|
||||
user-select: none;
|
||||
bottom: 2%;
|
||||
right: 11%;
|
||||
right: 2%;
|
||||
|
||||
|
||||
.dark-left-icon {
|
||||
|
|
@ -2147,19 +2148,19 @@ section.cart {
|
|||
border: 1px solid #E8E8E8;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
|
||||
|
||||
&.address-info {
|
||||
background-image: url('../images/address.svg');
|
||||
}
|
||||
|
||||
|
||||
&.shipping {
|
||||
background-image: url('../images/shipping.svg');
|
||||
}
|
||||
|
||||
|
||||
&.payment {
|
||||
background-image: url('../images/payment.svg');
|
||||
}
|
||||
|
||||
|
||||
&.review {
|
||||
background-image: url('../images/finish.svg');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,31 +18,31 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('first_name') ? 'has-error' : '']">
|
||||
<label for="first_name">{{ __('shop::app.customer.signup-form.firstname') }}</label>
|
||||
<input type="text" class="control" name="first_name" v-validate="'required'" value="{{ old('first_name') }}">
|
||||
<input type="text" class="control" name="first_name" v-validate="'required'" value="{{ old('first_name') }}" required>
|
||||
<span class="control-error" v-if="errors.has('first_name')">@{{ errors.first('first_name') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
|
||||
<label for="last_name">{{ __('shop::app.customer.signup-form.lastname') }}</label>
|
||||
<input type="text" class="control" name="last_name" v-validate="'required'" value="{{ old('last_name') }}">
|
||||
<input type="text" class="control" name="last_name" v-validate="'required'" value="{{ old('last_name') }}" required>
|
||||
<span class="control-error" v-if="errors.has('last_name')">@{{ errors.first('last_name') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
|
||||
<label for="email">{{ __('shop::app.customer.signup-form.email') }}</label>
|
||||
<input type="email" class="control" name="email" v-validate="'required|email'" value="{{ old('email') }}">
|
||||
<input type="email" class="control" name="email" v-validate="'required|email'" value="{{ old('email') }}" required>
|
||||
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('password') ? 'has-error' : '']">
|
||||
<label for="password">{{ __('shop::app.customer.signup-form.password') }}</label>
|
||||
<input type="password" class="control" name="password" v-validate="'required|min:6'" ref="password" value="{{ old('password') }}">
|
||||
<input type="password" class="control" name="password" v-validate="'required|min:6'" ref="password" value="{{ old('password') }}" required>
|
||||
<span class="control-error" v-if="errors.has('password')">@{{ errors.first('password') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('confirm_password') ? 'has-error' : '']">
|
||||
<label for="confirm_password">{{ __('shop::app.customer.signup-form.confirm_pass') }}</label>
|
||||
<input type="password" class="control" name="password_confirmation" v-validate="'required|min:6|confirmed:password'">
|
||||
<input type="password" class="control" name="password_confirmation" v-validate="'required|min:6|confirmed:password'" required>
|
||||
<span class="control-error" v-if="errors.has('confirm_password')">@{{ errors.first('confirm_password') }}</span>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,9 +7,11 @@
|
|||
|
||||
<div class="cart-content">
|
||||
|
||||
{{-- {{ dd($products) }} --}}
|
||||
|
||||
<div class="left-side">
|
||||
|
||||
<div class="item">
|
||||
{{-- <div class="item">
|
||||
<img class="item-image" src="{{ bagisto_asset('images/jeans_big.jpg') }}" />
|
||||
|
||||
<div class="item-details">
|
||||
|
|
@ -42,41 +44,45 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="item">
|
||||
<img class="item-image" src="{{ bagisto_asset('images/jeans_big.jpg') }}" />
|
||||
|
||||
<div class="item-details">
|
||||
|
||||
<div class="item-title">
|
||||
Rainbow Creation Embroided
|
||||
</div> --}}
|
||||
@foreach($products as $product)
|
||||
<div class="item">
|
||||
<div style="margin-right: 15px;">
|
||||
<img class="item-image" src="{{ bagisto_asset("$product[2]") }}" />
|
||||
</div>
|
||||
|
||||
<div class="price">
|
||||
<span class="main-price">
|
||||
$24.00
|
||||
</span>
|
||||
<span class="real-price">
|
||||
$25.00
|
||||
</span>
|
||||
<span class="discount">
|
||||
10% Off
|
||||
</span>
|
||||
<div class="item-details">
|
||||
|
||||
<div class="item-title">
|
||||
{{$product[0]}}
|
||||
</div>
|
||||
|
||||
<div class="price">
|
||||
<span class="main-price">
|
||||
{{$product[1]}}
|
||||
</span>
|
||||
<span class="real-price">
|
||||
$25.00
|
||||
</span>
|
||||
<span class="discount">
|
||||
10% Off
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="summary" >
|
||||
Color : Gray, Size : S, Sleeve type : Puffed Sleeves, Occasion : Birthday, Marriage Anniversary
|
||||
</div>
|
||||
|
||||
<div class="misc">
|
||||
<div class="qty-text">Quantity</div>
|
||||
<div class="box">{{ $product[3] }}</div>
|
||||
<span class="remove">Remove</span>
|
||||
<span class="towishlist">Move to Wishlist</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="summary">
|
||||
Color : Gray, Size : S, Sleeve type : Puffed Sleeves, Occasion : Birthday, Marriage Anniversary
|
||||
</div>
|
||||
|
||||
<div class="misc">
|
||||
<div class="qty-text">Quantity</div>
|
||||
<div class="box">1</div>
|
||||
<span class="remove">Remove</span>
|
||||
<span class="towishlist">Move to Wishlist</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<div class="misc-controls">
|
||||
<span>Continue Shopping</span>
|
||||
|
|
@ -90,22 +96,12 @@
|
|||
Price Detail
|
||||
</div>
|
||||
<div class="all-item-details">
|
||||
|
||||
<div class="item-details">
|
||||
<span class="name">Item 1</span>
|
||||
<span class="price">$25.00</span>
|
||||
</div>
|
||||
|
||||
<div class="item-details">
|
||||
<span class="name">Item 2</span>
|
||||
<span class="price">$25.00</span>
|
||||
</div>
|
||||
|
||||
<div class="item-details">
|
||||
<span class="name">Item 3</span>
|
||||
<span class="price">$25.00</span>
|
||||
</div>
|
||||
|
||||
@foreach($products as $product)
|
||||
<div class="item-details">
|
||||
<span class="name">{{ $product[0] }}</span>
|
||||
<span class="price">$ {{ $product[1] }}</span>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="horizontal-rule"></div>
|
||||
|
|
@ -664,6 +664,7 @@ section.slider-block {
|
|||
}
|
||||
|
||||
section.slider-block div.slider-content {
|
||||
position: relative;
|
||||
height: 500px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
|
@ -677,7 +678,7 @@ section.slider-block div.slider-content ul.slider-images li {
|
|||
section.slider-block div.slider-content ul.slider-images li.show {
|
||||
display: block;
|
||||
visibility: visible;
|
||||
width: 80%;
|
||||
width: 100%;
|
||||
-webkit-animation-name: example;
|
||||
animation-name: example;
|
||||
-webkit-animation-duration: 4s;
|
||||
|
|
@ -715,7 +716,7 @@ section.slider-block div.slider-content div.slider-control {
|
|||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
bottom: 2%;
|
||||
right: 11%;
|
||||
right: 2%;
|
||||
}
|
||||
|
||||
section.slider-block div.slider-content div.slider-control .dark-left-icon {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue