Skip to content

Commit

Permalink
[Fixed: git issues resolved.]
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-webkul committed Feb 17, 2020
1 parent 5044222 commit 9d00df3
Show file tree
Hide file tree
Showing 68 changed files with 3,134 additions and 164 deletions.
54 changes: 54 additions & 0 deletions CHANGELOG for v0.1.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,60 @@

#### This changelog consists the bug & security fixes and new features being included in the releases listed below.

## **v0.1.5(17th of February, 2020)** - *Release*

- [Bug] Default shipping method and payment method is not selected during checkout.

- [Bug] Review details is blank for configurable product.

- [Bug] Not getting success message on adding configurable product to wishlist.

- [Bug] Sign in customer also not able to make review.

- [Bug] Addresses gets added multiple time in Address Book of customer.

- [Bug] UI issue on cart page.

- [Bug] In Configuration Push Notification fields should not be required field, because of that customer not able to save configuration of pwa.

- [Bug] Wishlisted product is not visible in Customer->Wishlist section.

- [Bug] If from cart guest customer click on move to wishlist, then error message should throw.

- [Bug] Save as address should only available for signed in customer. If guest customer select to checkout with save as address option he is not able to checkout.

- [Bug] Issue with multi-currency. Price of product doesn't get updated in cart according to selected currency.

- [Bug] Layout issue in wishlist grid.

- [Bug] Unable to download Invoice.

- [Bug] Forward icon in shipment is not clickable.

- [Bug] Guest customer is able to make review, if it is not allowed from admin.

- [Bug] UI issue if special price is used for product.

- [Bug] Server Api key should be encrypted and on inspect element it should not visible.

- [Implement] save address option is not coming when logged in customer enters any new address on check out page.

- [Implement] Provide an option to delete review in PWA.

- [Implement] Push Notification Group and Server API key added in PWA configuration.

## **v0.1.4(13th of January, 2020)** - *Release*

- [compatible] Bagisto Version v0.1.9, v0.2.1, v0.2.2.

- [Bug] Filters are not visible.

- [Bug] Discount not applied on product.

- [Bug] After creating configurable product all products get disappear from front-end.

- [Implement] Not getting option to add coupon discount.

## **v0.1.3(26th of December, 2019)** - *Release*

* [Update] Added missing language translations.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It packs in lots of demanding features that allows your business to scale in no

### 2. Requirements:

* **Bagisto**: v0.1.6 or higher.
* **Bagisto**: v0.1.x, v0.2.1, v0.2.2.


### 3. Installation:
Expand Down
1 change: 1 addition & 0 deletions packages/Webkul/PWA/publishable/assets/css/pwa-admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions packages/Webkul/PWA/publishable/assets/images/Icon-PWA-Active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions packages/Webkul/PWA/publishable/assets/images/Icon-PWA.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions packages/Webkul/PWA/publishable/assets/images/Icon-bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/Webkul/PWA/publishable/assets/js/app.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion packages/Webkul/PWA/publishable/assets/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"/js/app.js": "/js/app.js?id=e23694f9cb98fcc7d64c",
"/js/app.js": "/js/app.js?id=e0ed52c91f6ed7e53c68",
"/css/pwa-admin.css": "/css/pwa-admin.css?id=7073d876ccd90f556cb1",
"/css/pwa.css": "/css/pwa.css?id=9fefbeddf7c821649828"
}
222 changes: 222 additions & 0 deletions packages/Webkul/PWA/src/Cart.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
<?php

namespace Webkul\PWA;

use Webkul\Checkout\Repositories\CartRepository;
use Webkul\Checkout\Repositories\CartItemRepository;
use Webkul\Checkout\Repositories\CartAddressRepository;
use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Product\Repositories\ProductRepository;
use Webkul\Tax\Repositories\TaxCategoryRepository;
use Webkul\Checkout\Models\CartPayment;
use Webkul\Customer\Repositories\WishlistRepository;
use Webkul\Customer\Repositories\CustomerAddressRepository;
use Webkul\Product\Helpers\Price;
use Webkul\Checkout\Cart as BaseCart;

/**
* Class Cart.
*
*/
class Cart extends BaseCart
{

/**
* CartRepository instance
*
* @var mixed
*/
protected $cart;

/**
* CartItemRepository instance
*
* @var mixed
*/
protected $cartItem;

/**
* CustomerRepository instance
*
* @var mixed
*/
protected $customer;

/**
* CartAddressRepository instance
*
* @var mixed
*/
protected $cartAddress;

/**
* ProductRepository instance
*
* @var mixed
*/
protected $product;

/**
* TaxCategoryRepository instance
*
* @var mixed
*/
protected $taxCategory;

/**
* WishlistRepository instance
*
* @var mixed
*/
protected $wishlist;

/**
* CustomerAddressRepository instance
*
* @var mixed
*/
protected $customerAddress;

/**
* Suppress the session flash messages
*/
protected $suppressFlash;

/**
* Product price helper instance
*/
protected $price;

/**
* Create a new controller instance.
*
* @param Webkul\Checkout\Repositories\CartRepository $cart
* @param Webkul\Checkout\Repositories\CartItemRepository $cartItem
* @param Webkul\Checkout\Repositories\CartAddressRepository $cartAddress
* @param Webkul\Customer\Repositories\CustomerRepository $customer
* @param Webkul\Product\Repositories\ProductRepository $product
* @param Webkul\Product\Repositories\TaxCategoryRepository $taxCategory
* @param Webkul\Product\Repositories\CustomerAddressRepository $customerAddress
* @param Webkul\Product\Repositories\CustomerAddressRepository $customerAddress
* @param Webkul\Discount\Repositories\CartRuleRepository $cartRule
* @param Webkul\Helpers\Discount $discount
* @return void
*/
public function __construct(
CartRepository $cart,
CartItemRepository $cartItem,
CartAddressRepository $cartAddress,
CustomerRepository $customer,
ProductRepository $product,
TaxCategoryRepository $taxCategory,
WishlistRepository $wishlist,
CustomerAddressRepository $customerAddress,
Price $price
)
{
parent::__construct(
$cart,
$cartItem,
$cartAddress,
$customer,
$product,
$taxCategory,
$wishlist,
$customerAddress,
$price
);

$this->product = $product;
}

/**
* Save customer address
*
* @return Mixed
*/
public function saveCustomerAddress($data)
{
if (! $cart = $this->getCart())
return false;

$billingAddress = $data['billing'];
$shippingAddress = $data['shipping'];
$billingAddress['cart_id'] = $shippingAddress['cart_id'] = $cart->id;

if (isset($data['billing']['address_id']) && $data['billing']['address_id']) {
$address = $this->customerAddress->findOneWhere(['id'=> $data['billing']['address_id']])->toArray();
$billingAddress['first_name'] = $this->getCurrentCustomer()->user()->first_name;
$billingAddress['last_name'] = $this->getCurrentCustomer()->user()->last_name;
$billingAddress['email'] = $this->getCurrentCustomer()->user()->email;
$billingAddress['address1'] = $address['address1'];
$billingAddress['country'] = $address['country'];
$billingAddress['state'] = $address['state'];
$billingAddress['city'] = $address['city'];
$billingAddress['postcode'] = $address['postcode'];
$billingAddress['phone'] = $address['phone'];
}

if (isset($data['shipping']['address_id']) && $data['shipping']['address_id']) {
$address = $this->customerAddress->findOneWhere(['id'=> $data['shipping']['address_id']])->toArray();
$shippingAddress['first_name'] = $this->getCurrentCustomer()->user()->first_name;
$shippingAddress['last_name'] = $this->getCurrentCustomer()->user()->last_name;
$shippingAddress['email'] = $this->getCurrentCustomer()->user()->email;
$shippingAddress['address1'] = $address['address1'];
$shippingAddress['country'] = $address['country'];
$shippingAddress['state'] = $address['state'];
$shippingAddress['city'] = $address['city'];
$shippingAddress['postcode'] = $address['postcode'];
$shippingAddress['phone'] = $address['phone'];
}

if (isset($data['billing']['save_as_address']) && $data['billing']['save_as_address'] && ! isset($data['billing']['address_id'])) {
$billingAddress['customer_id'] = $this->getCurrentCustomer()->user()->id;
$this->customerAddress->create($billingAddress);
}

if (isset($data['shipping']['save_as_address']) && $data['shipping']['save_as_address']) {
$shippingAddress['customer_id'] = $this->getCurrentCustomer()->user()->id;
$this->customerAddress->create($shippingAddress);
}

if ($billingAddressModel = $cart->billing_address) {
$this->cartAddress->update($billingAddress, $billingAddressModel->id);

if ($shippingAddressModel = $cart->shipping_address) {
if (isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) {
$this->cartAddress->update($billingAddress, $shippingAddressModel->id);
} else {
$this->cartAddress->update($shippingAddress, $shippingAddressModel->id);
}
} else {
if (isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) {
$this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'shipping']));
} else {
$this->cartAddress->create(array_merge($shippingAddress, ['address_type' => 'shipping']));
}
}
} else {
$this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'billing']));

if (isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) {
$this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'shipping']));
} else {
$this->cartAddress->create(array_merge($shippingAddress, ['address_type' => 'shipping']));
}
}

if ($this->getCurrentCustomer()->check()) {
$cart->customer_email = $this->getCurrentCustomer()->user()->email;
$cart->customer_first_name = $this->getCurrentCustomer()->user()->first_name;
$cart->customer_last_name = $this->getCurrentCustomer()->user()->last_name;
} else {
$cart->customer_email = $cart->billing_address->email;
$cart->customer_first_name = $cart->billing_address->first_name;
$cart->customer_last_name = $cart->billing_address->last_name;
}

$cart->save();

return true;
}
}
2 changes: 1 addition & 1 deletion packages/Webkul/PWA/src/Config/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'name' => 'Progressive Web App',
'route' => 'pwa.pushnotification.create',
'sort' => 9,
'icon-class' => 'catalog-icon',
'icon-class' => 'pwa-icon',
], [
'key' => 'PWA.index',
'route' => 'pwa.pushnotification.index',
Expand Down
Loading

0 comments on commit 9d00df3

Please sign in to comment.