Resolved conflicts
This commit is contained in:
commit
a31fba56b1
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
return [
|
||||
[
|
||||
'key' => 'general',
|
||||
'key' => 'general',
|
||||
'name' => 'admin::app.admin.system.general',
|
||||
'sort' => 1,
|
||||
], [
|
||||
|
|
@ -21,15 +21,15 @@ return [
|
|||
'options' => [
|
||||
[
|
||||
'title' => 'lbs',
|
||||
'value' => 'lbs'
|
||||
'value' => 'lbs',
|
||||
], [
|
||||
'title' => 'kgs',
|
||||
'value' => 'kgs'
|
||||
]
|
||||
'value' => 'kgs',
|
||||
],
|
||||
],
|
||||
'channel_based' => true,
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
], [
|
||||
'key' => 'general.content',
|
||||
'name' => 'admin::app.admin.system.content',
|
||||
|
|
@ -44,24 +44,15 @@ return [
|
|||
'title' => 'admin::app.admin.system.footer-content',
|
||||
'type' => 'text',
|
||||
'channel_based' => true,
|
||||
'locale_based' => true
|
||||
'locale_based' => true,
|
||||
], [
|
||||
'name' => 'footer_toggle',
|
||||
'title' => 'admin::app.admin.system.footer-toggle',
|
||||
'type' => 'select',
|
||||
'options' => [
|
||||
[
|
||||
'title' => 'True',
|
||||
'value' => 1
|
||||
], [
|
||||
'title' => 'False',
|
||||
'value' => 0
|
||||
]
|
||||
],
|
||||
'name' => 'footer_toggle',
|
||||
'title' => 'admin::app.admin.system.footer-toggle',
|
||||
'type' => 'boolean',
|
||||
'locale_based' => true,
|
||||
'channel_based' => true,
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
], [
|
||||
'key' => 'general.design',
|
||||
'name' => 'admin::app.admin.system.design',
|
||||
|
|
@ -76,17 +67,17 @@ return [
|
|||
'title' => 'admin::app.admin.system.logo-image',
|
||||
'type' => 'image',
|
||||
'channel_based' => true,
|
||||
'validation' => 'mimes:jpeg,bmp,png,jpg'
|
||||
]
|
||||
]
|
||||
'validation' => 'mimes:jpeg,bmp,png,jpg',
|
||||
],
|
||||
],
|
||||
], [
|
||||
'key' => 'catalog',
|
||||
'name' => 'admin::app.admin.system.catalog',
|
||||
'sort' => 2
|
||||
'sort' => 2,
|
||||
], [
|
||||
'key' => 'catalog.products',
|
||||
'name' => 'admin::app.admin.system.products',
|
||||
'sort' => 2
|
||||
'sort' => 2,
|
||||
], [
|
||||
'key' => 'catalog.products.guest-checkout',
|
||||
'name' => 'admin::app.admin.system.guest-checkout',
|
||||
|
|
@ -95,9 +86,9 @@ return [
|
|||
[
|
||||
'name' => 'allow-guest-checkout',
|
||||
'title' => 'admin::app.admin.system.allow-guest-checkout',
|
||||
'type' => 'boolean'
|
||||
]
|
||||
]
|
||||
'type' => 'boolean',
|
||||
],
|
||||
],
|
||||
], [
|
||||
'key' => 'catalog.products.review',
|
||||
'name' => 'admin::app.admin.system.review',
|
||||
|
|
@ -106,9 +97,9 @@ return [
|
|||
[
|
||||
'name' => 'guest_review',
|
||||
'title' => 'admin::app.admin.system.allow-guest-review',
|
||||
'type' => 'boolean'
|
||||
]
|
||||
]
|
||||
'type' => 'boolean',
|
||||
],
|
||||
],
|
||||
], [
|
||||
'key' => 'catalog.inventory',
|
||||
'name' => 'admin::app.admin.system.inventory',
|
||||
|
|
@ -122,9 +113,9 @@ return [
|
|||
'name' => 'backorders',
|
||||
'title' => 'admin::app.admin.system.allow-backorders',
|
||||
'type' => 'boolean',
|
||||
'channel_based' => true
|
||||
]
|
||||
]
|
||||
'channel_based' => true,
|
||||
],
|
||||
],
|
||||
], [
|
||||
'key' => 'customer',
|
||||
'name' => 'admin::app.admin.system.customer',
|
||||
|
|
@ -143,9 +134,9 @@ return [
|
|||
'title' => 'admin::app.admin.system.street-lines',
|
||||
'type' => 'text',
|
||||
'validation' => 'between:1,4',
|
||||
'channel_based' => true
|
||||
]
|
||||
]
|
||||
'channel_based' => true,
|
||||
],
|
||||
],
|
||||
], [
|
||||
'key' => 'customer.settings.newsletter',
|
||||
'name' => 'admin::app.admin.system.newsletter',
|
||||
|
|
@ -155,7 +146,7 @@ return [
|
|||
'name' => 'subscription',
|
||||
'title' => 'admin::app.admin.system.newsletter-subscription',
|
||||
'type' => 'boolean',
|
||||
]
|
||||
],
|
||||
],
|
||||
], [
|
||||
'key' => 'customer.settings.email',
|
||||
|
|
@ -165,8 +156,72 @@ return [
|
|||
[
|
||||
'name' => 'verification',
|
||||
'title' => 'admin::app.admin.system.email-verification',
|
||||
'type' => 'boolean'
|
||||
]
|
||||
'type' => 'boolean',
|
||||
],
|
||||
],
|
||||
], [
|
||||
'key' => 'emails',
|
||||
'name' => 'admin::app.admin.emails.email',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'emails.general',
|
||||
'name' => 'admin::app.admin.emails.notification_label',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'emails.general.notifications',
|
||||
'name' => 'admin::app.admin.emails.notification_label',
|
||||
'sort' => 1,
|
||||
'fields' => [
|
||||
[
|
||||
'name' => 'emails.general.notifications.verification',
|
||||
'title' => 'admin::app.admin.emails.notifications.verification',
|
||||
'type' => 'boolean',
|
||||
],
|
||||
[
|
||||
'name' => 'emails.general.notifications.registration',
|
||||
'title' => 'admin::app.admin.emails.notifications.registration',
|
||||
'type' => 'boolean',
|
||||
],
|
||||
[
|
||||
'name' => 'emails.general.notifications.customer',
|
||||
'title' => 'admin::app.admin.emails.notifications.customer',
|
||||
'type' => 'boolean',
|
||||
],
|
||||
[
|
||||
'name' => 'emails.general.notifications.new-order',
|
||||
'title' => 'admin::app.admin.emails.notifications.new-order',
|
||||
'type' => 'boolean',
|
||||
],
|
||||
[
|
||||
'name' => 'emails.general.notifications.new-admin',
|
||||
'title' => 'admin::app.admin.emails.notifications.new-admin',
|
||||
'type' => 'boolean',
|
||||
],
|
||||
[
|
||||
'name' => 'emails.general.notifications.new-invoice',
|
||||
'title' => 'admin::app.admin.emails.notifications.new-invoice',
|
||||
'type' => 'boolean',
|
||||
],
|
||||
[
|
||||
'name' => 'emails.general.notifications.new-refund',
|
||||
'title' => 'admin::app.admin.emails.notifications.new-refund',
|
||||
'type' => 'boolean',
|
||||
],
|
||||
[
|
||||
'name' => 'emails.general.notifications.new-shipment',
|
||||
'title' => 'admin::app.admin.emails.notifications.new-shipment',
|
||||
'type' => 'boolean',
|
||||
],
|
||||
[
|
||||
'name' => 'emails.general.notifications.new-inventory-source',
|
||||
'title' => 'admin::app.admin.emails.notifications.new-inventory-source',
|
||||
'type' => 'boolean',
|
||||
],
|
||||
[
|
||||
'name' => 'emails.general.notifications.cancel-order',
|
||||
'title' => 'admin::app.admin.emails.notifications.cancel-order',
|
||||
'type' => 'boolean',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
@ -46,7 +46,7 @@ class ProductDataGrid extends DataGrid
|
|||
'product_flat.status',
|
||||
'product_flat.price',
|
||||
'attribute_families.name as attribute_family',
|
||||
DB::raw('SUM(' . DB::getTablePrefix() . 'product_inventories.qty) as quantity')
|
||||
DB::raw('SUM(DISTINCT ' . DB::getTablePrefix() . 'product_inventories.qty) as quantity')
|
||||
);
|
||||
|
||||
if ($this->locale !== 'all') {
|
||||
|
|
|
|||
|
|
@ -120,7 +120,10 @@ class CustomerController extends Controller
|
|||
$customer = $this->customerRepository->create($data);
|
||||
|
||||
try {
|
||||
Mail::queue(new NewCustomerNotification($customer, $password));
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.customer';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewCustomerNotification($customer, $password));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,9 +28,15 @@ class Order
|
|||
public function sendNewOrderMail($order)
|
||||
{
|
||||
try {
|
||||
Mail::queue(new NewOrderNotification($order));
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-order';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewOrderNotification($order));
|
||||
}
|
||||
|
||||
Mail::queue(new NewAdminNotification($order));
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-admin';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewAdminNotification($order));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
|
|
@ -48,7 +54,10 @@ class Order
|
|||
return;
|
||||
}
|
||||
|
||||
Mail::queue(new NewInvoiceNotification($invoice));
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-invoice';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewInvoiceNotification($invoice));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
|
|
@ -62,7 +71,10 @@ class Order
|
|||
public function sendNewRefundMail($refund)
|
||||
{
|
||||
try {
|
||||
Mail::queue(new NewRefundNotification($refund));
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-refund';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewRefundNotification($refund));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
|
|
@ -80,9 +92,15 @@ class Order
|
|||
return;
|
||||
}
|
||||
|
||||
Mail::queue(new NewShipmentNotification($shipment));
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-shipment';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewShipmentNotification($shipment));
|
||||
}
|
||||
|
||||
Mail::queue(new NewInventorySourceNotification($shipment));
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.new-inventory-source';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new NewInventorySourceNotification($shipment));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
|
|
@ -95,7 +113,10 @@ class Order
|
|||
public function sendCancelOrderMail($order)
|
||||
{
|
||||
try {
|
||||
Mail::queue(new CancelOrderNotification($order));
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.cancel-order';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new CancelOrderNotification($order));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1206,6 +1206,23 @@ return [
|
|||
],
|
||||
|
||||
'admin' => [
|
||||
'emails' => [
|
||||
'email' => 'Email',
|
||||
'notification_label' => 'Notifications',
|
||||
'notifications' => [
|
||||
'verification' => 'Send verification E-mail',
|
||||
'registration' => 'Send registration E-mail',
|
||||
'customer' => 'Send customer E-mail',
|
||||
'new-order' => 'Send Order Confirmation E-mail',
|
||||
'new-admin' => 'Send Admin Invitation E-mail',
|
||||
'new-invoice' => 'Send Invoice Confirmation E-mail',
|
||||
'new-refund' => 'Send Refund Notification E-mail',
|
||||
'new-shipment' => 'Send Shipment Notification E-mail',
|
||||
'new-inventory-source' => 'Send Inventory Source Notification E-mail',
|
||||
'cancel-order' => 'Send cancel Order Notification E-mail',
|
||||
],
|
||||
|
||||
],
|
||||
'system' => [
|
||||
'catalog' => 'Catalog',
|
||||
'products' => 'Products',
|
||||
|
|
|
|||
|
|
@ -738,8 +738,11 @@ class Cart {
|
|||
foreach ($taxRates as $rate) {
|
||||
$haveTaxRate = false;
|
||||
|
||||
if ($rate->state != '' && $rate->state != $address->state)
|
||||
if ($rate->state != '' && $rate->state != $address->state) {
|
||||
$this->setItemTaxToZero($item);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! $rate->is_zip) {
|
||||
if ($rate->zip_code == '*' || $rate->zip_code == $address->postcode)
|
||||
|
|
@ -755,19 +758,32 @@ class Cart {
|
|||
$item->base_tax_amount = ($item->base_total * $rate->tax_rate) / 100;
|
||||
|
||||
$item->save();
|
||||
break;
|
||||
} else {
|
||||
$this->setItemTaxToZero($item);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$item->tax_percent = 0;
|
||||
$item->tax_amount = 0;
|
||||
$item->base_tax_amount = 0;
|
||||
|
||||
$item->save();
|
||||
$this->setItemTaxToZero($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Item tax to zero.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setItemTaxToZero($item) {
|
||||
$item->tax_percent = 0;
|
||||
$item->tax_amount = 0;
|
||||
$item->base_tax_amount = 0;
|
||||
|
||||
$item->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if cart has any error
|
||||
*
|
||||
|
|
|
|||
|
|
@ -6,5 +6,4 @@
|
|||
{
|
||||
return app()->make(Cart::class);
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
||||
|
|
@ -15,13 +15,113 @@ class ConfigTableSeeder extends Seeder
|
|||
$now = Carbon::now();
|
||||
|
||||
DB::table('core_config')->insert([
|
||||
'id' => 1,
|
||||
'code' => 'catalog.products.guest-checkout.allow-guest-checkout',
|
||||
'value' => '1',
|
||||
'id' => 1,
|
||||
'code' => 'catalog.products.guest-checkout.allow-guest-checkout',
|
||||
'value' => '1',
|
||||
'channel_code' => null,
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
|
||||
DB::table('core_config')->insert([
|
||||
'id' => 2,
|
||||
'code' => 'emails.general.notifications.emails.general.notifications.verification',
|
||||
'value' => '1',
|
||||
'channel_code' => null,
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
|
||||
DB::table('core_config')->insert([
|
||||
'id' => 3,
|
||||
'code' => 'emails.general.notifications.emails.general.notifications.registration',
|
||||
'value' => '1',
|
||||
'channel_code' => null,
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
|
||||
DB::table('core_config')->insert([
|
||||
'id' => 4,
|
||||
'code' => 'emails.general.notifications.emails.general.notifications.customer',
|
||||
'value' => '1',
|
||||
'channel_code' => null,
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
|
||||
DB::table('core_config')->insert([
|
||||
'id' => 5,
|
||||
'code' => 'emails.general.notifications.emails.general.notifications.new-order',
|
||||
'value' => '1',
|
||||
'channel_code' => null,
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
|
||||
DB::table('core_config')->insert([
|
||||
'id' => 6,
|
||||
'code' => 'emails.general.notifications.emails.general.notifications.new-admin',
|
||||
'value' => '1',
|
||||
'channel_code' => null,
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
|
||||
DB::table('core_config')->insert([
|
||||
'id' => 7,
|
||||
'code' => 'emails.general.notifications.emails.general.notifications.new-invoice',
|
||||
'value' => '1',
|
||||
'channel_code' => null,
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
|
||||
DB::table('core_config')->insert([
|
||||
'id' => 8,
|
||||
'code' => 'emails.general.notifications.emails.general.notifications.new-refund',
|
||||
'value' => '1',
|
||||
'channel_code' => null,
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
|
||||
DB::table('core_config')->insert([
|
||||
'id' => 9,
|
||||
'code' => 'emails.general.notifications.emails.general.notifications.new-shipment',
|
||||
'value' => '1',
|
||||
'channel_code' => null,
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
|
||||
DB::table('core_config')->insert([
|
||||
'id' => 10,
|
||||
'code' => 'emails.general.notifications.emails.general.notifications.new-inventory-source',
|
||||
'value' => '1',
|
||||
'channel_code' => null,
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
|
||||
DB::table('core_config')->insert([
|
||||
'id' => 11,
|
||||
'code' => 'emails.general.notifications.emails.general.notifications.cancel-order',
|
||||
'value' => '1',
|
||||
'channel_code' => null,
|
||||
'locale_code' => null,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -16,7 +16,12 @@ class CurrencyTableSeeder extends Seeder
|
|||
DB::table('currencies')->insert([
|
||||
'id' => 1,
|
||||
'code' => 'USD',
|
||||
'name' => 'US Dollar'
|
||||
'name' => 'US Dollar'
|
||||
], [
|
||||
'id' => 2,
|
||||
'code' => 'EUR',
|
||||
'name' => 'Euro',
|
||||
'symbol' => '€'
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class CurrencyController extends Controller
|
|||
'name' => 'required'
|
||||
]);
|
||||
|
||||
Event::dispatch('core.channel.create.before');
|
||||
Event::dispatch('core.currency.create.before');
|
||||
|
||||
$currency = $this->currencyRepository->create(request()->all());
|
||||
|
||||
|
|
|
|||
|
|
@ -31,23 +31,24 @@ class RegistrationController extends Controller
|
|||
* CustomerRepository object
|
||||
*
|
||||
* @var Object
|
||||
*/
|
||||
*/
|
||||
protected $customerRepository;
|
||||
|
||||
/**
|
||||
* CustomerGroupRepository object
|
||||
*
|
||||
* @var Object
|
||||
*/
|
||||
*/
|
||||
protected $customerGroupRepository;
|
||||
|
||||
/**
|
||||
* Create a new Repository instance.
|
||||
*
|
||||
* @param \Webkul\Customer\Repositories\CustomerRepository $customer
|
||||
* @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository
|
||||
* @param \Webkul\Customer\Repositories\CustomerRepository $customer
|
||||
* @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
*/
|
||||
public function __construct(
|
||||
CustomerRepository $customerRepository,
|
||||
CustomerGroupRepository $customerGroupRepository
|
||||
|
|
@ -79,9 +80,9 @@ class RegistrationController extends Controller
|
|||
{
|
||||
$this->validate(request(), [
|
||||
'first_name' => 'string|required',
|
||||
'last_name' => 'string|required',
|
||||
'email' => 'email|required|unique:customers,email',
|
||||
'password' => 'confirmed|min:6|required',
|
||||
'last_name' => 'string|required',
|
||||
'email' => 'email|required|unique:customers,email',
|
||||
'password' => 'confirmed|min:6|required',
|
||||
]);
|
||||
|
||||
$data = request()->input();
|
||||
|
|
@ -110,7 +111,10 @@ class RegistrationController extends Controller
|
|||
if ($customer) {
|
||||
if (core()->getConfigData('customer.settings.email.verification')) {
|
||||
try {
|
||||
Mail::queue(new VerificationEmail($verificationData));
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.verification';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new VerificationEmail($verificationData));
|
||||
}
|
||||
|
||||
session()->flash('success', trans('shop::app.customer.signup-form.success-verify'));
|
||||
} catch (\Exception $e) {
|
||||
|
|
@ -119,7 +123,10 @@ class RegistrationController extends Controller
|
|||
}
|
||||
} else {
|
||||
try {
|
||||
Mail::queue(new RegistrationEmail(request()->all()));
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.registration';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new RegistrationEmail(request()->all()));
|
||||
}
|
||||
|
||||
session()->flash('success', trans('shop::app.customer.signup-form.success-verify')); //customer registered successfully
|
||||
} catch (\Exception $e) {
|
||||
|
|
|
|||
|
|
@ -7,4 +7,3 @@
|
|||
return new Payment;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -35,8 +35,9 @@ class ProductFlatRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* get Category Product
|
||||
* get Category Product Attribute
|
||||
*
|
||||
* @param CategoryId $categoryId
|
||||
* @return array
|
||||
*/
|
||||
public function getCategoryProductAttribute($categoryId)
|
||||
|
|
@ -61,4 +62,35 @@ class ProductFlatRepository extends Repository
|
|||
|
||||
return $productCategoryArrributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* get Filterable Attributes.
|
||||
*
|
||||
* @param array $category
|
||||
* @param array $products
|
||||
* @return collection
|
||||
*/
|
||||
public function getFilterableAttributes($category, $products) {
|
||||
$filterAttributes = [];
|
||||
|
||||
if (count($category->filterableAttributes) > 0 && count($products)) {
|
||||
$filterAttributes = $category->filterableAttributes;
|
||||
} else {
|
||||
$categoryProductAttributes = $this->getCategoryProductAttribute($category->id);
|
||||
|
||||
if ($categoryProductAttributes) {
|
||||
foreach (app('Webkul\Attribute\Repositories\AttributeRepository')->getFilterAttributes() as $filterAttribute) {
|
||||
if (in_array($filterAttribute->id, $categoryProductAttributes)) {
|
||||
$filterAttributes[] = $filterAttribute;
|
||||
} else if ($filterAttribute ['code'] == 'price') {
|
||||
$filterAttributes[] = $filterAttribute;
|
||||
}
|
||||
}
|
||||
|
||||
$filterAttributes = collect($filterAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
return $filterAttributes;
|
||||
}
|
||||
}
|
||||
|
|
@ -523,7 +523,7 @@ class Configurable extends AbstractType
|
|||
if ($price == $item->base_price)
|
||||
return;
|
||||
|
||||
$item->base_price = $total;
|
||||
$item->base_price = $price;
|
||||
$item->price = core()->convertPrice($price);
|
||||
|
||||
$item->base_total = $price * $item->quantity;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@
|
|||
"ez-plus": "^1.2.1",
|
||||
"vee-validate": "^2.2.15",
|
||||
"vue-flatpickr": "^2.3.0",
|
||||
"vue-slider-component": "^2.7.5"
|
||||
"vue-slider-component": "^3.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -39,3 +39,9 @@
|
|||
*
|
||||
* Date: 2019-05-01T21:04Z
|
||||
*/
|
||||
|
||||
/**
|
||||
* vue-class-component v7.0.1
|
||||
* (c) 2015-present Evan You
|
||||
* @license MIT
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/shop.js": "/js/shop.js?id=6d8ea335fbfa47e80e72",
|
||||
"/css/shop.css": "/css/shop.css?id=66ee90f14efb050a20e5"
|
||||
"/js/shop.js": "/js/shop.js?id=d6e76f2c8f75d4217522",
|
||||
"/css/shop.css": "/css/shop.css?id=3e715efc0eb756fd1e79"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace Webkul\Shop\Http\Controllers;
|
|||
use Webkul\Customer\Repositories\WishlistRepository;
|
||||
use Webkul\Product\Repositories\ProductRepository;
|
||||
use Webkul\Checkout\Contracts\Cart as CartModel;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Cart;
|
||||
|
||||
/**
|
||||
|
|
@ -85,8 +86,10 @@ class CartController extends Controller
|
|||
if ($customer = auth()->guard('customer')->user())
|
||||
$this->wishlistRepository->deleteWhere(['product_id' => $id, 'customer_id' => $customer->id]);
|
||||
|
||||
if (request()->get('is_buy_now'))
|
||||
if (request()->get('is_buy_now')) {
|
||||
Event::dispatch('shop.item.buy-now', $id);
|
||||
return redirect()->route('shop.checkout.onepage.index');
|
||||
}
|
||||
}
|
||||
} catch(\Exception $e) {
|
||||
session()->flash('error', trans($e->getMessage()));
|
||||
|
|
@ -214,4 +217,4 @@ class CartController extends Controller
|
|||
private function onWarningAddingToCart($result): bool {
|
||||
return is_array($result) && isset($result['warning']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ $shadow-color: #ccc;
|
|||
$shadow-color1: #cccccc;
|
||||
$outline-hvr: #eaeaec;
|
||||
$review-details: #5e5e5e;
|
||||
$slider-color: rgb(255, 100, 114);
|
||||
//shop variables ends here
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -2156,6 +2156,56 @@ section.product-detail {
|
|||
}
|
||||
}
|
||||
|
||||
.vue-slider {
|
||||
.vue-slider-rail {
|
||||
background-color: #ccc;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.vue-slider-dot-handle {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
background-color: $btn-background-color;
|
||||
box-shadow: 0.5px 0.5px 2px 1px rgba(0,0,0,.32);
|
||||
}
|
||||
|
||||
.vue-slider-dot-tooltip-inner {
|
||||
border-color: $slider-color !important;
|
||||
background-color: $slider-color !important;
|
||||
}
|
||||
|
||||
.vue-slider-dot-tooltip-text {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
min-width: 20px;
|
||||
padding: 2px 5px;
|
||||
text-align: center;
|
||||
border-radius: 5px;
|
||||
white-space: nowrap;
|
||||
color: $btn-background-color;
|
||||
border-color: $slider-color !important;
|
||||
background-color: $slider-color !important;
|
||||
}
|
||||
|
||||
.vue-slider-dot-tooltip-text::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: -10px;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 5px solid transparent;
|
||||
border: 6px solid transparent\0;
|
||||
border-top-color: inherit;
|
||||
transform: translate(-50%);
|
||||
}
|
||||
|
||||
.vue-slider-process {
|
||||
background-color: $slider-color !important;
|
||||
}
|
||||
}
|
||||
|
||||
// product pages responsive css start here
|
||||
@media only screen and (max-width: 720px) {
|
||||
section.product-detail div.layouter .form-container {
|
||||
|
|
|
|||
|
|
@ -404,10 +404,12 @@
|
|||
|
||||
newBillingAddress: function() {
|
||||
this.new_billing_address = true;
|
||||
this.address.billing.address_id = null;
|
||||
},
|
||||
|
||||
newShippingAddress: function() {
|
||||
this.new_shipping_address = true;
|
||||
this.address.shipping.address_id = null;
|
||||
},
|
||||
|
||||
backToSavedBillingAddress: function() {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
</li>
|
||||
|
||||
<li class="mb-15">
|
||||
@{{ addresses.country }}.
|
||||
@{{ addresses.country }} @{{ addresses.postcode }}
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -10,26 +10,22 @@
|
|||
if (isset($category)) {
|
||||
$products = $productRepository->getAll($category->id);
|
||||
|
||||
if (count($category->filterableAttributes) > 0 && count($products)) {
|
||||
$filterAttributes = $category->filterableAttributes;
|
||||
} else {
|
||||
$categoryProductAttributes = $productFlatRepository->getCategoryProductAttribute($category->id);
|
||||
|
||||
if ($categoryProductAttributes) {
|
||||
foreach ($attributeRepository->getFilterAttributes() as $filterAttribute) {
|
||||
if (in_array($filterAttribute->id, $categoryProductAttributes)) {
|
||||
$filterAttributes[] = $filterAttribute;
|
||||
} else if ($filterAttribute ['code'] == 'price') {
|
||||
$filterAttributes[] = $filterAttribute;
|
||||
}
|
||||
}
|
||||
|
||||
$filterAttributes = collect($filterAttributes);
|
||||
}
|
||||
}
|
||||
$filterAttributes = $productFlatRepository->getFilterableAttributes($category, $products);
|
||||
} else {
|
||||
$filterAttributes = $attributeRepository->getFilterAttributes();
|
||||
}
|
||||
|
||||
foreach ($filterAttributes as $attribute) {
|
||||
if ($attribute->code <> 'price') {
|
||||
if (! $attribute->options->isEmpty()) {
|
||||
$attributes[] = $attribute;
|
||||
}
|
||||
} else {
|
||||
$attributes[] = $attribute;
|
||||
}
|
||||
}
|
||||
|
||||
$filterAttributes = collect($attributes);
|
||||
?>
|
||||
|
||||
<div class="layered-filter-wrapper">
|
||||
|
|
@ -99,7 +95,7 @@
|
|||
:tooltip-style="sliderConfig.tooltipStyle"
|
||||
:max="sliderConfig.max"
|
||||
:lazy="true"
|
||||
@callback="priceRangeUpdated($event)"
|
||||
@change="priceRangeUpdated($event)"
|
||||
></vue-slider>
|
||||
</div>
|
||||
|
||||
|
|
@ -116,7 +112,7 @@
|
|||
data: function() {
|
||||
return {
|
||||
attributes: @json($filterAttributes),
|
||||
|
||||
|
||||
appliedFilters: {}
|
||||
}
|
||||
},
|
||||
|
|
@ -187,7 +183,7 @@
|
|||
|
||||
created: function () {
|
||||
if (!this.index)
|
||||
this.active = false;
|
||||
this.active = true;
|
||||
|
||||
if (this.appliedFilterValues && this.appliedFilterValues.length) {
|
||||
this.appliedFilters = this.appliedFilterValues;
|
||||
|
|
|
|||
|
|
@ -189,9 +189,15 @@
|
|||
|
||||
computed: {
|
||||
product_qty: function() {
|
||||
return this.option.products[this.selected_product]
|
||||
? this.option.products[this.selected_product].qty
|
||||
: 0;
|
||||
var self = this;
|
||||
self.qty = 0;
|
||||
|
||||
self.option.products.forEach(function(product, key){
|
||||
if (self.selected_product == product.id)
|
||||
self.qty = self.option.products[key].qty;
|
||||
});
|
||||
|
||||
return self.qty;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 92 KiB |
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"/js/velocity.js": "/js/velocity.js?id=384363a24374735154d8",
|
||||
"/js/velocity.js": "/js/velocity.js?id=4498d2677a567dff96c5",
|
||||
"/css/velocity-admin.css": "/css/velocity-admin.css?id=612d35e452446366eef7",
|
||||
"/css/velocity.css": "/css/velocity.css?id=ad57fd83b1d077b91c24"
|
||||
"/css/velocity.css": "/css/velocity.css?id=5aefe68c7e428dc9597a"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@ return [
|
|||
'route' => 'velocity.admin.content.index',
|
||||
'sort' => 5,
|
||||
'icon-class' => 'velocity-icon',
|
||||
], [
|
||||
'key' => 'velocity.header',
|
||||
'name' => 'velocity::app.admin.layouts.header-content',
|
||||
'route' => 'velocity.admin.content.index',
|
||||
'sort' => 1,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'velocity.meta-data',
|
||||
'name' => 'velocity::app.admin.layouts.meta-data',
|
||||
'route' => 'velocity.admin.meta-data',
|
||||
'sort' => 1,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'velocity.header',
|
||||
'name' => 'velocity::app.admin.layouts.header-content',
|
||||
'route' => 'velocity.admin.content.index',
|
||||
'sort' => 2,
|
||||
'icon-class' => '',
|
||||
]
|
||||
],
|
||||
];
|
||||
|
|
@ -82,6 +82,7 @@ use Webkul\Velocity\Repositories\Product\ProductRepository as VelocityProductRep
|
|||
if ($product) {
|
||||
$productReviewHelper = app('Webkul\Product\Helpers\Review');
|
||||
$productImageHelper = app('Webkul\Product\Helpers\ProductImage');
|
||||
$galleryImages = $productImageHelper->getProductBaseImage($product);
|
||||
|
||||
$response = [
|
||||
'status' => true,
|
||||
|
|
@ -91,7 +92,7 @@ use Webkul\Velocity\Repositories\Product\ProductRepository as VelocityProductRep
|
|||
'priceHTML' => $product->getTypeInstance()->getPriceHtml(),
|
||||
'totalReviews' => $productReviewHelper->getTotalReviews($product),
|
||||
'rating' => ceil($productReviewHelper->getAverageRating($product)),
|
||||
'image' => $productImageHelper->getProductBaseImage($product)['small_image_url'],
|
||||
'image' => $galleryImages['small_image_url'],
|
||||
]
|
||||
];
|
||||
} else {
|
||||
|
|
@ -213,16 +214,24 @@ use Webkul\Velocity\Repositories\Product\ProductRepository as VelocityProductRep
|
|||
private function formatProduct($product, $list = false)
|
||||
{
|
||||
$reviewHelper = app('Webkul\Product\Helpers\Review');
|
||||
$productImageHelper = app('Webkul\Product\Helpers\ProductImage');
|
||||
|
||||
$totalReviews = $reviewHelper->getTotalReviews($product);
|
||||
|
||||
$avgRatings = ceil($reviewHelper->getAverageRating($product));
|
||||
$productImage = app('Webkul\Product\Helpers\ProductImage')->getProductBaseImage($product)['medium_image_url'];
|
||||
|
||||
$galleryImages = $productImageHelper->getGalleryImages($product);
|
||||
$productImage = $productImageHelper->getProductBaseImage($product)['medium_image_url'];
|
||||
|
||||
return [
|
||||
'name' => $product->name,
|
||||
'image' => $productImage,
|
||||
'slug' => $product->url_key,
|
||||
'image' => $productImage,
|
||||
'description' => $product->description,
|
||||
'shortDescription' => $product->meta_description,
|
||||
'galleryImages' => $galleryImages,
|
||||
'priceHTML' => view('shop::products.price', ['product' => $product])->render(),
|
||||
'totalReviews' => trans('velocity::app.products.ratings', [ 'totalRatings' => $totalReviews]),
|
||||
'totalReviews' => $totalReviews,
|
||||
'avgRating' => $avgRatings,
|
||||
'firstReviewText' => trans('velocity::app.products.be-first-review'),
|
||||
'addToCartHtml' => view('shop::products.add-to-cart', [
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
<template>
|
||||
<div class="row flex-nowrap" :class="rowClass">
|
||||
|
||||
<product-quick-view v-if="quickViewDetails" :quick-view-details="quickViewDetails"></product-quick-view>
|
||||
<!-- <product-quick-view
|
||||
v-if="quickViewDetails"
|
||||
:quick-view-details="quickViewDetails">
|
||||
</product-quick-view> -->
|
||||
|
||||
<div class="col-2 lg-card-container" v-for="(card, index) in cardDetails" :key="index">
|
||||
<div @click="redirect(card.route)" class="card padding-10">
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
class="card-img-top lzy_img" />
|
||||
<!-- :src="`${$root.baseUrl}/vendor/webkul/ui/assets/images/product/meduim-product-placeholder.png`" /> -->
|
||||
|
||||
<!-- <quick-view-btn details="{{ $product }}"></quick-view-btn> -->
|
||||
<product-quick-view-btn :quick-view-details="product"></product-quick-view-btn>
|
||||
</a>
|
||||
|
||||
<div class="card-body">
|
||||
|
|
@ -58,7 +58,9 @@
|
|||
|
||||
<div class="product-rating col-12 no-padding" v-if="product.totalReviews && product.totalReviews > 0">
|
||||
<star-ratings :ratings="product.avgRating"></star-ratings>
|
||||
<span class="align-top">{{ product.totalReviews }} Ratings</span>
|
||||
<a class="fs14 align-top unset active-hover" :href="`${$root.baseUrl}/reviews/${product.slug}`">
|
||||
{{ __('products.reviews-count', {'totalReviews': product.totalReviews}) }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="product-rating col-12 no-padding" v-else>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
<template>
|
||||
<div
|
||||
id="quick-view-btn-container"
|
||||
class="quick-view-btn-container"
|
||||
@click="openQuickView({event: $event})">
|
||||
|
||||
<span class="rango-zoom-plus"></span>
|
||||
|
||||
<button type="button">{{ __('products.quick-view') }}</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script type="text/javascript">
|
||||
export default {
|
||||
props: ['quickViewDetails'],
|
||||
|
||||
methods: {
|
||||
openQuickView: function ({event}) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
this.$root.quickView = true;
|
||||
this.$root.productDetails = this.quickViewDetails;
|
||||
|
||||
$('body').toggleClass('overflow-hidden');
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
<template>
|
||||
<div class="modal-parent scrollable">
|
||||
<div class="cd-quick-view">
|
||||
<template v-if="showProductDetails || true">
|
||||
<div class="col-lg-6 product-gallery">
|
||||
<ul class="cd-slider" type="none">
|
||||
<carousel-component
|
||||
slides-per-page="1"
|
||||
navigation-enabled="hide"
|
||||
:slides-count="product.galleryImages.length">
|
||||
|
||||
<slide
|
||||
:key="index"
|
||||
:slot="`slide-${index}`"
|
||||
v-for="(image, index) in product.galleryImages">
|
||||
|
||||
<li class="selected" @click="showProductDetails = false">
|
||||
<img :src="image.medium_image_url" :alt="product.name" />
|
||||
</li>
|
||||
</slide>
|
||||
</carousel-component>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 fs16">
|
||||
<h2 class="fw6 quick-view-name">{{ product.name }}</h2>
|
||||
|
||||
<div class="product-price" v-html="product.priceHTML"></div>
|
||||
|
||||
<div
|
||||
class="product-rating"
|
||||
v-if="product.totalReviews && product.totalReviews > 0">
|
||||
|
||||
<star-ratings :ratings="product.avgRating"></star-ratings>
|
||||
<a class="pl10 unset active-hover" :href="`${$root.baseUrl}/reviews/${product.slug}`">
|
||||
{{ __('products.reviews-count', {'totalReviews': product.totalReviews}) }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="product-rating" v-else>
|
||||
<span class="fs14" v-text="product.firstReviewText"></span>
|
||||
</div>
|
||||
|
||||
<p class="pt14 fs14 description-text" v-html="product.shortDescription"></p>
|
||||
|
||||
<vnode-injector :nodes="getAddToCartHtml()"></vnode-injector>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@click="closeQuickView"
|
||||
class="close-btn rango-close fs18 cursor-pointer">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<div class="product-gallery">
|
||||
<ul class="cd-slider" type="none">
|
||||
<carousel-component
|
||||
slides-per-page="1"
|
||||
navigation-enabled="hide"
|
||||
:slides-count="product.galleryImages.length">
|
||||
|
||||
<slide
|
||||
:key="index"
|
||||
:slot="`slide-${index}`"
|
||||
v-for="(image, index) in product.galleryImages">
|
||||
|
||||
<li class="selected">
|
||||
<img :src="image.medium_image_url" :alt="product.name" />
|
||||
</li>
|
||||
</slide>
|
||||
</carousel-component>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@click="showProductDetails = true"
|
||||
class="close-btn rango-close fs18 cursor-pointer">
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script type="text/javascript">
|
||||
export default {
|
||||
data: function () {
|
||||
return {
|
||||
currentlyActiveImage: 0,
|
||||
showProductDetails: true,
|
||||
product: this.$root.productDetails,
|
||||
}
|
||||
},
|
||||
|
||||
mounted: function () {
|
||||
// console.log(this.quickViewDetails, this.quickView);
|
||||
},
|
||||
|
||||
methods: {
|
||||
closeQuickView: function () {
|
||||
this.$root.quickView = false;
|
||||
this.$root.productDetails = [];
|
||||
$('body').toggleClass('overflow-hidden');
|
||||
},
|
||||
|
||||
changeImage: function (imageIndex) {
|
||||
this.currentlyActiveImage = imageIndex;
|
||||
},
|
||||
|
||||
getAddToCartHtml: function () {
|
||||
const { render, staticRenderFns } = Vue.compile(this.product.addToCartHtml);
|
||||
const _staticRenderFns = this.$options.staticRenderFns = staticRenderFns;
|
||||
|
||||
try {
|
||||
var output = render.call(this, this.$createElement)
|
||||
} catch (exception) {
|
||||
console.log("something went wrong");
|
||||
}
|
||||
|
||||
this.$options.staticRenderFns = _staticRenderFns
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -3,7 +3,7 @@ module.exports = {
|
|||
/**
|
||||
* Translate the given key.
|
||||
*/
|
||||
__(key) {
|
||||
__(key, params) {
|
||||
let splitedKey = key.split('.');
|
||||
let translation = window._translations;
|
||||
|
||||
|
|
@ -11,6 +11,13 @@ module.exports = {
|
|||
translation = translation[key];
|
||||
});
|
||||
|
||||
if (params) {
|
||||
Object.keys(params).forEach(key => {
|
||||
let value = params[key];
|
||||
translation = translation.replace(`:${key}`, value);
|
||||
});
|
||||
}
|
||||
|
||||
return translation
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -39,10 +39,11 @@ Vue.component("product-card", require("./UI/components/product-card"));
|
|||
Vue.component("wishlist-component", require("./UI/components/wishlist"));
|
||||
Vue.component('carousel-component', require('./UI/components/carousel'));
|
||||
Vue.component('child-sidebar', require('./UI/components/child-sidebar'));
|
||||
Vue.component('card-list-content', require('./UI/components/card-list'));
|
||||
Vue.component('card-list-header', require('./UI/components/card-header'));
|
||||
Vue.component('magnify-image', require('./UI/components/image-magnifier'));
|
||||
Vue.component('responsive-sidebar', require('./UI/components/responsive-sidebar'));
|
||||
Vue.component('product-quick-view', require('./UI/components/product-quick-view'));
|
||||
Vue.component('product-quick-view-btn', require('./UI/components/product-quick-view-btn'));
|
||||
|
||||
window.eventBus = new Vue();
|
||||
|
||||
|
|
@ -163,6 +164,8 @@ $(document).ready(function () {
|
|||
data: function () {
|
||||
return {
|
||||
modalIds: {},
|
||||
quickView: false,
|
||||
productDetails: [],
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@
|
|||
|
||||
.product-card-new:hover {
|
||||
#quick-view-btn-container {
|
||||
// display: block;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -588,15 +588,14 @@ body::after {
|
|||
}
|
||||
|
||||
.cd-quick-view {
|
||||
top: 50px;
|
||||
left: 22%;
|
||||
width: 734px;
|
||||
z-index: 11;
|
||||
top: 100px;
|
||||
width: 700px;
|
||||
z-index: 101;
|
||||
padding: 40px;
|
||||
display: block;
|
||||
position: fixed;
|
||||
max-width: 900px;
|
||||
max-height: 1000px;
|
||||
position: absolute;
|
||||
margin-bottom: 50px;
|
||||
left: calc(50% - 350px);
|
||||
background-color: #fff;
|
||||
// transition: box-shadow .3s;
|
||||
// -moz-transition: box-shadow .3s;
|
||||
|
|
@ -609,8 +608,8 @@ body::after {
|
|||
-webkit-backface-visibility: hidden;
|
||||
|
||||
.cd-slider li.selected img {
|
||||
width: 317px;
|
||||
height: 397px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: inline-block !important;
|
||||
}
|
||||
|
||||
|
|
@ -619,8 +618,9 @@ body::after {
|
|||
}
|
||||
|
||||
.close-btn {
|
||||
top: -25px;
|
||||
right: -15px;
|
||||
top: 15px;
|
||||
right: 20px;
|
||||
font-weight: 600;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
|
@ -633,6 +633,68 @@ body::after {
|
|||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.product-price {
|
||||
span:nth-child(1),
|
||||
.special-price,
|
||||
.price-from > span:not(:nth-child(2)) {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.wishlist-icon {
|
||||
height: 38px;
|
||||
display: table;
|
||||
margin-left: 10px;
|
||||
|
||||
i {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
.quick-view-name {
|
||||
font-size: 24px;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.product-price {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.product-rating {
|
||||
display: table;
|
||||
margin: 10px 0;
|
||||
|
||||
a,
|
||||
span {
|
||||
vertical-align: top;
|
||||
display: table-cell;
|
||||
}
|
||||
}
|
||||
|
||||
.product-gallery {
|
||||
top: 10px;
|
||||
position: sticky;
|
||||
|
||||
.VueCarousel-pagination {
|
||||
button {
|
||||
padding: 0px !important;
|
||||
margin: 3px !important;
|
||||
border: 1px solid $border-dark !important;
|
||||
background-color: $white-color !important;
|
||||
|
||||
&.VueCarousel-dot--active {
|
||||
background-color: $border-dark !important;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
|
|
|
|||
|
|
@ -6,13 +6,14 @@
|
|||
|
||||
.magnifier {
|
||||
> img {
|
||||
height: 450px;
|
||||
min-height: 450px;
|
||||
max-height: 530px;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
}
|
||||
|
||||
.right {
|
||||
|
|
@ -198,6 +199,7 @@
|
|||
right: 0;
|
||||
left: unset;
|
||||
line-height: 13rem;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -675,6 +675,13 @@ a {
|
|||
&.remove-decoration:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&.active-hover {
|
||||
&:hover {
|
||||
color: $link-color !important;
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-icon::after {
|
||||
|
|
@ -847,18 +854,6 @@ button[disabled] {
|
|||
font-family: 'Webkul Rango' !important;
|
||||
}
|
||||
|
||||
.quick-view-name {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.quick-view-price {
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.description-text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.max-height-350 {
|
||||
max-height: 350px;
|
||||
}
|
||||
|
|
@ -873,4 +868,12 @@ button[disabled] {
|
|||
textarea {
|
||||
border-color: $border-danger !important;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-parent {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 5000;
|
||||
position: fixed;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
|
@ -77,6 +77,7 @@ return [
|
|||
'more-infomation' => 'معلومات اكثر',
|
||||
'short-description' => 'أوصاف قصيرة',
|
||||
'ratings' => ':totalRatings تصنيفات',
|
||||
'reviews-count' => ':totalReviews التعليقات',
|
||||
'write-your-review' => 'اكتب مراجعتك',
|
||||
'be-first-review' => 'كن أول من يكتب نقد',
|
||||
'view-all-reviews' => 'عرض جميع التقييمات',
|
||||
|
|
|
|||
|
|
@ -220,13 +220,14 @@ return [
|
|||
'products' => [
|
||||
'text' => 'Products',
|
||||
'details' => 'Details',
|
||||
'reviews' => 'Reviews',
|
||||
'reviews-title' => 'Reviews',
|
||||
'reviewed' => 'Reviewed',
|
||||
'review-by' => 'Review by',
|
||||
'quick-view' => 'Quick View',
|
||||
'not-available' => 'Not Available',
|
||||
'submit-review' => 'Submit Review',
|
||||
'ratings' => ':totalRatings Ratings',
|
||||
'reviews-count' => ':totalReviews Reviews',
|
||||
'customer-rating' => 'Customer Rating',
|
||||
'more-infomation' => 'More Information',
|
||||
'view-all-reviews' => 'View All Reviews',
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ return [
|
|||
'submit-review' => 'Enviar revisão',
|
||||
'not-available' => 'Não disponível',
|
||||
'ratings' => ':totalRatings Avaliações',
|
||||
'reviews-count' => ':totalReviews Avaliações',
|
||||
'more-infomation' => 'Mais Informações',
|
||||
'short-description' => 'Descrições breves',
|
||||
'customer-rating' => 'Avaliação do cliente',
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<accordian :title="'{{ __('admin::app.catalog.attributes.general') }}'" :active="false">
|
||||
<accordian :title="'{{ __('admin::app.catalog.attributes.general') }}'" :active="true">
|
||||
<div slot="body">
|
||||
<div class="control-group">
|
||||
<label>{{ __('velocity::app.admin.meta-data.activate-slider') }}</label>
|
||||
|
|
|
|||
|
|
@ -1,147 +0,0 @@
|
|||
@inject ('productImageHelper', 'Webkul\Product\Helpers\ProductImage')
|
||||
@inject ('reviewHelper', 'Webkul\Product\Helpers\Review')
|
||||
|
||||
@php
|
||||
$productBaseImage = $productImageHelper->getProductBaseImage($product);
|
||||
$productPrice = $product->getTypeInstance()->getProductPrices();
|
||||
$totalReviews = $product->reviews;
|
||||
$avgRatings = ceil($reviewHelper->getAverageRating($product));
|
||||
|
||||
// @TODO
|
||||
// foreach ($totalReviews as $review) {
|
||||
// $productReview = $review;
|
||||
// }
|
||||
@endphp
|
||||
|
||||
<script type="text/x-template" id="quick-view-btn-template">
|
||||
|
||||
<div
|
||||
class="quick-view-btn-container"
|
||||
id="quick-view-btn-container"
|
||||
:name="details"
|
||||
@click="openQuickView({details: details, event: $event})">
|
||||
<product-quick-view v-if="quickViewDetails" :quick-view-details="quickViewDetails"></product-quick-view>
|
||||
|
||||
<span class="rango-zoom-plus"></span>
|
||||
|
||||
<button type="button">Quick View</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-template" id="product-quick-view-template">
|
||||
<div class="cd-quick-view" v-if="quickView">
|
||||
<div class="col-lg-6 cd-slider-wrapper model-animation">
|
||||
<ul class="cd-slider" type="none">
|
||||
<li class="selected">
|
||||
<img src="{{ $productBaseImage['medium_image_url'] }}" :alt="quickViewDetails.name" />
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul type="square" class="circle-list">
|
||||
<li
|
||||
v-for="index in {{ sizeof($productBaseImage) }}"
|
||||
:class="`circle ${(index - 1 == currentlyActiveImage) ? '' : 'fill'}`"
|
||||
@click="changeImage(index - 1)"
|
||||
></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 cd-item-info fs16">
|
||||
<h2 class="text-nowrap fw6 quick-view-name">{{ $product->name }}</h2>
|
||||
|
||||
<div class="product-price fs14">
|
||||
<h2 class="text-nowrap fw6 quick-view-price">{{ $product->price }}</h2>
|
||||
</div>
|
||||
|
||||
{{-- @TODO --}}
|
||||
{{-- @if ($totalReviews)
|
||||
<div class="">
|
||||
{{ $productReview['rating'] }} Ratings
|
||||
</div>
|
||||
@else
|
||||
<div class="">
|
||||
<a href="">{{ __('velocity::app.products.be-first-review') }}</a>
|
||||
</div>
|
||||
@endif --}}
|
||||
|
||||
<p class="pt14 description-text">
|
||||
{!! $product->description !!}
|
||||
</p>
|
||||
<button type="submit" class="btn btn-add-to-cart quick-addtocart-btn">
|
||||
<span class="rango-cart-1 fs20"></span>
|
||||
Add To Cart
|
||||
</button>
|
||||
|
||||
<div class="action-buttons">
|
||||
<div style="display: inline-block;" class="rango-exchange fs24"></div>
|
||||
<div style="display: inline-block;" class="rango-heart fs24"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="close-btn rango-close fs18 cursor-pointer" @click="closeQuickView"></div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
(() => {
|
||||
Vue.component('quick-view-btn', {
|
||||
props: ['details'],
|
||||
template: '#quick-view-btn-template',
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
quickViewDetails: false,
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
openQuickView: function ({details, event}) {
|
||||
document.getElementById('quick-view-btn-container').style.display = "block";
|
||||
if (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
this.quickViewDetails = true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Vue.component('product-quick-view', {
|
||||
template: '#product-quick-view-template',
|
||||
props: ['quickViewDetails'],
|
||||
|
||||
data: function () {
|
||||
// backgroud blur
|
||||
|
||||
let body = $('body');
|
||||
return {
|
||||
body: body,
|
||||
currentlyActiveImage: 0,
|
||||
quickView: this.quickViewDetails ? true : false,
|
||||
}
|
||||
},
|
||||
|
||||
mounted: function () {
|
||||
// console.log(this.quickViewDetails, this.quickView);
|
||||
},
|
||||
|
||||
methods: {
|
||||
closeQuickView: function () {
|
||||
this.quickView = false;
|
||||
this.quickViewDetails = false;
|
||||
document.getElementById('quick-view-btn-container').style.display = "none";
|
||||
window.location.reload();
|
||||
|
||||
},
|
||||
|
||||
changeImage: function (imageIndex) {
|
||||
this.currentlyActiveImage = imageIndex;
|
||||
}
|
||||
}
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endpush
|
||||
|
|
@ -87,13 +87,16 @@
|
|||
</div>
|
||||
|
||||
@if (isset($item->additional['attributes']))
|
||||
<div class="row col-12 no-padding no-margin">
|
||||
|
||||
@foreach ($item->additional['attributes'] as $attribute)
|
||||
<b>{{ $attribute['attribute_name'] }} : </b>{{ $attribute['option_label'] }}</br>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
@foreach ($item->additional['attributes'] as $attribute)
|
||||
<div class="row col-12 no-padding no-margin display-block">
|
||||
<label class="no-margin">
|
||||
{{ $attribute['attribute_name'] }} :
|
||||
</label>
|
||||
<span>
|
||||
{{ $attribute['option_label'] }}
|
||||
</span>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<div class="row col-12 no-padding no-margin">
|
||||
|
|
@ -149,7 +152,7 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="product-quantity col-3 no-padding">
|
||||
<quantity-changer
|
||||
:control-name="'qty[{{$item->id}}]'"
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@
|
|||
newBillingAddress: function() {
|
||||
this.new_billing_address = true;
|
||||
this.isPlaceOrderEnabled = false;
|
||||
this.address.shipping.address_id = null;
|
||||
this.address.billing.address_id = null;
|
||||
},
|
||||
|
||||
newShippingAddress: function() {
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@
|
|||
<div id="app">
|
||||
{{-- <responsive-sidebar v-html="responsiveSidebarTemplate"></responsive-sidebar> --}}
|
||||
|
||||
<product-quick-view v-if="$root.quickView"></product-quick-view>
|
||||
|
||||
<div class="main-container-wrapper">
|
||||
|
||||
@section('body-header')
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
@inject ('productImageHelper', 'Webkul\Product\Helpers\ProductImage')
|
||||
@inject ('reviewHelper', 'Webkul\Product\Helpers\Review')
|
||||
@inject ('toolbarHelper', 'Webkul\Product\Helpers\Toolbar')
|
||||
{{-- @include('shop::UI.product-quick-view') --}}
|
||||
{{-- @include('shop::UI.product-quick-view') --}}
|
||||
|
||||
@push('css')
|
||||
<style type="text/css">
|
||||
.list-card .wishlist-icon i {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
|
||||
.product-price span:first-child, .product-price span:last-child {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
|
|
|
|||
|
|
@ -8,26 +8,22 @@
|
|||
if (isset($category)) {
|
||||
$products = $productRepository->getAll($category->id);
|
||||
|
||||
if (count($category->filterableAttributes) > 0 && count($products)) {
|
||||
$filterAttributes = $category->filterableAttributes;
|
||||
} else {
|
||||
$categoryProductAttributes = $productFlatRepository->getCategoryProductAttribute($category->id);
|
||||
|
||||
if ($categoryProductAttributes) {
|
||||
foreach ($attributeRepository->getFilterAttributes() as $filterAttribute) {
|
||||
if (in_array($filterAttribute->id, $categoryProductAttributes)) {
|
||||
$filterAttributes[] = $filterAttribute;
|
||||
} else if ($filterAttribute ['code'] == 'price') {
|
||||
$filterAttributes[] = $filterAttribute;
|
||||
}
|
||||
}
|
||||
|
||||
$filterAttributes = collect($filterAttributes);
|
||||
}
|
||||
}
|
||||
$filterAttributes = $productFlatRepository->getFilterableAttributes($category, $products);
|
||||
} else {
|
||||
$filterAttributes = $attributeRepository->getFilterAttributes();
|
||||
}
|
||||
|
||||
foreach ($filterAttributes as $attribute) {
|
||||
if ($attribute->code <> 'price') {
|
||||
if (! $attribute->options->isEmpty()) {
|
||||
$attributes[] = $attribute;
|
||||
}
|
||||
} else {
|
||||
$attributes[] = $attribute;
|
||||
}
|
||||
}
|
||||
|
||||
$filterAttributes = collect($attributes);
|
||||
?>
|
||||
|
||||
<div class="layered-filter-wrapper left">
|
||||
|
|
@ -42,7 +38,7 @@
|
|||
|
||||
@push('scripts')
|
||||
<script type="text/x-template" id="layered-navigation-template">
|
||||
<div>
|
||||
<div v-if="attributes.length > 0">
|
||||
|
||||
<h3 class="filter-title fw6 mb20">
|
||||
{{ __('shop::app.products.layered-nav-title') }}
|
||||
|
|
@ -183,25 +179,28 @@
|
|||
],
|
||||
|
||||
data: function() {
|
||||
let maxPrice = '{{ core()->convertPrice($productFlatRepository->getCategoryProductMaximumPrice($category)) }}';
|
||||
|
||||
maxPrice = (maxPrice !== '') ? parseInt(maxPrice) : 0;
|
||||
|
||||
return {
|
||||
active: false,
|
||||
appliedFilters: [],
|
||||
sliderConfig: {
|
||||
value: [
|
||||
0,
|
||||
0
|
||||
],
|
||||
max: {{ core()->convertPrice($productFlatRepository->getCategoryProductMaximumPrice($category)) }},
|
||||
max: maxPrice,
|
||||
value: [ 0, 0 ],
|
||||
|
||||
processStyle: {
|
||||
"backgroundColor": "#FF6472"
|
||||
},
|
||||
|
||||
tooltipStyle: {
|
||||
"borderColor": "#FF6472",
|
||||
"backgroundColor": "#FF6472",
|
||||
"borderColor": "#FF6472"
|
||||
},
|
||||
priceFrom: 0,
|
||||
|
||||
priceTo: 0,
|
||||
priceFrom: 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -44,8 +44,6 @@
|
|||
push-class="display-inbl"
|
||||
:ratings="product.rating">
|
||||
</star-ratings>
|
||||
|
||||
<span class="fs16 text-nowrap align-text-bottom" v-if="product.rating > 0">@{{ product.totalReviews }} {{ __('velocity::app.products.reviews') }}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@
|
|||
{{-- customer reviews --}}
|
||||
<div slot="header" class="col-lg-12 no-padding">
|
||||
<h3 class="display-inbl">
|
||||
{{ __('velocity::app.products.reviews') }}
|
||||
{{ __('velocity::app.products.reviews-title') }}
|
||||
</h3>
|
||||
|
||||
<i class="rango-arrow"></i>
|
||||
|
|
@ -161,7 +161,7 @@
|
|||
</accordian>
|
||||
@else
|
||||
<h3 class="display-inbl mb20 col-lg-12 no-padding">
|
||||
{{ __('velocity::app.products.reviews') }}
|
||||
{{ __('velocity::app.products.reviews-title') }}
|
||||
</h3>
|
||||
|
||||
<div class="customer-reviews">
|
||||
|
|
|
|||
|
|
@ -4,11 +4,17 @@ body {
|
|||
font-family: "Montserrat", sans-serif;
|
||||
color: #000311;
|
||||
text-align: center;
|
||||
background: white;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
a { color: rgb(0, 65, 255); text-decoration: none;}
|
||||
|
||||
.initial-display{
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
.initial-display .logo {
|
||||
width: 150px;
|
||||
}
|
||||
|
|
@ -18,7 +24,7 @@ body {
|
|||
color: #333333;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
margin-top: 50px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.prepare-btn {
|
||||
|
|
@ -34,6 +40,10 @@ body {
|
|||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.warning {
|
||||
margin-left: 15%;
|
||||
}
|
||||
|
||||
.footer {
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
|
|
@ -54,13 +64,76 @@ body {
|
|||
}
|
||||
|
||||
.content {
|
||||
border: 1px solid #979797;
|
||||
border-radius: 3px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 1px 8px 18px rgba(62, 85, 120, 0.45);
|
||||
min-height: 300px;
|
||||
width: 600px;
|
||||
height: 392px;
|
||||
margin-left: calc(50% - 300px);
|
||||
text-align: left;
|
||||
overflow-x: scroll;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.requirements_list {
|
||||
width: 90%;
|
||||
list-style: none;
|
||||
margin-left: 5%;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.requirements_list li {
|
||||
padding: 0 8px 8px;
|
||||
margin-bottom: 8px;
|
||||
border-bottom: 1px dashed #dcdcdc;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.requirements_list li:last-child { border-bottom: 0;}
|
||||
|
||||
.requirements_list small {
|
||||
font-size: 13px;
|
||||
color:#9b9b9b;
|
||||
}
|
||||
|
||||
.content .cp-round {
|
||||
position: auto !important;
|
||||
}
|
||||
|
||||
.content .cp-round:before {
|
||||
border-radius: 50%;
|
||||
content: " ";
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
border-top: solid 6px #bababa;
|
||||
border-right: solid 6px #bababa;
|
||||
border-bottom: solid 6px #bababa;
|
||||
border-left: solid 6px #bababa;
|
||||
position: absolute;
|
||||
top: calc(40% - 14px);
|
||||
left: calc(50% - 24px);
|
||||
}
|
||||
|
||||
.content .cp-round:after {
|
||||
border-radius: 50%;
|
||||
content: " ";
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
border-top: solid 6px #0041FF;
|
||||
border-right: solid 6px #bababa;
|
||||
border-bottom: solid 6px #bababa;
|
||||
border-left: solid 6px #bababa;
|
||||
position: absolute;
|
||||
top: calc(40% - 14px);
|
||||
left: calc(50% - 24px);
|
||||
animation: spin 1s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.title {
|
||||
|
|
@ -70,6 +143,7 @@ body {
|
|||
text-align: left;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
span {
|
||||
|
|
@ -138,46 +212,9 @@ pre.bash {
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
.cp-round:before {
|
||||
border-radius: 50%;
|
||||
content: " ";
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
border-top: solid 6px #bababa;
|
||||
border-right: solid 6px #bababa;
|
||||
border-bottom: solid 6px #bababa;
|
||||
border-left: solid 6px #bababa;
|
||||
position: absolute;
|
||||
top: calc(50% - 24px);
|
||||
left: calc(50% - 24px);
|
||||
}
|
||||
|
||||
.check {
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.cp-round:after {
|
||||
border-radius: 50%;
|
||||
content: " ";
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
border-top: solid 6px #0041FF;
|
||||
border-right: solid 6px #bababa;
|
||||
border-bottom: solid 6px #bababa;
|
||||
border-left: solid 6px #bababa;
|
||||
position: absolute;
|
||||
top: calc(50% - 24px);
|
||||
left: calc(50% - 24px);
|
||||
animation: spin 1s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
line-height: 35px;
|
||||
margin-left: 25%;
|
||||
}
|
||||
|
||||
.composer {
|
||||
|
|
@ -189,3 +226,33 @@ pre.bash {
|
|||
.message {
|
||||
padding-left: 140px;
|
||||
}
|
||||
|
||||
@media (min-width: 1281px) {
|
||||
.content {
|
||||
padding: 2rem 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
max-height: 484px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
|
||||
.initial-display{
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
max-height: 488px;
|
||||
margin: 30px auto;
|
||||
}
|
||||
|
||||
.initial-display p {
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ class Requirement {
|
|||
$data['composer_install'] = 0;
|
||||
} else {
|
||||
$data['composer_install'] = 1;
|
||||
$data['composer'] = 'Composer dependencies is not Installed.Go to root of project, run "composer install" command to install composer dependencies & refresh page again.';
|
||||
$data['composer'] = 'Bagisto has detected that the required composer dependencies are not installed.<br />Go to the root directory of Bagisto and run "composer install".';
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
$data = array();
|
||||
|
||||
$data = array();
|
||||
$data['install'] = 0;
|
||||
|
||||
echo json_encode($data);
|
||||
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
<form action="EnvConfig.php" method="POST" id="environment-form">
|
||||
<div class="content">
|
||||
<div class="databse-error" style="text-align: center; padding-top: 10px" id="database_error">
|
||||
<div class="databse-error" style="text-align: center; padding-top: 5px" id="database_error">
|
||||
</div>
|
||||
<div class="form-container" style="padding: 10%; padding-top: 35px">
|
||||
<div class="form-container" style="padding: 10%; padding-top: 10px">
|
||||
<div class="control-group" id="app_name">
|
||||
<label for="app_name" class="required">App Name</label>
|
||||
<input type = "text" name = "app_name" class = "control"
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
<div class="control-group" id="app_url">
|
||||
<label for="app_url" class="required">App URL</label>
|
||||
<input type="text" name="app_url" class="control"
|
||||
<input type="text" name="app_url" class="control" value="https://<?php echo $_SERVER['HTTP_HOST']; ?>"
|
||||
placeholder="http://localhost"
|
||||
data-validation="required length" data-validation-length="max50">
|
||||
</div>
|
||||
|
|
@ -40,14 +40,13 @@
|
|||
|
||||
<div class="control-group" id="port_name">
|
||||
<label for="port_name" class="required">Database Port</label>
|
||||
<input type="text" name="port_name" class="control"
|
||||
placeholder="3306"
|
||||
<input type="text" name="port_name" class="control" value="3306" placeholder="3306"
|
||||
data-validation="required alphanumeric number length" data-validation-length="max5">
|
||||
</div>
|
||||
|
||||
<div class="control-group" id="host_name">
|
||||
<label for="host_name" class="required">Database Host</label>
|
||||
<input type="text" name="host_name" class="control"
|
||||
<input type="text" name="host_name" class="control" value="127.0.0.1"
|
||||
placeholder="127.0.0.1"
|
||||
data-validation="required length" data-validation-length="max50">
|
||||
</div>
|
||||
|
|
@ -68,7 +67,7 @@
|
|||
|
||||
<div class="control-group" id="user_password">
|
||||
<label for="user_password" class="required">User Password</label>
|
||||
<input type="text" name="user_password" class="control"
|
||||
<input type="password" name="user_password" class="control"
|
||||
placeholder="database password">
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
<div class="content-container" style="padding: 20px">
|
||||
<span>
|
||||
Bagisto is successfully installed on your system.<br>
|
||||
Click the below button to launch Admin Panel.
|
||||
Click the below button to launch the admin panel.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="prepare-btn" onclick="finish()">Finish</button>
|
||||
<button class="prepare-btn" onclick="finish()">Continue</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
var welcomeCheck = document.getElementById('welcome-check');
|
||||
var requirementCheck = document.getElementById('requirement-check');
|
||||
var requirementsRefresh = document.getElementById('requirements-refresh');
|
||||
|
||||
var permisssionCheck = document.getElementById('permission-check');
|
||||
var environmentCheck = document.getElementById('environment-check');
|
||||
var continue_to_admin = document.getElementById('continue');
|
||||
|
|
@ -24,6 +26,10 @@
|
|||
requirementCheck.addEventListener('click', myFunction);
|
||||
}
|
||||
|
||||
if (requirementsRefresh) {
|
||||
requirementsRefresh.addEventListener('click', myFunction);
|
||||
}
|
||||
|
||||
if (welcomeCheck) {
|
||||
welcomeCheck.addEventListener('click', myFunction);
|
||||
}
|
||||
|
|
@ -56,7 +62,6 @@
|
|||
migrationBack.addEventListener('click', myFunction);
|
||||
}
|
||||
|
||||
|
||||
function myFunction() {
|
||||
if(this.id == 'welcome-check') {
|
||||
requirement.style.display = "block";
|
||||
|
|
@ -76,6 +81,8 @@
|
|||
} else if (this.id == 'migration-back') {
|
||||
migration.style.display = "none";
|
||||
environment.style.display ="block";
|
||||
} else if (this.id == 'requirements-refresh') {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,10 +56,8 @@
|
|||
<div class="initial-display">
|
||||
<p>Migration & Seed</p>
|
||||
|
||||
<div class="cp-spinner cp-round" id="loader">
|
||||
</div>
|
||||
|
||||
<div class="content" id="migration-result">
|
||||
<div class="cp-spinner cp-round" id="loader"></div>
|
||||
<div class="window" id="migrate">
|
||||
</div>
|
||||
<div class="window" id="key">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
ini_set('max_execution_time', 300);
|
||||
|
||||
// array to pass back data
|
||||
$data = array();
|
||||
$data = array();
|
||||
|
||||
// run command on terminal
|
||||
$command = 'cd ../.. && php artisan migrate --force';
|
||||
|
|
|
|||
|
|
@ -11,60 +11,57 @@
|
|||
|
||||
<div class="container requirement" id="requirement">
|
||||
<div class="initial-display">
|
||||
<p>Requirements</p>
|
||||
|
||||
<p>Server Requirements</p>
|
||||
<div class="content">
|
||||
<div class="title" style="text-align: center; margin-top: 10px">
|
||||
Please wait while we are checking the requirements
|
||||
</div>
|
||||
<ul class="requirements_list">
|
||||
<li>
|
||||
<?php if($phpVersion['supported'] ? $src = $greenCheck : $src = $redCheck): ?>
|
||||
<img src="<?php echo $src ?>">
|
||||
<?php endif; ?>
|
||||
<span><b>PHP</b></span>
|
||||
<small>(<?php echo $phpVersion['minimum'] ?> or higher)</small>
|
||||
<br>
|
||||
<?php if(!($phpVersion['supported'] == 1)): ?>
|
||||
<small style="color: red;">
|
||||
Bagisto has detected that your PHP version (<?php echo $phpVersion['current']; ?>) is not supported.<br>
|
||||
Contact your provider if you are not the server administrator.
|
||||
</small>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
|
||||
<div class="check" style="margin-left: 25%">
|
||||
<?php if($phpVersion['supported'] ? $src = $greenCheck : $src = $redCheck): ?>
|
||||
<img src="<?php echo $src ?>">
|
||||
<?php endif; ?>
|
||||
<span style="margin-left: 10px"><b>PHP</b></span>
|
||||
<span>(<?php echo $phpVersion['minimum'] ?> or Higher)</span>
|
||||
</div>
|
||||
|
||||
<?php foreach($requirements['requirements'] as $type => $require): ?>
|
||||
|
||||
<?php foreach($requirements['requirements'][$type] as $extention => $enabled) : ?>
|
||||
<div class="check" style="margin-left: 25%">
|
||||
<?php if($enabled ? $src = $greenCheck : $src = $redCheck ): ?>
|
||||
<img src="<?php echo $src ?>">
|
||||
<?php endif; ?>
|
||||
<span style="margin-left: 10px"><b><?php echo $extention ?></b></span>
|
||||
<span>(<?php echo $extention ?> Required)</span>
|
||||
</div>
|
||||
<?php foreach($requirements['requirements'] as $type => $require): ?>
|
||||
<?php foreach($requirements['requirements'][$type] as $extention => $enabled) : ?>
|
||||
<li>
|
||||
<?php if($enabled ? $src = $greenCheck : $src = $redCheck ): ?>
|
||||
<img src="<?php echo $src ?>">
|
||||
<?php endif; ?>
|
||||
<span><b><?php echo $extention ?></b></span>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<php class="check" style="margin-left: 25%">
|
||||
<?php if(($composerInstall['composer_install'] == 0) ? $src = $greenCheck : $src = $redCheck ): ?>
|
||||
<img src="<?php echo $src ?>">
|
||||
<span style="margin-left: 10px"><b>Composer</b></span>
|
||||
<?php endif; ?>
|
||||
</php>
|
||||
|
||||
<div style="margin-left: 30%;">
|
||||
<?php if(!($composerInstall['composer_install'] == 0)): ?>
|
||||
<span style="margin-left: 10px; color: red;"><?php echo $composerInstall['composer'] ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<li>
|
||||
<?php if(($composerInstall['composer_install'] == 0) ? $src = $greenCheck : $src = $redCheck ): ?>
|
||||
<img src="<?php echo $src ?>">
|
||||
<span><b>composer</b></span>
|
||||
<?php endif; ?>
|
||||
<br>
|
||||
<?php if(!($composerInstall['composer_install'] == 0)): ?>
|
||||
<small style="color: red;">
|
||||
<?php echo $composerInstall['composer'] ?>
|
||||
</small>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php if(!isset($requirements['errors']) && ($phpVersion['supported'] && $composerInstall['composer_install'] == 0)): ?>
|
||||
<div>
|
||||
<button type="button" class="prepare-btn" id="requirement-check">Continue</button>
|
||||
</div>
|
||||
|
||||
<div><button type="button" class="prepare-btn" id="requirement-check">Continue</button></div>
|
||||
<?php elseif(!($phpVersion['supported'] && $composerInstall['composer_install'] == 0)): ?>
|
||||
<div><button type="button" class="prepare-btn" id="requirements-refresh">Refresh</button></div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<html>
|
||||
|
||||
<?php
|
||||
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||
|
||||
|
|
@ -10,22 +9,25 @@
|
|||
?>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>Bagisto Installer</title>
|
||||
|
||||
<link rel="icon" sizes="16x16" href="Images/favicon.ico">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<link rel="stylesheet" type="text/css" href= "<?php echo $cssUrl; ?> ">
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.26/jquery.form-validator.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href= "<?php echo $cssUrl; ?> ">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container requirement">
|
||||
<div class="initial-display" style="padding-top: 100px;">
|
||||
<div class="container">
|
||||
<div class="initial-display">
|
||||
<img class="logo" src= "<?php echo $logo; ?>" >
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
|
@ -134,10 +136,9 @@
|
|||
}
|
||||
?>
|
||||
|
||||
<div style="margin-bottom: 10px; margin-top: 10px;">
|
||||
Powered by <a href="https://bagisto.com/" target="_blank" style="color: blue">Bagisto</a>, A Community Project by
|
||||
<a href="https://webkul.com/" target="_blank" style="color: blue">Webkul</a>
|
||||
<div style="margin-bottom: 5px; margin-top: 30px;">
|
||||
Powered by <a href="https://bagisto.com/" target="_blank">Bagisto</a>, a community project by
|
||||
<a href="https://webkul.com/" target="_blank">Webkul</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -23,4 +23,49 @@ class CustomerCest
|
|||
$I->see($customer->id, '//script[@type="text/x-template"]');
|
||||
$I->see($customer->last_name, '//script[@type="text/x-template"]');
|
||||
}
|
||||
|
||||
public function testCreate(FunctionalTester $I): void
|
||||
{
|
||||
$I->loginAsAdmin();
|
||||
$I->amOnAdminRoute('admin.customer.index');
|
||||
|
||||
$I->click(__('admin::app.customers.customers.add-title'), '//*[contains(@class, "page-action")]');
|
||||
$I->seeCurrentRouteIs('admin.customer.create');
|
||||
|
||||
$I->click(__('admin::app.customers.customers.save-btn-title'), '//*[contains(@class, "page-action")]');
|
||||
$I->seeFormHasErrors();
|
||||
|
||||
$testData = $this->fillForm($I);
|
||||
$I->click(__('admin::app.customers.customers.save-btn-title'), '//*[contains(@class, "page-action")]');
|
||||
|
||||
$I->dontSeeFormErrors();
|
||||
$I->seeCurrentRouteIs('admin.customer.index');
|
||||
$I->seeRecord(Customer::class, $testData);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*
|
||||
* @return array with the test-data
|
||||
*/
|
||||
private function fillForm(FunctionalTester $I): array
|
||||
{
|
||||
$testData = [
|
||||
'first_name' => $I->fake()->firstName,
|
||||
'last_name' => $I->fake()->lastName,
|
||||
'gender' => $I->fake()->randomElement([
|
||||
'Male',
|
||||
'Female',
|
||||
'Other',
|
||||
]),
|
||||
'email' => $I->fake()->email,
|
||||
];
|
||||
|
||||
$I->fillField('first_name', $testData['first_name']);
|
||||
$I->fillField('last_name', $testData['last_name']);
|
||||
$I->selectOption('gender', $testData['gender']);
|
||||
$I->fillField('email', $testData['email']);
|
||||
|
||||
return $testData;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue