Merge branch 'master' into allowed_ip_issue
This commit is contained in:
commit
6f367e0a69
|
|
@ -24,10 +24,10 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup php
|
||||
uses: shivammathur/setup-php@v1
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.3'
|
||||
extensions: intl, curl, mbstring, openssl, pdo, pdo_mysql, tokenizer
|
||||
extensions: curl, gd, intl, mbstring, openssl, pdo, pdo_mysql, tokenizer, zip
|
||||
|
||||
- name: Set environment
|
||||
run: |
|
||||
|
|
|
|||
10
README.md
10
README.md
|
|
@ -157,4 +157,12 @@ Thank you to all our backers! 🙏
|
|||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
|
||||
|
||||
<a href="https://opencollective.com/bagisto/contribute/sponsor-7372/checkout" target="_blank"><img src="https://images.opencollective.com/static/images/become_sponsor.svg"></a>
|
||||
<div>
|
||||
<a href="https://opencollective.com/bagisto/contribute/sponsor-7372/checkout" target="_blank">
|
||||
<img src="https://images.opencollective.com/static/images/become_sponsor.svg">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<kbd>
|
||||
<img src="https://images.opencollective.com/e-ventures1/7d61db2/logo.png" height="75">
|
||||
</kbd>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -31,7 +31,7 @@ class AddressController extends Controller
|
|||
/**
|
||||
* Controller instance
|
||||
*
|
||||
* @param Webkul\Customer\Repositories\CustomerAddressRepository $customerAddressRepository
|
||||
* @param CustomerAddressRepository $customerAddressRepository
|
||||
*/
|
||||
public function __construct(CustomerAddressRepository $customerAddressRepository)
|
||||
{
|
||||
|
|
@ -49,12 +49,12 @@ class AddressController extends Controller
|
|||
/**
|
||||
* Get user address.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
$customer = auth($this->guard)->user();
|
||||
|
||||
|
||||
$addresses = $customer->addresses()->get();
|
||||
|
||||
return CustomerAddressResource::collection($addresses);
|
||||
|
|
@ -63,13 +63,14 @@ class AddressController extends Controller
|
|||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function store()
|
||||
{
|
||||
$customer = auth($this->guard)->user();
|
||||
|
||||
if (request()->input('address1') && ! is_array(json_decode(request()->input('address1')))) {
|
||||
if (request()->input('address1') && ! is_array(request()->input('address1'))) {
|
||||
return response()->json([
|
||||
'message' => 'address1 must be an array.',
|
||||
]);
|
||||
|
|
@ -77,18 +78,20 @@ class AddressController extends Controller
|
|||
|
||||
if (request()->input('address1')) {
|
||||
request()->merge([
|
||||
'address1' => implode(PHP_EOL, array_filter(json_decode(request()->input('address1')))),
|
||||
'address1' => implode(PHP_EOL, array_filter(request()->input('address1'))),
|
||||
'customer_id' => $customer->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->validate(request(), [
|
||||
'address1' => 'string|required',
|
||||
'country' => 'string|required',
|
||||
'state' => 'string|required',
|
||||
'city' => 'string|required',
|
||||
'company' => 'string|nullable',
|
||||
'vat_id' => 'string|nullable',
|
||||
'country' => 'string|required',
|
||||
'state' => 'string|nullable',
|
||||
'city' => 'string|required',
|
||||
'postcode' => 'required',
|
||||
'phone' => 'required',
|
||||
'phone' => 'required',
|
||||
]);
|
||||
|
||||
$customerAddress = $this->customerAddressRepository->create(request()->all());
|
||||
|
|
@ -101,29 +104,37 @@ class AddressController extends Controller
|
|||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function update()
|
||||
public function update(int $id)
|
||||
{
|
||||
$customer = auth($this->guard)->user();
|
||||
if (request()->input('address1') && ! is_array(request()->input('address1'))) {
|
||||
return response()->json([
|
||||
'message' => 'address1 must be an array.',
|
||||
]);
|
||||
}
|
||||
|
||||
request()->merge(['address1' => implode(PHP_EOL, array_filter(request()->input('address1')))]);
|
||||
|
||||
$this->validate(request(), [
|
||||
'address1' => 'string|required',
|
||||
'country' => 'string|required',
|
||||
'state' => 'string|required',
|
||||
'city' => 'string|required',
|
||||
'company' => 'string|nullable',
|
||||
'vat_id' => 'string|nullable',
|
||||
'country' => 'string|required',
|
||||
'state' => 'string|nullable',
|
||||
'city' => 'string|required',
|
||||
'postcode' => 'required',
|
||||
'phone' => 'required',
|
||||
'phone' => 'required',
|
||||
]);
|
||||
|
||||
$this->customerAddressRepository->update(request()->all(), request()->input('id'));
|
||||
$customerAddress = $this->customerAddressRepository->update(request()->all(), $id);
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Your address has been updated successfully.',
|
||||
'data' => new CustomerAddressResource($this->customerAddressRepository->find(request()->input('id'))),
|
||||
'data' => new CustomerAddressResource($customerAddress),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ class CustomerAddress extends JsonResource
|
|||
'first_name' => $this->first_name,
|
||||
'last_name' => $this->last_name,
|
||||
'company_name' => $this->company_name,
|
||||
'vat_id' => $this->vat_id,
|
||||
'address1' => explode(PHP_EOL, $this->address1),
|
||||
'country' => $this->country,
|
||||
'country_name' => core()->country_name($this->country),
|
||||
|
|
@ -26,6 +27,7 @@ class CustomerAddress extends JsonResource
|
|||
'city' => $this->city,
|
||||
'postcode' => $this->postcode,
|
||||
'phone' => $this->phone,
|
||||
'is_default' => $this->default_address,
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ abstract class Address extends Model implements AddressContract
|
|||
|
||||
protected $casts = [
|
||||
'additional' => 'array',
|
||||
'default_address' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Icon-remove</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Icon-remove" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<circle id="Oval-9" stroke="#979797" stroke-width="2" cx="12" cy="12" r="10"></circle>
|
||||
<g id="Icon-Cross-Sm" transform="translate(9.000000, 9.000000)" stroke="#8E8E8E" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
|
||||
<path d="M0,0 L6,6" id="Path-2"></path>
|
||||
<path d="M0,0 L6,6" id="Path-2" transform="translate(3.000000, 3.000000) scale(-1, 1) translate(-3.000000, -3.000000) "></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 911 B |
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"/js/velocity.js": "/js/velocity.js?id=a45dba1beb5c6f79193d",
|
||||
"/js/velocity.js": "/js/velocity.js?id=88772f0049a360a2c02e",
|
||||
"/css/velocity-admin.css": "/css/velocity-admin.css?id=4322502d80a0e4a0affd",
|
||||
"/css/velocity.css": "/css/velocity.css?id=2ee191136dd475471b01"
|
||||
"/css/velocity.css": "/css/velocity.css?id=b900a5750cddffe0d3f5"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,9 @@ class ShopController extends Controller
|
|||
return $this->velocityHelper->formatProduct($product);
|
||||
}
|
||||
}
|
||||
}),
|
||||
})->reject(function ($product) {
|
||||
return is_null($product);
|
||||
})->values(),
|
||||
];
|
||||
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@
|
|||
height: 24px;
|
||||
margin-right: 0;
|
||||
position: absolute;
|
||||
background-image: url(/themes/velocity/assets/images/Icon-remove.svg);
|
||||
background-image: url("../images/Icon-remove.svg");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -686,7 +686,7 @@
|
|||
.product-quantity {
|
||||
.quantity {
|
||||
display: inline-flex;
|
||||
|
||||
|
||||
label {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,14 +98,9 @@
|
|||
padding: 0;
|
||||
width: 100%;
|
||||
height: $header-height;
|
||||
position: fixed;
|
||||
background-color: $white-color;
|
||||
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
|
||||
|
||||
+ div {
|
||||
margin-top: $header-height;
|
||||
}
|
||||
|
||||
> div {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue