diff --git a/.env.example b/.env.example index bb471ec98..4ece248c8 100644 --- a/.env.example +++ b/.env.example @@ -4,8 +4,9 @@ APP_VERSION=0.1.8 APP_KEY= APP_DEBUG=true APP_URL=http://localhost - +APP_TIMEZONE='Asia/Kolkata' LOG_CHANNEL=stack +APP_CURRENCY=USD DB_CONNECTION=mysql DB_HOST=127.0.0.1 diff --git a/CHANGELOG for v0.1.x.md b/CHANGELOG for v0.1.x.md index 1359bdd27..be4c3b3c1 100755 --- a/CHANGELOG for v0.1.x.md +++ b/CHANGELOG for v0.1.x.md @@ -2,6 +2,70 @@ #### This changelog consists the bug & security fixes and new features being included in the releases listed below. +## **v0.1.9 (20th of December, 2019)** - *Release* + +* #1875 [fixed] - Discount gets applied on cart if condition is "Visible Individually" is set to yes and product added in cart is not visible individually. + +* #1868 [fixed] - Getting exception on checkout if action Buy X Get Y free is selected in cart rule. + +* #1838 [fixed] - Cart rule not working for condition sku(children only) and sku(parent only). + +* #1835 [fixed] - Getting exception if condition value remains blank. + +* #1831 [fixed] - Negative sign is not required in discount amount. + +* #1830 [fixed] - If Coupon type is selected as "No Coupon" then coupon code should not generate for that particular cart rule. + +* #1904 [fixed] - Existing tax should display as list on creating catalog rule if in condition "Tax Category" is selected. + +* #1903 [fixed] - UI issue in condition field + +* #1895 [fixed] - Translation issue Action Type field while creating catalog rule. + +* #1883 [fixed] - Free shipping not applied on cart, if from action "Free Shipping" is selected and discount amount is given as zero. + +* #1882 [fixed] - If from Action "Apply on shipping " is selected as yes then the discounted amount is applying on both product and shipping charge. + +* #1861 [fixed] - Getting exception on checkout if applying invalid coupon code and proceed for checkout. + +* #1857 [fixed] - Getting exception when creating cart rule with condition URL KEY(children only). + +* #1856 [fixed] - Getting exception on creating cart rule with condition Name(children only). + +* #1847 [fixed] - If cart rule condition does not match the cart then on applying coupon it should display message "Coupon cannot be applied". + +* #1839 [fixed] - Getting exception on filtering cart rule through id. + +* #1836 [fixed] - Back button on Edit cart rule page doesn't work. + +* #1834 [fixed] - On editing any cart rule, its priority updates to 1. + +* #1833 [fixed] - Discount not applied if "Payment Method", "Shipping Method", "Shipping State" or "Shipping Country" is selected in condition. + +* #1832 [fixed] - Able to use coupon irrespective of the number given in "Uses per coupon" field. + +* #1828 [fixed] - Updated changes are not saved on editing cart rule. + +* #1825 [fixed] - Not able to generate coupon code while creating cart rule. + +* #1823 [fixed] - Getting exception after clicking on developement. + +* #1929 [fixed] - Actual product amount and discounted amount both should display on product page for configurable product + +* #1928 [fixed] - Catalog rule should not apply if any of the condition doesn't match, if condition type"All Condition are true" + +* #1931 [fixed] - Catalog rule not applying if in condition type"Any Condition is true" is selected, and some of the condition doesn't match the product. + +* #1935 [fixed] - Categories are not displaying if in condition Categories(children only) or Categories(Parent Only) is selected. + +* #1938 [fixed] - multiple cart rules are getting applied by using only single coupon. + +* #1939 [fixed] - Invalid coupon gets applied, if clicking on apply coupon multiple time, although there is no discount amount but its displaying message that coupon code applied successfully. + +* #1942 [fixed] - When editing the cart rule, selected category is not checked. + + + ## **v0.1.8 (4th of October, 2019)** - *Release* * [feature] - Refund is added for orders. diff --git a/CHANGELOG for v0.2.x.md b/CHANGELOG for v0.2.x.md new file mode 100644 index 000000000..bf693debb --- /dev/null +++ b/CHANGELOG for v0.2.x.md @@ -0,0 +1,17 @@ +# CHANGELOG for v0.2.x + +#### This changelog consists the bug & security fixes and new features being included in the releases listed below. + +## **v0.2.0 (23th of December, 2019)** - *Release* + +* #1955 [fixed] - Message need to be changed on mouse hover on cross symbol next to applied coupon. + +* #1959 [fixed] - if admin has set the same condition twice, then catalog rule is not getting apply + +* #1958 [fixed] - getting exception on front end, if action type is Buy x get y free in non couponable cart rule. + +* #1957 [fixed] - if action type is Fixed Amount to Whole Cart, then apply to shipping option should get hide. + +* #1954 [fixed] - If any different tax category has been assigned to variants in configurable product, then while using tax category condition in cart rule, rule is not working properly. + +* #1950 [fixed] - multiple catalog rule should not get get applied, if 1st one has been created as End Other Rules = yes \ No newline at end of file diff --git a/README.md b/README.md index 4f4d1e83f..f430fc703 100755 --- a/README.md +++ b/README.md @@ -21,20 +21,20 @@ ### Introduction -[Bagisto](https://www.bagisto.com) is a hand tailored E-Commerce framework designed on some of the hottest opensource technologies -such as [Laravel](https://laravel.com) a [PHP](https://secure.php.net/) framework, [Vue.js](https://vuejs.org) +[Bagisto](https://www.bagisto.com) is a hand tailored E-Commerce framework built on some of the hottest opensource technologies +such as [Laravel](https://laravel.com) (a [PHP](https://secure.php.net/) framework) and [Vue.js](https://vuejs.org) a progressive Javascript framework. -**Bagisto is viable attempt to cut down your time, cost and workforce for building online stores or migrating from physical stores -to the ever demanding online world. Your business whether small or huge it suits all and very simple to set it up.** +**Bagisto can help you to cut down your time, cost, and workforce for building online stores or migrating from physical stores +to the ever demanding online world. Your business -- whether small or huge -- can benefit. And it's very simple to set it up.** **Read our documentation: [Bagisto Docs](https://devdocs.bagisto.com/)** -**We are also having a forum for any type of your concern, feature request discussions. Please visit: [Bagisto Forums](https://forums.bagisto.com/)** +**We also have a forum for any type of concerns, feature requests, or discussions. Please visit: [Bagisto Forums](https://forums.bagisto.com/)** # Visit our live [Demo](https://demo.bagisto.com) -It packs in lots of demanding features that allows your business to scale in no time: +It packs in lots of features that will allow your E-Commerce business to scale in no time: * Multiple Channels, Locale, Currencies. * Built-in Access Control Layer. @@ -50,11 +50,10 @@ It packs in lots of demanding features that allows your business to scale in no * Simple and Configurable Products. * Price rules (Discount) inbuilt. * CMS Pages. -* Check out [click here](https://bagisto.com/features/). +* Check out [these features and more](https://bagisto.com/features/). **For Developers**: -Dev guys can take advantage of two of the hottest frameworks used in this project Laravel and Vue.js, both of these frameworks have been used in Bagisto. -Bagisto is using power of both of these frameworks and making best out of it out of the box. +Take advantage of two of the hottest frameworks used in this project -- Laravel and Vue.js -- both of which have been used in Bagisto. ### Documentation @@ -80,7 +79,7 @@ Bagisto is using power of both of these frameworks and making best out of it out [Download](https://github.com/bagisto/bagisto/archive/v0.1.6.zip) -##### b. Extract the contents of zip and execute the project in browser: +##### b. Extract the contents of zip and execute the project in your browser: ~~~ http(s)://localhost/bagisto/public @@ -94,15 +93,15 @@ http(s)://example.com/public **2. Try our old fashioned way to install Bagisto:** -##### Execute these commands below as in their order +##### Execute these commands below, in order ~~~ 1. composer create-project bagisto/bagisto ~~~ -**Now configure your database:** +**Now, configure your database:** -If the above command was completed successfully, then you'll find directory **bagisto** and all of the code will be inside it. +If the above command was completed successfully, then you'll find directory **bagisto** with all of the code inside it. Find file **.env** inside **bagisto** directory and set the environment variables listed below: @@ -114,7 +113,7 @@ Find file **.env** inside **bagisto** directory and set the environment variable * **DB_USERNAME** * **DB_PASSWORD** -Although, mailer environment variables are also required to be set up as **Bagisto** requires emails to send to customers and admins for various functionalities that are built in. +Mailer environment variables are also required to be set up. This is because **Bagisto** needs to send emails to customers and admins depending on what events require notification. ~~~ 2. php artisan migrate @@ -142,13 +141,13 @@ Although, mailer environment variables are also required to be set up as **Bagis ##### On server: -Warning: Before going full on production mode we recommend you to uninstall developer dependencies. +Warning: Before going into production mode we recommend you uninstall developer dependencies. In order to do that, run the command below: > composer install --no-dev ~~~ -Open the specified entry point in your hosts file in browser or make entry in hosts file if not done. +Open the specified entry point in your hosts file in your browser or make an entry in hosts file if not done. ~~~ ##### On local: @@ -178,13 +177,13 @@ password:admin123 Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://github.com/bagisto/bagisto/blob/master/LICENSE). ### Security Vulnerabilities -Please don't disclose security vulnerabilities publicly. If you find any security vulnerability in Bagisto then please write us mail: mailto:support@bagisto.com. +Please don't disclose security vulnerabilities publicly. If you find any security vulnerability in Bagisto then please email us: mailto:support@bagisto.com. ### Miscellaneous #### Contributors -This project is on [Open Collective](https://opencollective.com/bagisto) and it exists thanks to this people who contribute. +This project is on [Open Collective](https://opencollective.com/bagisto) and it exists thanks to the people who contribute. diff --git a/composer.json b/composer.json index 04f267c58..3e4f6d780 100755 --- a/composer.json +++ b/composer.json @@ -30,7 +30,6 @@ "laravel/framework": "5.6.*", "laravel/tinker": "^1.0", "maatwebsite/excel": "3.1.11", - "nwidart/laravel-modules": "^3.2", "prettus/l5-repository": "2.6.32", "tymon/jwt-auth": "1.0.0-rc.4" }, @@ -69,33 +68,35 @@ }, "autoload": { - "classmap": [ - "database/seeds", - "database/factories" - ], - "psr-4": { - "App\\": "app/", - "Webkul\\User\\": "packages/Webkul/User/src", - "Webkul\\Admin\\": "packages/Webkul/Admin/src", - "Webkul\\Ui\\": "packages/Webkul/Ui/src", - "Webkul\\Category\\": "packages/Webkul/Category/src", - "Webkul\\Checkout\\": "packages/Webkul/Checkout/src", - "Webkul\\Attribute\\": "packages/Webkul/Attribute/src", - "Webkul\\Shop\\": "packages/Webkul/Shop/src", - "Webkul\\Core\\": "packages/Webkul/Core/src", - "Webkul\\Customer\\": "packages/Webkul/Customer/src", - "Webkul\\Inventory\\": "packages/Webkul/Inventory/src", - "Webkul\\Product\\": "packages/Webkul/Product/src", - "Webkul\\Theme\\": "packages/Webkul/Theme/src", - "Webkul\\Shipping\\": "packages/Webkul/Shipping/src", - "Webkul\\Payment\\": "packages/Webkul/Payment/src", - "Webkul\\Paypal\\": "packages/Webkul/Paypal/src", - "Webkul\\Sales\\": "packages/Webkul/Sales/src", - "Webkul\\Tax\\": "packages/Webkul/Tax/src", - "Webkul\\API\\": "packages/Webkul/API", - "Webkul\\Discount\\": "packages/Webkul/Discount/src", - "Webkul\\CMS\\": "packages/Webkul/CMS/src" - } + "classmap": [ + "database/seeds", + "database/factories" + ], + "psr-4": { + "App\\": "app/", + "Webkul\\User\\": "packages/Webkul/User/src", + "Webkul\\Admin\\": "packages/Webkul/Admin/src", + "Webkul\\Ui\\": "packages/Webkul/Ui/src", + "Webkul\\Category\\": "packages/Webkul/Category/src", + "Webkul\\Checkout\\": "packages/Webkul/Checkout/src", + "Webkul\\Attribute\\": "packages/Webkul/Attribute/src", + "Webkul\\Shop\\": "packages/Webkul/Shop/src", + "Webkul\\Core\\": "packages/Webkul/Core/src", + "Webkul\\Customer\\": "packages/Webkul/Customer/src", + "Webkul\\Inventory\\": "packages/Webkul/Inventory/src", + "Webkul\\Product\\": "packages/Webkul/Product/src", + "Webkul\\Theme\\": "packages/Webkul/Theme/src", + "Webkul\\Shipping\\": "packages/Webkul/Shipping/src", + "Webkul\\Payment\\": "packages/Webkul/Payment/src", + "Webkul\\Paypal\\": "packages/Webkul/Paypal/src", + "Webkul\\Sales\\": "packages/Webkul/Sales/src", + "Webkul\\Tax\\": "packages/Webkul/Tax/src", + "Webkul\\API\\": "packages/Webkul/API", + "Webkul\\CatalogRule\\": "packages/Webkul/CatalogRule/src", + "Webkul\\CartRule\\": "packages/Webkul/CartRule/src", + "Webkul\\Rule\\": "packages/Webkul/Rule/src", + "Webkul\\CMS\\": "packages/Webkul/CMS/src" + } }, "autoload-dev": { @@ -131,7 +132,8 @@ "set -e", "@php artisan migrate:fresh --env=testing", "vendor/bin/codecept run unit", - "vendor/bin/codecept run functional" + "vendor/bin/codecept run functional", + "vendor/bin/codecept run trigger" ] }, "config": { diff --git a/config/app.php b/config/app.php index 8e675f952..1fdb5b5a4 100755 --- a/config/app.php +++ b/config/app.php @@ -65,7 +65,7 @@ return [ | */ - 'timezone' => 'Asia/Kolkata', + 'timezone' => env('APP_TIMEZONE','Asia/Kolkata'), /* |-------------------------------------------------------------------------- @@ -102,7 +102,7 @@ return [ | */ - 'currency' => 'USD', + 'currency' => env('APP_CURRENCY','USD'), /* |-------------------------------------------------------------------------- @@ -219,6 +219,8 @@ return [ //Laravel Maatwebsite Maatwebsite\Excel\ExcelServiceProvider::class, + Barryvdh\Debugbar\ServiceProvider::class, + //Repository Prettus\Repository\Providers\RepositoryServiceProvider::class, Konekt\Concord\ConcordServiceProvider::class, @@ -245,7 +247,9 @@ return [ Webkul\Sales\Providers\SalesServiceProvider::class, Webkul\Tax\Providers\TaxServiceProvider::class, Webkul\API\Providers\APIServiceProvider::class, - Webkul\Discount\Providers\DiscountServiceProvider::class, + Webkul\CatalogRule\Providers\CatalogRuleServiceProvider::class, + Webkul\CartRule\Providers\CartRuleServiceProvider::class, + Webkul\Rule\Providers\RuleServiceProvider::class, Webkul\CMS\Providers\CMSServiceProvider::class ], diff --git a/config/concord.php b/config/concord.php index 311ede347..24c40b47a 100755 --- a/config/concord.php +++ b/config/concord.php @@ -19,7 +19,8 @@ return [ \Webkul\Sales\Providers\ModuleServiceProvider::class, \Webkul\Tax\Providers\ModuleServiceProvider::class, \Webkul\User\Providers\ModuleServiceProvider::class, - \Webkul\Discount\Providers\ModuleServiceProvider::class, + \Webkul\CatalogRule\Providers\ModuleServiceProvider::class, + \Webkul\CartRule\Providers\ModuleServiceProvider::class, \Webkul\CMS\Providers\ModuleServiceProvider::class ] ]; \ No newline at end of file diff --git a/config/modules.php b/config/modules.php old mode 100755 new mode 100644 diff --git a/packages/Webkul/Admin/package.json b/packages/Webkul/Admin/package.json index 132be42e2..d594b0c87 100755 --- a/packages/Webkul/Admin/package.json +++ b/packages/Webkul/Admin/package.json @@ -10,14 +10,14 @@ "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { - "axios": "^0.18", - "cross-env": "^5.1.4", - "laravel-mix": "^2.1", - "laravel-mix-merge-manifest": "^0.1.1", - "jquery": "^3.2", - "vue": "^2.1.10" + "axios": "^0.19.0", + "cross-env": "^6.0.3", + "jquery": "^3.4.1", + "laravel-mix": "^5.0.0", + "laravel-mix-merge-manifest": "^0.1.2", + "vue": "^2.6.10" }, "dependencies": { - "vee-validate": "2.0.0-rc.26" + "vee-validate": "^2.2.15" } } diff --git a/packages/Webkul/Admin/publishable/assets/mix-manifest.json b/packages/Webkul/Admin/publishable/assets/mix-manifest.json index 198ea4d31..6c9bd7dc8 100755 --- a/packages/Webkul/Admin/publishable/assets/mix-manifest.json +++ b/packages/Webkul/Admin/publishable/assets/mix-manifest.json @@ -1,4 +1,4 @@ { - "/js/admin.js": "/js/admin.js?id=1a04ed2a8f0437dbe740", + "/js/admin.js": "/js/admin.js?id=d1daece26673ab30942b", "/css/admin.css": "/css/admin.css?id=c845e7c275d4df7fa03f" } diff --git a/packages/Webkul/Admin/src/Config/acl.php b/packages/Webkul/Admin/src/Config/acl.php index db7edbff7..8b28872db 100755 --- a/packages/Webkul/Admin/src/Config/acl.php +++ b/packages/Webkul/Admin/src/Config/acl.php @@ -394,27 +394,27 @@ return [ ], [ 'key' => 'promotions', 'name' => 'admin::app.acl.promotions', - 'route' => 'admin.cart-rule.index', + 'route' => 'admin.cart-rules.index', 'sort' => 7 ], [ - 'key' => 'promotions.cart-rule', + 'key' => 'promotions.cart-rules', 'name' => 'admin::app.acl.cart-rules', - 'route' => 'admin.cart-rule.index', + 'route' => 'admin.cart-rules.index', 'sort' => 1 ], [ - 'key' => 'promotions.cart-rule.create', + 'key' => 'promotions.cart-rules.create', 'name' => 'admin::app.acl.create', - 'route' => 'admin.cart-rule.create', + 'route' => 'admin.cart-rules.create', 'sort' => 1 ], [ - 'key' => 'promotions.cart-rule.edit', + 'key' => 'promotions.cart-rules.edit', 'name' => 'admin::app.acl.edit', - 'route' => 'admin.cart-rule.edit', + 'route' => 'admin.cart-rules.edit', 'sort' => 2 ], [ - 'key' => 'promotions.cart-rule.delete', + 'key' => 'promotions.cart-rules.delete', 'name' => 'admin::app.acl.delete', - 'route' => 'admin.cart-rule.delete', + 'route' => 'admin.cart-rules.delete', 'sort' => 3 ], ]; diff --git a/packages/Webkul/Admin/src/Config/menu.php b/packages/Webkul/Admin/src/Config/menu.php index cfa9d6877..a1420eb85 100755 --- a/packages/Webkul/Admin/src/Config/menu.php +++ b/packages/Webkul/Admin/src/Config/menu.php @@ -189,22 +189,22 @@ return [ 'icon-class' => '' ],[ 'key' => 'promotions', - 'name' => 'admin::app.layouts.promotion', - 'route' => 'admin.cart-rule.index', + 'name' => 'admin::app.layouts.promotions', + 'route' => 'admin.catalog-rules.index', 'sort' => 5, 'icon-class' => 'promotion-icon' ], [ - 'key' => 'promotions.cart-rule', - 'name' => 'admin::app.promotion.cart-rule', - 'route' => 'admin.cart-rule.index', + 'key' => 'promotions.catalog-rules', + 'name' => 'admin::app.promotions.catalog-rules.title', + 'route' => 'admin.catalog-rules.index', 'sort' => 1, 'icon-class' => '' ], [ - 'key' => 'promotions.catalog-rule', - 'name' => 'admin::app.promotion.catalog-rule', - 'route' => 'admin.catalog-rule.index', - 'sort' => 1, - 'icon-class' => '', + 'key' => 'promotions.cart-rules', + 'name' => 'admin::app.promotions.cart-rules.title', + 'route' => 'admin.cart-rules.index', + 'sort' => 2, + 'icon-class' => '' ], [ 'key' => 'cms', 'name' => 'admin::app.layouts.cms', diff --git a/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php index ac7bbc749..b9db127b1 100644 --- a/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php @@ -52,7 +52,7 @@ class AddressDataGrid extends DataGrid $queryBuilder = DB::table('customer_addresses as ca') ->leftJoin('countries', 'ca.country', '=', 'countries.code') ->leftJoin('customers as c', 'ca.customer_id', '=', 'c.id') - ->addSelect('ca.id as address_id', 'ca.address1', 'ca.country', DB::raw(''.DB::getTablePrefix().'countries.name as country_name'), 'ca.state', 'ca.city', 'ca.postcode', 'ca.phone', 'ca.default_address') + ->addSelect('ca.id as address_id', 'ca.address1', 'ca.country', DB::raw('' . DB::getTablePrefix() . 'countries.name as country_name'), 'ca.state', 'ca.city', 'ca.postcode', 'ca.phone', 'ca.default_address') ->where('c.id', $customer->id); $queryBuilder = $queryBuilder->leftJoin('country_states', function($qb) { @@ -62,13 +62,13 @@ class AddressDataGrid extends DataGrid $queryBuilder ->groupBy('ca.id') - ->addSelect(DB::raw(''.DB::getTablePrefix().'country_states.default_name as state_name')); + ->addSelect(DB::raw(DB::getTablePrefix() . 'country_states.default_name as state_name')); $this->addFilter('address_id', 'ca.id'); $this->addFilter('address1', 'ca.address1'); $this->addFilter('city', 'ca.city'); - $this->addFilter('state_name', DB::raw(''.DB::getTablePrefix().'country_states.default_name')); - $this->addFilter('country_name', DB::raw(''.DB::getTablePrefix().'countries.name')); + $this->addFilter('state_name', DB::raw(DB::getTablePrefix() . 'country_states.default_name')); + $this->addFilter('country_name', DB::raw(DB::getTablePrefix() . 'countries.name')); $this->addFilter('postcode', 'ca.postcode'); $this->addFilter('default_address', 'ca.default_address'); diff --git a/packages/Webkul/Admin/src/DataGrids/CartRuleCouponDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CartRuleCouponDataGrid.php new file mode 100644 index 000000000..ccf8c6375 --- /dev/null +++ b/packages/Webkul/Admin/src/DataGrids/CartRuleCouponDataGrid.php @@ -0,0 +1,86 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CartRuleCouponDataGrid extends DataGrid +{ + protected $index = 'id'; + + protected $sortOrder = 'desc'; + + public function prepareQueryBuilder() + { + $queryBuilder = DB::table('cart_rule_coupons') + ->addSelect('id', 'code', 'created_at', 'expired_at', 'times_used') + ->where('cart_rule_coupons.cart_rule_id', request('id')); + + $this->setQueryBuilder($queryBuilder); + } + + public function addColumns() + { + $this->addColumn([ + 'index' => 'id', + 'label' => trans('admin::app.datagrid.id'), + 'type' => 'number', + 'searchable' => false, + 'sortable' => true, + 'filterable' => true + ]); + + $this->addColumn([ + 'index' => 'code', + 'label' => trans('admin::app.datagrid.coupon-code'), + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'filterable' => true + ]); + + $this->addColumn([ + 'index' => 'created_at', + 'label' => trans('admin::app.datagrid.created-date'), + 'type' => 'datetime', + 'sortable' => true, + 'searchable' => false, + 'filterable' => true + ]); + + $this->addColumn([ + 'index' => 'expired_at', + 'label' => trans('admin::app.datagrid.expiration-date'), + 'type' => 'datetime', + 'sortable' => true, + 'searchable' => false, + 'filterable' => true + ]); + + $this->addColumn([ + 'index' => 'times_used', + 'label' => trans('admin::app.datagrid.times-used'), + 'type' => 'number', + 'searchable' => true, + 'sortable' => true, + 'filterable' => true + ]); + } + + public function prepareMassActions() + { + $this->addMassAction([ + 'type' => 'delete', + 'action' => route('admin.cart-rule-coupons.mass-delete'), + 'label' => trans('admin::app.datagrid.delete'), + 'method' => 'DELETE' + ]); + } +} diff --git a/packages/Webkul/Admin/src/DataGrids/CartRuleDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CartRuleDataGrid.php index 7eb57ffd7..c6efb9517 100644 --- a/packages/Webkul/Admin/src/DataGrids/CartRuleDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CartRuleDataGrid.php @@ -8,20 +8,27 @@ use DB; /** * Cart Rule DataGrid class * - * @author Prashant Singh @prashant-webkul + * @author Jitendra Singh * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ class CartRuleDataGrid extends DataGrid { - protected $index = 'id'; //the column that needs to be treated as index column + protected $index = 'id'; - protected $sortOrder = 'desc'; //asc or desc + protected $sortOrder = 'desc'; public function prepareQueryBuilder() { $queryBuilder = DB::table('cart_rules') - ->select('id') - ->addSelect('id', 'name', 'status', 'end_other_rules', 'action_type', 'disc_amount', 'use_coupon'); + ->leftJoin('cart_rule_coupons', function($leftJoin) { + $leftJoin->on('cart_rule_coupons.cart_rule_id', '=', 'cart_rules.id') + ->where('cart_rule_coupons.is_primary', 1); + }) + ->addSelect('cart_rules.id', 'name', 'cart_rule_coupons.code as coupon_code', 'status', 'starts_from', 'ends_till', 'sort_order'); + + $this->addFilter('id', 'cart_rules.id'); + + $this->addFilter('coupon_code', 'cart_rule_coupons.code'); $this->setQueryBuilder($queryBuilder); } @@ -30,7 +37,7 @@ class CartRuleDataGrid extends DataGrid { $this->addColumn([ 'index' => 'id', - 'label' => trans('admin::app.id'), + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -39,13 +46,40 @@ class CartRuleDataGrid extends DataGrid $this->addColumn([ 'index' => 'name', - 'label' => trans('admin::app.name'), + 'label' => trans('admin::app.datagrid.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, 'filterable' => true ]); + $this->addColumn([ + 'index' => 'coupon_code', + 'label' => trans('admin::app.datagrid.coupon-code'), + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'filterable' => true + ]); + + $this->addColumn([ + 'index' => 'starts_from', + 'label' => trans('admin::app.datagrid.start'), + 'type' => 'datetime', + 'sortable' => true, + 'searchable' => false, + 'filterable' => true + ]); + + $this->addColumn([ + 'index' => 'ends_till', + 'label' => trans('admin::app.datagrid.end'), + 'type' => 'datetime', + 'sortable' => true, + 'searchable' => false, + 'filterable' => true + ]); + $this->addColumn([ 'index' => 'status', 'label' => trans('admin::app.status'), @@ -55,89 +89,36 @@ class CartRuleDataGrid extends DataGrid 'filterable' => true, 'wrapper' => function($value) { if ($value->status == 1) - return 'Active'; + return trans('admin::app.datagrid.active'); else - return 'In Active'; + return trans('admin::app.datagrid.inactive'); } ]); $this->addColumn([ - 'index' => 'end_other_rules', - 'label' => 'End Other Rules', - 'type' => 'boolean', - 'searchable' => false, - 'sortable' => true, - 'filterable' => true, - 'wrapper' => function($value) { - if ($value->end_other_rules == 1) - return 'True'; - else - return 'False'; - } - ]); - - $this->addColumn([ - 'index' => 'action_type', - 'label' => 'Action Type', - 'type' => 'string', - 'searchable' => true, - 'sortable' => true, - 'filterable' => true, - 'wrapper' => function($value) { - return config('pricerules.cart.actions')[$value->action_type]; - } - ]); - - $this->addColumn([ - 'index' => 'disc_amount', - 'label' => 'Discount Amount', + 'index' => 'sort_order', + 'label' => trans('admin::app.datagrid.priority'), 'type' => 'number', - 'searchable' => false, + 'searchable' => true, 'sortable' => true, 'filterable' => true ]); - - $this->addColumn([ - 'index' => 'use_coupon', - 'label' => 'Use Coupon', - 'type' => 'boolean', - 'searchable' => true, - 'sortable' => true, - 'filterable' => true, - 'wrapper' => function($value) { - if ($value->use_coupon == 1) { - return 'True'; - } else { - return 'False'; - } - } - ]); } public function prepareActions() { $this->addAction([ - 'title' => 'Edit CartRule', - 'method' => 'GET', //use post only for redirects only - 'route' => 'admin.cart-rule.edit', + 'title' => 'Edit Cart Rule', + 'method' => 'GET', + 'route' => 'admin.cart-rules.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'title' => 'Delete CartRule', - 'method' => 'POST', //use post only for requests other than redirects - 'route' => 'admin.cart-rule.delete', + 'title' => 'Delete Cart Rule', + 'method' => 'POST', + 'route' => 'admin.cart-rules.delete', 'icon' => 'icon trash-icon' ]); } - - public function prepareMassActions() - { - // $this->addMassAction([ - // 'type' => 'delete', - // 'action' => route('admin.catalog.attributes.massdelete'), - // 'label' => 'Delete', - // 'method' => 'DELETE' - // ]); - } } diff --git a/packages/Webkul/Admin/src/DataGrids/CatalogRuleDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CatalogRuleDataGrid.php index 506af12eb..e57e977a1 100644 --- a/packages/Webkul/Admin/src/DataGrids/CatalogRuleDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CatalogRuleDataGrid.php @@ -8,20 +8,19 @@ use DB; /** * Catalog Rule DataGrid class * - * @author Prashant Singh @prashant-webkul + * @author Jitendra Singh * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ class CatalogRuleDataGrid extends DataGrid { - protected $index = 'id'; //the column that needs to be treated as index column + protected $index = 'id'; - protected $sortOrder = 'desc'; //asc or desc + protected $sortOrder = 'desc'; public function prepareQueryBuilder() { $queryBuilder = DB::table('catalog_rules') - ->select('id') - ->addSelect('id', 'name', 'starts_from', 'ends_till', 'status', 'end_other_rules', 'action_code'); + ->addSelect('catalog_rules.id', 'name', 'status', 'starts_from', 'ends_till', 'sort_order'); $this->setQueryBuilder($queryBuilder); } @@ -48,56 +47,41 @@ class CatalogRuleDataGrid extends DataGrid $this->addColumn([ 'index' => 'starts_from', - 'label' => trans('admin::app.datagrid.starts-from'), + 'label' => trans('admin::app.datagrid.start'), 'type' => 'datetime', - 'searchable' => false, 'sortable' => true, + 'searchable' => false, 'filterable' => true ]); $this->addColumn([ 'index' => 'ends_till', - 'label' => trans('admin::app.datagrid.ends-till'), + 'label' => trans('admin::app.datagrid.end'), 'type' => 'datetime', - 'searchable' => false, 'sortable' => true, + 'searchable' => false, 'filterable' => true ]); $this->addColumn([ 'index' => 'status', - 'label' => trans('admin::app.datagrid.status'), + 'label' => trans('admin::app.status'), 'type' => 'boolean', - 'searchable' => false, + 'searchable' => true, 'sortable' => true, 'filterable' => true, - 'wrapper' => function ($value) { + 'wrapper' => function($value) { if ($value->status == 1) - return 'True'; + return trans('admin::app.datagrid.active'); else - return 'False'; + return trans('admin::app.datagrid.inactive'); } ]); $this->addColumn([ - 'index' => 'end_other_rules', - 'label' => 'End Other Rules', - 'type' => 'boolean', - 'searchable' => false, - 'sortable' => true, - 'filterable' => true, - 'wrapper' => function ($value) { - if ($value->end_other_rules == 1) - return 'True'; - else - return 'False'; - } - ]); - - $this->addColumn([ - 'index' => 'action_code', - 'label' => 'Action Type', - 'type' => 'string', + 'index' => 'sort_order', + 'label' => trans('admin::app.datagrid.priority'), + 'type' => 'number', 'searchable' => true, 'sortable' => true, 'filterable' => true @@ -107,27 +91,17 @@ class CatalogRuleDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'title' => 'Edit CatalogRule', - 'method' => 'GET', //use post only for redirects only - 'route' => 'admin.catalog-rule.edit', + 'title' => 'Edit Catalog Rule', + 'method' => 'GET', + 'route' => 'admin.catalog-rules.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'title' => 'Delete CatalogRule', - 'method' => 'POST', //use post only for requests other than redirects - 'route' => 'admin.catalog-rule.delete', + 'title' => 'Delete Catalog Rule', + 'method' => 'POST', + 'route' => 'admin.catalog-rules.delete', 'icon' => 'icon trash-icon' ]); } - - public function prepareMassActions() - { - // $this->addMassAction([ - // 'type' => 'delete', - // 'action' => route('admin.catalog.attributes.massdelete'), - // 'label' => 'Delete', - // 'method' => 'DELETE' - // ]); - } } diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php index 98f7152a7..44b174a7b 100755 --- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php @@ -21,7 +21,7 @@ class CategoryDataGrid extends DataGrid { $queryBuilder = DB::table('categories as cat') ->select('cat.id as category_id', 'ct.name', 'cat.position', 'cat.status', 'ct.locale', - DB::raw('COUNT(DISTINCT '.DB::getTablePrefix().'pc.product_id) as count')) + DB::raw('COUNT(DISTINCT ' . DB::getTablePrefix() . 'pc.product_id) as count')) ->leftJoin('category_translations as ct', function($leftJoin) { $leftJoin->on('cat.id', '=', 'ct.category_id') ->where('ct.locale', app()->getLocale()); diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php index beba7a4b9..7345ea683 100755 --- a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php @@ -25,10 +25,10 @@ class CustomerDataGrid extends DataGrid $queryBuilder = DB::table('customers') ->leftJoin('customer_groups', 'customers.customer_group_id', '=', 'customer_groups.id') ->addSelect('customers.id as customer_id', 'customers.email', 'customer_groups.name', 'customers.phone', 'customers.gender', 'status') - ->addSelect(DB::raw('CONCAT('.DB::getTablePrefix().'customers.first_name, " ", '.DB::getTablePrefix().'customers.last_name) as full_name')); + ->addSelect(DB::raw('CONCAT(' . DB::getTablePrefix() . 'customers.first_name, " ", ' . DB::getTablePrefix() . 'customers.last_name) as full_name')); $this->addFilter('customer_id', 'customers.id'); - $this->addFilter('full_name', DB::raw('CONCAT('.DB::getTablePrefix().'customers.first_name, " ", '.DB::getTablePrefix().'customers.last_name)')); + $this->addFilter('full_name', DB::raw('CONCAT(' . DB::getTablePrefix() . 'customers.first_name, " ", ' . DB::getTablePrefix() . 'customers.last_name)')); $this->addFilter('phone', 'customers.phone'); $this->addFilter('gender', 'customers.gender'); diff --git a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php index 7b8049f84..3e8255453 100755 --- a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php @@ -29,11 +29,11 @@ class OrderDataGrid extends DataGrid ->where('order_address_billing.address_type', 'billing'); }) ->addSelect('orders.id','orders.increment_id', 'orders.base_sub_total', 'orders.base_grand_total', 'orders.created_at', 'channel_name', 'status') - ->addSelect(DB::raw('CONCAT('.DB::getTablePrefix().'order_address_billing.first_name, " ", '.DB::getTablePrefix().'order_address_billing.last_name) as billed_to')) - ->addSelect(DB::raw('CONCAT('.DB::getTablePrefix().'order_address_shipping.first_name, " ", '.DB::getTablePrefix().'order_address_shipping.last_name) as shipped_to')); + ->addSelect(DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_billing.first_name, " ", ' . DB::getTablePrefix() . 'order_address_billing.last_name) as billed_to')) + ->addSelect(DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_shipping.first_name, " ", ' . DB::getTablePrefix() . 'order_address_shipping.last_name) as shipped_to')); - $this->addFilter('billed_to', DB::raw('CONCAT('.DB::getTablePrefix().'order_address_billing.first_name, " ", '.DB::getTablePrefix().'order_address_billing.last_name)')); - $this->addFilter('shipped_to', DB::raw('CONCAT('.DB::getTablePrefix().'order_address_shipping.first_name, " ", '.DB::getTablePrefix().'order_address_shipping.last_name)')); + $this->addFilter('billed_to', DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_billing.first_name, " ", ' . DB::getTablePrefix() . 'order_address_billing.last_name)')); + $this->addFilter('shipped_to', DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_shipping.first_name, " ", ' . DB::getTablePrefix() . 'order_address_shipping.last_name)')); $this->addFilter('increment_id', 'orders.increment_id'); $this->addFilter('created_at', 'orders.created_at'); diff --git a/packages/Webkul/Admin/src/DataGrids/OrderRefundDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderRefundDataGrid.php index 2c425cb70..787b1512e 100755 --- a/packages/Webkul/Admin/src/DataGrids/OrderRefundDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderRefundDataGrid.php @@ -26,9 +26,9 @@ class OrderRefundDataGrid extends DataGrid $leftJoin->on('order_address_billing.order_id', '=', 'orders.id') ->where('order_address_billing.address_type', 'billing'); }) - ->addSelect(DB::raw('CONCAT('.DB::getTablePrefix().'order_address_billing.first_name, " ", '.DB::getTablePrefix().'order_address_billing.last_name) as billed_to')); + ->addSelect(DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_billing.first_name, " ", ' . DB::getTablePrefix() . 'order_address_billing.last_name) as billed_to')); - $this->addFilter('billed_to', DB::raw('CONCAT('.DB::getTablePrefix().'order_address_billing.first_name, " ", '.DB::getTablePrefix().'order_address_billing.last_name)')); + $this->addFilter('billed_to', DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_billing.first_name, " ", ' . DB::getTablePrefix() . 'order_address_billing.last_name)')); $this->addFilter('id', 'refunds.id'); $this->addFilter('increment_id', 'orders.increment_id'); $this->addFilter('state', 'refunds.state'); diff --git a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php index c6a30567f..a254af897 100755 --- a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php @@ -26,16 +26,17 @@ class OrderShipmentsDataGrid extends DataGrid }) ->leftJoin('orders as ors', 'shipments.order_id', '=', 'ors.id') ->leftJoin('inventory_sources as is', 'shipments.inventory_source_id', '=', 'is.id') - ->select('shipments.id as shipment_id', 'ors.increment_id as shipment_order_id', 'shipments.total_qty as shipment_total_qty', 'is.name as inventory_source_name', 'ors.created_at as order_date', 'shipments.created_at as shipment_created_at') - ->addSelect(DB::raw('CONCAT('.DB::getTablePrefix().'order_address_shipping.first_name, " ", '.DB::getTablePrefix().'order_address_shipping.last_name) as shipped_to')); + ->select('shipments.id as shipment_id', 'ors.increment_id as shipment_order_id', 'shipments.total_qty as shipment_total_qty', 'ors.created_at as order_date', 'shipments.created_at as shipment_created_at') + ->addSelect(DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_shipping.first_name, " ", ' . DB::getTablePrefix() . 'order_address_shipping.last_name) as shipped_to')) + ->selectRaw('IF(' . DB::getTablePrefix() . 'shipments.inventory_source_id IS NOT NULL,' . DB::getTablePrefix() . 'is.name, ' . DB::getTablePrefix() . 'shipments.inventory_source_name) as inventory_source_name'); $this->addFilter('shipment_id', 'shipments.id'); $this->addFilter('shipment_order_id', 'ors.increment_id'); $this->addFilter('shipment_total_qty', 'shipments.total_qty'); - $this->addFilter('inventory_source_name', 'is.name'); + $this->addFilter('inventory_source_name', DB::raw('IF(' . DB::getTablePrefix() . 'shipments.inventory_source_id IS NOT NULL,' . DB::getTablePrefix() . 'is.name, ' . DB::getTablePrefix() . 'shipments.inventory_source_name)')); $this->addFilter('order_date', 'ors.created_at'); $this->addFilter('shipment_created_at', 'shipments.created_at'); - $this->addFilter('shipped_to', DB::raw(''.DB::getTablePrefix().'CONCAT(order_address_shipping.first_name, " ", '.DB::getTablePrefix().'order_address_shipping.last_name)')); + $this->addFilter('shipped_to', DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_shipping.first_name, " ", ' . DB::getTablePrefix() . 'order_address_shipping.last_name)')); $this->setQueryBuilder($queryBuilder); } diff --git a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php index d254106fb..0e78f1f20 100644 --- a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php @@ -25,7 +25,7 @@ class ProductDataGrid extends DataGrid ->leftJoin('products', 'product_flat.product_id', '=', 'products.id') ->leftJoin('attribute_families', 'products.attribute_family_id', '=', 'attribute_families.id') ->leftJoin('product_inventories', 'product_flat.product_id', '=', 'product_inventories.product_id') - ->select('product_flat.product_id as product_id', 'product_flat.sku as product_sku', 'product_flat.name as product_name', 'products.type as product_type', 'product_flat.status', 'product_flat.price', 'attribute_families.name as attribute_family', DB::raw('SUM('.DB::getTablePrefix().'product_inventories.qty) as quantity')) + ->select('product_flat.product_id as product_id', 'product_flat.sku as product_sku', 'product_flat.name as product_name', 'products.type as product_type', 'product_flat.status', 'product_flat.price', 'attribute_families.name as attribute_family', DB::raw('SUM(' . DB::getTablePrefix() . 'product_inventories.qty) as quantity')) ->where('channel', core()->getCurrentChannelCode()) ->where('locale', app()->getLocale()) ->groupBy('product_flat.product_id'); diff --git a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php index cf071adb8..8812bc2ba 100755 --- a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php @@ -50,7 +50,13 @@ class TaxRateDataGrid extends DataGrid 'type' => 'string', 'searchable' => true, 'sortable' => true, - 'filterable' => true + 'filterable' => true, + 'wrapper' => function($value) { + if (empty($value->state)) + return '*'; + else + return $value->state; + } ]); $this->addColumn([ diff --git a/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php b/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php index 30ab97908..bdac3ee91 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php @@ -120,9 +120,11 @@ class ConfigurationController extends Controller { Event::fire('core.configuration.save.before'); - $this->validate(request(), [ - 'general.design.admin_logo.logo_image' => 'mimes:jpeg,bmp,png,jpg' - ]); + if (request()->hasFile('general.design.admin_logo.logo_image')) { + $this->validate(request(), [ + 'general.design.admin_logo.logo_image' => 'required|mimes:jpeg,bmp,png,jpg' + ]); + } $this->coreConfigRepository->create(request()->all()); diff --git a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php index c77a66a73..08a81d355 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php @@ -186,7 +186,7 @@ class DashboardController extends Controller ->where('order_items.created_at', '>=', $this->startDate) ->where('order_items.created_at', '<=', $this->endDate) ->addSelect(DB::raw('SUM(qty_invoiced - qty_refunded) as total_qty_invoiced')) - ->addSelect(DB::raw('COUNT('.DB::getTablePrefix().'products.id) as total_products')) + ->addSelect(DB::raw('COUNT(' . DB::getTablePrefix() . 'products.id) as total_products')) ->addSelect('order_items.id', 'categories.id as category_id', 'category_translations.name') ->groupBy('categories.id') ->havingRaw('SUM(qty_invoiced - qty_refunded) > 0') diff --git a/packages/Webkul/Admin/src/Http/routes.php b/packages/Webkul/Admin/src/Http/routes.php index 50c6557bd..6da6f2068 100755 --- a/packages/Webkul/Admin/src/Http/routes.php +++ b/packages/Webkul/Admin/src/Http/routes.php @@ -669,60 +669,56 @@ Route::group(['middleware' => ['web']], function () { //DataGrid Export Route::post('admin/export', 'Webkul\Admin\Http\Controllers\ExportController@export')->name('admin.datagrid.export'); - Route::prefix('promotion')->group(function () { - Route::get('/catalog-rules', 'Webkul\Discount\Http\Controllers\CatalogRuleController@index')->defaults('_config', [ - 'view' => 'admin::promotions.catalog-rule.index' - ])->name('admin.catalog-rule.index'); + Route::prefix('promotions')->group(function () { + Route::get('cart-rules', 'Webkul\CartRule\Http\Controllers\CartRuleController@index')->defaults('_config', [ + 'view' => 'admin::promotions.cart-rules.index' + ])->name('admin.cart-rules.index'); - Route::get('/catalog-rules/create', 'Webkul\Discount\Http\Controllers\CatalogRuleController@create')->defaults('_config', [ - 'view' => 'admin::promotions.catalog-rule.create' - ])->name('admin.catalog-rule.create'); + Route::get('cart-rules/create', 'Webkul\CartRule\Http\Controllers\CartRuleController@create')->defaults('_config', [ + 'view' => 'admin::promotions.cart-rules.create' + ])->name('admin.cart-rules.create'); - Route::post('/catalog-rules/create', 'Webkul\Discount\Http\Controllers\CatalogRuleController@store')->defaults('_config', [ - 'redirect' => 'admin.catalog-rule.index' - ])->name('admin.catalog-rule.store'); + Route::post('cart-rules/create', 'Webkul\CartRule\Http\Controllers\CartRuleController@store')->defaults('_config', [ + 'redirect' => 'admin.cart-rules.index' + ])->name('admin.cart-rules.store'); - Route::get('/catalog-rules/edit/{id}', 'Webkul\Discount\Http\Controllers\CatalogRuleController@edit')->defaults('_config', [ - 'view' => 'admin::promotions.catalog-rule.edit' - ])->name('admin.catalog-rule.edit'); + Route::get('cart-rules/edit/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@edit')->defaults('_config', [ + 'view' => 'admin::promotions.cart-rules.edit' + ])->name('admin.cart-rules.edit'); - Route::post('/catalog-rules/edit/{id}', 'Webkul\Discount\Http\Controllers\CatalogRuleController@update')->defaults('_config', [ - 'redirect' => 'admin.catalog-rule.index' - ])->name('admin.catalog-rule.update'); + Route::post('cart-rules/edit/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@update')->defaults('_config', [ + 'redirect' => 'admin.cart-rules.index' + ])->name('admin.cart-rules.update'); - Route::get('/catalog-rules/apply', 'Webkul\Discount\Http\Controllers\CatalogRuleController@applyRules')->defaults('_config', [ - 'view' => 'admin::promotions.catalog-rule.index' - ])->name('admin.catalog-rule.apply'); + Route::post('cart-rules/delete/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@destroy')->name('admin.cart-rules.delete'); - Route::post('/catalog-rules/delete/{id}', 'Webkul\Discount\Http\Controllers\CatalogRuleController@destroy')->name('admin.catalog-rule.delete'); + Route::post('cart-rules/generate-coupons/{id?}', 'Webkul\CartRule\Http\Controllers\CartRuleController@generateCoupons')->name('admin.cart-rules.generate-coupons'); - Route::get('/catalog-rules/declutter', 'Webkul\Discount\Http\Controllers\CatalogRuleController@deClutter')->defaults('_config', [ - 'redirect' => 'admin.catalog-rule.index' - ])->name('admin.catalog-rule.declut'); + Route::post('/massdelete', 'Webkul\CartRule\Http\Controllers\CartRuleCouponController@massDelete')->name('admin.cart-rule-coupons.mass-delete'); - Route::post('fetch/options', 'Webkul\Discount\Http\Controllers\CatalogRuleController@fetchAttributeOptions')->name('admin.catalog-rule.options'); - Route::get('cart-rules', 'Webkul\Discount\Http\Controllers\CartRuleController@index')->defaults('_config', [ - 'view' => 'admin::promotions.cart-rule.index' - ])->name('admin.cart-rule.index'); + //Catalog rules + Route::get('catalog-rules', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@index')->defaults('_config', [ + 'view' => 'admin::promotions.catalog-rules.index' + ])->name('admin.catalog-rules.index'); - Route::get('cart-rules/create', 'Webkul\Discount\Http\Controllers\CartRuleController@create')->defaults('_config', [ - 'view' => 'admin::promotions.cart-rule.create' - ])->name('admin.cart-rule.create'); + Route::get('catalog-rules/create', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@create')->defaults('_config', [ + 'view' => 'admin::promotions.catalog-rules.create' + ])->name('admin.catalog-rules.create'); - Route::post('cart-rules/store', 'Webkul\Discount\Http\Controllers\CartRuleController@store')->defaults('_config', [ - 'redirect' => 'admin.cart-rule.index' - ])->name('admin.cart-rule.store'); + Route::post('catalog-rules/create', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@store')->defaults('_config', [ + 'redirect' => 'admin.catalog-rules.index' + ])->name('admin.catalog-rules.store'); - Route::get('cart-rules/edit/{id}', 'Webkul\Discount\Http\Controllers\CartRuleController@edit')->defaults('_config', [ - 'view' => 'admin::promotions.cart-rule.edit' - ])->name('admin.cart-rule.edit'); + Route::get('catalog-rules/edit/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@edit')->defaults('_config', [ + 'view' => 'admin::promotions.catalog-rules.edit' + ])->name('admin.catalog-rules.edit'); - Route::post('cart-rules/update/{id}', 'Webkul\Discount\Http\Controllers\CartRuleController@update')->defaults('_config', [ - 'redirect' => 'admin.cart-rule.index' - ])->name('admin.cart-rule.update'); + Route::post('catalog-rules/edit/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@update')->defaults('_config', [ + 'redirect' => 'admin.catalog-rules.index' + ])->name('admin.catalog-rules.update'); - Route::post('cart-rules/delete/{id}', 'Webkul\Discount\Http\Controllers\CartRuleController@destroy')->name('admin.cart-rule.delete'); + Route::post('catalog-rules/delete/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@destroy')->name('admin.catalog-rules.delete'); }); Route::prefix('cms')->group(function () { diff --git a/packages/Webkul/Admin/src/Resources/assets/js/app.js b/packages/Webkul/Admin/src/Resources/assets/js/app.js index c197f8d89..76eaf7319 100755 --- a/packages/Webkul/Admin/src/Resources/assets/js/app.js +++ b/packages/Webkul/Admin/src/Resources/assets/js/app.js @@ -1,7 +1,10 @@ -require("./bootstrap"); +import Vue from 'vue'; +import VeeValidate from 'vee-validate'; -window.Vue = require("vue"); -window.VeeValidate = require("vee-validate"); +import './bootstrap'; + +window.Vue = Vue; +window.VeeValidate = VeeValidate; Vue.use(VeeValidate); Vue.prototype.$http = axios @@ -82,6 +85,10 @@ $(document).ready(function () { }, addFlashMessages() { + if (typeof flashMessages !== 'undefined') { + return; + }; + const flashes = this.$refs.flashes; flashMessages.forEach(function(flash) { diff --git a/packages/Webkul/Admin/src/Resources/assets/sass/partials/_configuration.scss b/packages/Webkul/Admin/src/Resources/assets/sass/partials/_configuration.scss index 2e2b3258d..c66e1bda9 100644 --- a/packages/Webkul/Admin/src/Resources/assets/sass/partials/_configuration.scss +++ b/packages/Webkul/Admin/src/Resources/assets/sass/partials/_configuration.scss @@ -48,4 +48,29 @@ border-bottom: 1px solid #e8e8e8; cursor: pointer; } +} + +.cart-rule-conditions, +.catalog-rule-conditions { + table { + td { + &.attribute { + width: 250px; + padding-left: 0; + } + + &.operator, + &.value { + width: 260px; + } + + &.actions { + width: 44px; + + .icon { + margin-top: 6px; + } + } + } + } } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/lang/ar/app.php b/packages/Webkul/Admin/src/Resources/lang/ar/app.php index 12f184e84..2f7acfa1d 100644 --- a/packages/Webkul/Admin/src/Resources/lang/ar/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/ar/app.php @@ -852,7 +852,7 @@ return [ ], 'footer' => [ - 'copy-right' => '© Copyright 2018 Webkul Software, All rights reserved.' + 'copy-right' => ' مدعوم من Bagisto ، مشروع مجتمع بواسطة Webkul' ], 'admin' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 6ddbe5966..5d0b7d911 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -73,7 +73,7 @@ return [ 'taxes' => 'Taxes', 'tax-categories' => 'Tax Categories', 'tax-rates' => 'Tax Rates', - 'promotion' => 'Promotions', + 'promotions' => 'Promotions', 'discount' => 'Discount', 'cms' => 'CMS' ], @@ -110,7 +110,8 @@ return [ 'create' => 'Add', 'delete' => 'Delete', 'promotions' => 'Promotions', - 'cart-rules' => 'Cart Rules' + 'cart-rules' => 'Cart Rules', + 'catalog-rules' => 'Catalog Rules', ], 'dashboard' => [ @@ -203,7 +204,16 @@ return [ 'for-guest' => 'For Guest', 'order_number' => 'Order Number', 'refund-date' => 'Refund Date', - 'refunded' => 'Refunded' + 'refunded' => 'Refunded', + 'start' => 'Start', + 'end' => 'End', + 'active' => 'Active', + 'inactive' => 'Inactive', + 'coupon-code' => 'Coupon Code', + 'times-used' => 'Times Used', + 'created-date' => 'Created Date', + 'expiration-date' => 'Expiration Date', + 'delete' => 'Delete' ], 'account' => [ @@ -944,125 +954,138 @@ return [ ] ], - 'promotion' => [ - 'information' => 'Information', - 'conditions' => 'Conditions', - 'actions' => 'Actions', - 'coupons' => 'Coupons', - 'zero-unlimited' => 'Zero denotes unlimited usage here', - 'catalog-rule' => 'Catalog Rules', - 'cart-rule' => 'Cart Rules', - 'add-catalog-rule' => 'Add Rule', - 'add-cart-rule' => 'Add Cart Rule', - 'edit-cart-rule' => 'Edit Cart Rule', - 'edit-catalog-rule' => 'Edit Catalog Rule', - 'create-catalog-rule' => 'Create Catalog Rule', - 'create-cart-rule' => 'Create Cart Rule', - 'save-btn-title' => 'Create', - 'edit-btn-title' => 'Save', - 'save' => 'Save', - 'select-cart-attr' => 'Select Cart Attribute', - 'select-products' => 'How to choose products ?', - 'select-category' => 'Select by Categories', - 'select-attribute' => 'Select by Attributes', - 'cannot-activate-catalog-rule' => 'Cannot activate catalog rule', - 'catalog-rule-already-activated' => 'Catalog rule is already activated', - 'catalog-rule-activated' => 'Catalog rule is activated', - 'select-attribute' => 'Select :attribute', - 'enter-attribute' => 'Enter :attribute', - 'add-condition' => 'Add Condition', - 'cart-properties' => 'Cart Properties', - 'yes' => 'Yes', - 'no' => 'No', - 'note' => 'Note', - 'apply' => 'Apply', - 'rule-name' => 'Enter Rule Name', - 'rule-desc' => 'Enter Rule Description', - 'convert-x-note' => 'If this section is left empty, then rule will get applied to all the products in the cart.', - 'declut' => 'Declutter', - 'processing-done' => 'Rules processing done', - 'declut-success' => 'Catalog rules decluttering successful', - 'declut-failure' => 'Catalog rules decluttering failed', - 'add-attr-condition' => 'Add Attribute Condition', - 'general-info' => [ - 'sku-like' => 'SKU Like', - 'on-shipping' => 'If applied on shipping', - 'discount' => 'Discount', - 'shipping-apply-info' => 'It signifies how rule behaves when it is used for shipping', - 'general-info' => 'General Info', - 'options' => 'Options', - 'name' => 'Rule Name', - 'description' => 'Description', - 'starts-from' => 'Start', - 'ends-till' => 'End', - 'channels' => 'Channels', - 'channels-req' => 'Channels', - 'cust-groups' => 'Customer Groups', - 'priority' => 'Priority', - 'add-condition' => 'Add Conditions', - 'disc_amt' => 'Discount Amount', - 'disc_percent' => 'Discount Percentage', - 'is-coupon' => 'Use Coupon', - 'is-coupon-yes' => 'Yes', - 'is-coupon-no' => 'No', - 'uses-per-cust' => 'Uses per customer', - 'all' => 'All', - 'any' => 'Any', - 'end-other-rules' => 'End other rules', - 'status' => 'Is Active', - 'all-conditions-true' => 'Assuming all conditions are true', - 'assuming' => 'Assuming', - 'any' => 'Any', - 'all' => 'All', - 'conditions' => 'Conditions', - 'apply' => 'Apply', - 'are' => 'are', - 'true' => 'true', - 'false' => 'false', - 'limit' => 'Usage Limit', - 'specific-coupon' => 'Specific Coupon(Check) / Auto Generated(Unheck)', - 'free-shipping' => 'Free Shipping', - 'is-guest' => 'For Guests', - 'disc_qty' => 'Max. Quantity Allowed To Be Discounted', - 'test-mode' => 'Choose how to test conditions', - 'labels' => 'Labels', - 'prefix' => 'Prefix', - 'suffix' => 'Suffix', - 'code' => 'Code', - 'global-label' => 'Global Label', - 'label' => 'Label' - ], - - 'status' => [ - 'success' => 'Success! rule created', - 'success-coupon' => 'Success! rule created along with coupon', - 'failed' => 'Error! failed to create rule', - 'update-success' => 'Success! rule updated', - 'update-coupon-success' => 'Success! rule updated along with coupon', - 'update-failed' => 'Error! cannot update', - 'delete-success' => 'Success! rule deleted', - 'delete-failed' => 'Error! cannot delete', - 'coupon-applied' => 'Coupon used', - 'coupon-failed' => 'Coupon failed to apply', - 'no-coupon' => '* Coupon not applicable', - 'coupon-removed' => 'Coupon removed successfully', - 'coupon-remove-failed' => 'Coupon removal failed', - 'duplicate-coupon' => 'Coupon already exists, please try again with a different coupon' - ], - - 'catalog' => [ + 'promotions' => [ + 'cart-rules' => [ + 'title' => 'Cart Rules', + 'add-title' => 'Add Cart Rule', + 'edit-title' => 'Edit Cart Rule', + 'save-btn-title' => 'Save Cart Rule', + 'rule-information' => 'Rule Information', 'name' => 'Name', 'description' => 'Description', - 'apply-percent' => 'Apply as percentage', - 'apply-fixed' => 'Apply as fixed amount', - 'adjust-to-percent' => 'Adjust to percentage', - 'adjust-to-value' => 'Adjust to discount value', - 'condition-missing' => 'Please check conditons, some values might be missing' + 'status' => 'Status', + 'is-active' => 'Cart Rule is Active', + 'channels' => 'Channels', + 'customer-groups' => 'Customer Groups', + 'coupon-type' => 'Coupon Type', + 'no-coupon' => 'No Coupon', + 'specific-coupon' => 'Specific Coupon', + 'auto-generate-coupon' => 'Auto Generate Coupon', + 'no' => 'No', + 'yes' => 'Yes', + 'coupon-code' => 'Coupon Code', + 'uses-per-coupon' => 'Uses Per Coupon', + 'uses-per-customer' => 'Uses Per Customer', + 'uses-per-customer-control-info' => 'Will be used for logged in customers only.', + 'from' => 'From', + 'to' => 'To', + 'priority' => 'Priority', + 'conditions' => 'Conditions', + 'condition-type' => 'Condition Type', + 'all-conditions-true' => 'All Conditions are True', + 'any-condition-true' => 'Any Condition is True', + 'add-condition' => 'Add Condition', + 'choose-condition-to-add' => 'Choose a condition to add', + 'cart-attribute' => 'Cart Attribute', + 'subtotal' => 'Subtotal', + 'total-items-qty' => 'Total Items Qty', + 'total-weight' => 'Total Weight', + 'payment-method' => 'Payment Method', + 'shipping-method' => 'Shipping Method', + 'shipping-postcode' => 'Shipping Zip/Postcode', + 'shipping-state' => 'Shipping State', + 'shipping-country' => 'Shipping Country', + 'cart-item-attribute' => 'Cart Item Attribute', + 'price-in-cart' => 'Price in Cart', + 'qty-in-cart' => 'Qty in Cart', + 'product-attribute' => 'Product Attribute', + 'attribute-name-children-only' => ':attribute_name (Children Only)', + 'attribute-name-parent-only' => ':attribute_name (Parent Only)', + 'is-equal-to' => 'Is equal to', + 'is-not-equal-to' => 'Is not equal to', + 'equals-or-greater-than' => 'Equals or greater than', + 'equals-or-less-than' => 'Equals or less than', + 'greater-than' => 'Greater than', + 'less-than' => 'Less than', + 'contain' => 'Contain', + 'contains' => 'Contains', + 'does-not-contain' => 'Does not contain', + 'actions' => 'Actions', + 'action-type' => 'Action Type', + 'percentage-product-price' => 'Percentage of Product Price', + 'fixed-amount' => 'Fixed Amount', + 'fixed-amount-whole-cart' => 'Fixed Amount to Whole Cart', + 'buy-x-get-y-free' => 'Buy X Get Y Free', + 'discount-amount' => 'Discount Amount', + 'discount-quantity' => 'Maximum Quantity Allowed to be Discounted', + 'discount-step' => 'Buy X Quantity', + 'free-shipping' => 'Free Shipping', + 'apply-to-shipping' => 'Apply to Shipping', + 'coupon-codes' => 'Coupon Codes', + 'coupon-qty' => 'Coupon Qty', + 'code-length' => 'Code Length', + 'code-format' => 'Code Format', + 'alphanumeric' => 'Alphanumeric', + 'alphabetical' => 'Alphabetical', + 'numeric' => 'Numeric', + 'code-prefix' => 'Code Prefix', + 'code-suffix' => 'Code Suffix', + 'generate' => 'Generate', + 'cart-rule-not-defind-error' => 'Cart rule is not defined', + 'mass-delete-success' => 'All the selected index of coupons have been deleted successfully.', + 'end-other-rules' => 'End Other Rules', + 'children-categories' => 'Categories (Children Only)', + 'parent-categories' => 'Categories (Parent Only)', + 'categories' => 'Categories', + 'attribute_family' => 'Attribute Family' ], - 'cart' => [ - 'buy-atleast' => 'Buy Atleast', - 'apply-to-shipping' => 'Apply to shipping' + 'catalog-rules' => [ + 'title' => 'Catalog Rules', + 'add-title' => 'Add Catalog Rule', + 'edit-title' => 'Edit Catalog Rule', + 'save-btn-title' => 'Save Catalog Rule', + 'rule-information' => 'Rule Information', + 'name' => 'Name', + 'description' => 'Description', + 'status' => 'Status', + 'is-active' => 'Catalog Rule is Active', + 'channels' => 'Channels', + 'customer-groups' => 'Customer Groups', + 'no' => 'No', + 'yes' => 'Yes', + 'from' => 'From', + 'to' => 'To', + 'priority' => 'Priority', + 'conditions' => 'Conditions', + 'condition-type' => 'Condition Type', + 'all-conditions-true' => 'All Conditions are True', + 'any-condition-true' => 'Any Condition is True', + 'add-condition' => 'Add Condition', + 'choose-condition-to-add' => 'Choose a condition to add', + 'product-attribute' => 'Product Attribute', + 'attribute-name-children-only' => ':attribute_name (Children Only)', + 'attribute-name-parent-only' => ':attribute_name (Parent Only)', + 'is-equal-to' => 'Is equal to', + 'is-not-equal-to' => 'Is not equal to', + 'equals-or-greater-than' => 'Equals or greater than', + 'equals-or-less-than' => 'Equals or less than', + 'greater-than' => 'Greater than', + 'less-than' => 'Less than', + 'contain' => 'Contain', + 'contains' => 'Contains', + 'does-not-contain' => 'Does not contain', + 'actions' => 'Actions', + 'action-type' => 'Action Type', + 'percentage-product-price' => 'Percentage of Product Price', + 'fixed-amount' => 'Fixed Amount', + 'fixed-amount-whole-cart' => 'Fixed Amount to Whole Catalog', + 'buy-x-get-y-free' => 'Buy X Get Y Free', + 'discount-amount' => 'Discount Amount', + 'mass-delete-success' => 'All the selected index of coupons have been deleted successfully.', + 'end-other-rules' => 'End Other Rules', + 'categories' => 'Categories', + 'attribute_family' => 'Attribute Family' ] ], @@ -1172,7 +1195,7 @@ return [ ], 'footer' => [ - 'copy-right' => '© Copyright 2018 Webkul Software, All rights reserved.' + 'copy-right' => 'Powered by Bagisto, A Community Project by Webkul', ], 'admin' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/fa/app.php b/packages/Webkul/Admin/src/Resources/lang/fa/app.php index ad5d4ca54..7c8d247f6 100644 --- a/packages/Webkul/Admin/src/Resources/lang/fa/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/fa/app.php @@ -998,7 +998,7 @@ return [ ], 'footer' => [ - 'copy-right' => '© کپی رایت 2019 کلیه حقوق محفوظ است.' + 'copy-right' => 'طراحی شده توسط Bagisto ، یک پروژه عمومی توسط Webkul' ], 'admin' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php b/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php index 3aeb94034..1c8a5d7d2 100755 --- a/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php @@ -976,7 +976,7 @@ return [ ], 'footer' => [ - 'copy-right' => '© Copyright '.date('Y').' Webkul Software, Todos os direitos reservados.' + 'copy-right' => 'Desenvolvido por Bagisto, um projeto comunitário da Webkul' ], 'admin' => [ diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php index aa21eb2ba..94477e2ca 100755 --- a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php @@ -83,7 +83,7 @@
- +
@endforeach diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php index 4482e2c24..7ed785d42 100755 --- a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php @@ -108,7 +108,7 @@
- +
@endforeach diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php index da768aecb..d0d3b9e4c 100755 --- a/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php @@ -52,7 +52,7 @@
- + @{{ errors.first('{!!$locale!!}[name]') }}
@@ -180,23 +180,23 @@
- +
- + @{{ errors.first('{!!$locale!!}[slug]') }}
- +
- +
{!! view_render_event('bagisto.admin.catalog.category.edit_form_accordian.seo.controls.after', ['category' => $category]) !!} @@ -220,7 +220,7 @@
- + @{{ errors.first('{!!$locale!!}[description]') }}
diff --git a/packages/Webkul/Admin/src/Resources/views/layouts/anonymous-master.blade.php b/packages/Webkul/Admin/src/Resources/views/layouts/anonymous-master.blade.php index 1dcca7d44..0357d8f43 100755 --- a/packages/Webkul/Admin/src/Resources/views/layouts/anonymous-master.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/layouts/anonymous-master.blade.php @@ -96,7 +96,7 @@ @if (core()->getConfigData('general.content.footer.footer_content')) {{ core()->getConfigData('general.content.footer.footer_content') }} @else - {{ trans('admin::app.footer.copy-right') }} + {!! trans('admin::app.footer.copy-right') !!} @endif

diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php deleted file mode 100644 index 857b36306..000000000 --- a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php +++ /dev/null @@ -1,630 +0,0 @@ -@extends('admin::layouts.content') - -@section('page_title') - {{ __('admin::app.promotion.add-cart-rule') }} -@stop - -@section('content') - -
- -
- - @push('scripts') - - - - @endpush -@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/edit.blade.php deleted file mode 100644 index 27312c327..000000000 --- a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/edit.blade.php +++ /dev/null @@ -1,740 +0,0 @@ -@extends('admin::layouts.content') - -@section('page_title') - {{ __('admin::app.promotion.edit-cart-rule') }} -@stop - -@section('content') - -
- -
- - @push('scripts') - - - - @endpush -@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rules/create.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rules/create.blade.php new file mode 100644 index 000000000..6ced9889a --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rules/create.blade.php @@ -0,0 +1,614 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.promotions.cart-rules.add-title') }} +@stop + +@section('content') +
+ + + +
+@stop + +@push('scripts') + @parent + + + + + + +@endpush \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rules/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rules/edit.blade.php new file mode 100644 index 000000000..cdc051a59 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rules/edit.blade.php @@ -0,0 +1,753 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.promotions.cart-rules.edit-title') }} +@stop + +@section('content') +
+ + + +
+@stop + +@push('scripts') + @parent + + + + + + + + +@endpush \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/index.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rules/index.blade.php similarity index 60% rename from packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/index.blade.php rename to packages/Webkul/Admin/src/Resources/views/promotions/cart-rules/index.blade.php index cf172412a..d07bbfaef 100644 --- a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rules/index.blade.php @@ -1,7 +1,7 @@ @extends('admin::layouts.content') @section('page_title') - {{ __('admin::app.promotion.cart-rule') }} + {{ __('admin::app.promotions.cart-rules.title') }} @stop @section('content') @@ -9,12 +9,12 @@
diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php deleted file mode 100644 index ca386c453..000000000 --- a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php +++ /dev/null @@ -1,415 +0,0 @@ -@extends('admin::layouts.content') - -@section('page_title') - {{ __('admin::app.promotion.add-catalog-rule') }} -@stop - -@section('content') -
- -
- - @push('scripts') - - - - @endpush -@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/edit.blade.php deleted file mode 100644 index f7b68da7b..000000000 --- a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/edit.blade.php +++ /dev/null @@ -1,414 +0,0 @@ -@extends('admin::layouts.content') - -@section('page_title') - {{ __('admin::app.promotion.edit-catalog-rule') }} -@stop - -@section('content') -
- -
- - @push('scripts') - - - - @endpush -@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/index.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/index.blade.php deleted file mode 100644 index 6790810ea..000000000 --- a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/index.blade.php +++ /dev/null @@ -1,35 +0,0 @@ -@extends('admin::layouts.content') - -@section('page_title') - {{ __('admin::app.promotion.catalog-rule') }} -@stop - -@section('content') - -
- - -
- @inject('catalogRuleGrid','Webkul\Admin\DataGrids\CatalogRuleDataGrid') - {!! $catalogRuleGrid->render() !!} -
-
-@endsection \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rules/create.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rules/create.blade.php new file mode 100644 index 000000000..30745564b --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rules/create.blade.php @@ -0,0 +1,528 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.promotions.catalog-rules.add-title') }} +@stop + +@section('content') +
+ + + +
+@stop + +@push('scripts') + @parent + + + + + + +@endpush \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rules/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rules/edit.blade.php new file mode 100644 index 000000000..d1a6aed4a --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rules/edit.blade.php @@ -0,0 +1,533 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.promotions.catalog-rules.edit-title') }} +@stop + +@section('content') +
+ + + +
+@stop + +@push('scripts') + @parent + + + + + + +@endpush \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rules/index.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rules/index.blade.php new file mode 100644 index 000000000..0139be19f --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rules/index.blade.php @@ -0,0 +1,27 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.promotions.catalog-rules.title') }} +@stop + +@section('content') + +
+ + +
+ @inject('catalogRuleGrid','Webkul\Admin\DataGrids\CatalogRuleDataGrid') + {!! $catalogRuleGrid->render() !!} +
+
+@endsection \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php index c635af49e..a1b28cbd0 100755 --- a/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php @@ -332,7 +332,13 @@ @if ($order->base_discount_amount > 0) - {{ __('admin::app.sales.orders.discount') }} + + {{ __('admin::app.sales.orders.discount') }} + + @if ($order->coupon_code) + ({{ $order->coupon_code }}) + @endif + - {{ core()->formatBasePrice($order->base_discount_amount) }} diff --git a/packages/Webkul/Admin/src/Resources/views/sales/shipments/view.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/shipments/view.blade.php index e88d7d50b..df955df12 100755 --- a/packages/Webkul/Admin/src/Resources/views/sales/shipments/view.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/sales/shipments/view.blade.php @@ -195,14 +195,14 @@
- @if ($shipment->inventory_source) + @if ($shipment->inventory_source || $shipment->inventory_source_name)
{{ __('admin::app.sales.shipments.inventory-source') }} - {{ $shipment->inventory_source->name }} + {{ $shipment->inventory_source ? $shipment->inventory_source->name : $shipment->inventory_source_name }}
@endif diff --git a/packages/Webkul/Admin/src/Resources/views/tax/tax-rates/create.blade.php b/packages/Webkul/Admin/src/Resources/views/tax/tax-rates/create.blade.php index 429fae5e9..ad7e0d48a 100755 --- a/packages/Webkul/Admin/src/Resources/views/tax/tax-rates/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/tax/tax-rates/create.blade.php @@ -45,7 +45,7 @@ @{{ errors.first('identifier') }} - @include ('admin::customers.country-state', ['countryCode' => old('country'), 'stateCode' => old('state')]) +
@@ -83,6 +83,50 @@
+ + @endpush \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/tax/tax-rates/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/tax/tax-rates/edit.blade.php index e86918f30..51d6638f3 100755 --- a/packages/Webkul/Admin/src/Resources/views/tax/tax-rates/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/tax/tax-rates/edit.blade.php @@ -36,7 +36,7 @@ @{{ errors.first('identifier') }} - @include ('admin::customers.country-state', ['countryCode' => old('country') ?? $taxRate->country, 'stateCode' => old('state') ?? $taxRate->state]) + @if ($taxRate->is_zip) @@ -70,4 +70,79 @@ -@stop \ No newline at end of file +@stop + +@push('scripts') + + + + +@endpush \ No newline at end of file diff --git a/packages/Webkul/Admin/webpack.mix.js b/packages/Webkul/Admin/webpack.mix.js index c1352b024..2b81e7e66 100755 --- a/packages/Webkul/Admin/webpack.mix.js +++ b/packages/Webkul/Admin/webpack.mix.js @@ -22,6 +22,10 @@ mix.js(__dirname + "/src/Resources/assets/js/app.js", "js/admin.js") processCssUrls: false }); +if (!mix.inProduction()) { + mix.sourceMaps(); +} + if (mix.inProduction()) { mix.version(); } \ No newline at end of file diff --git a/packages/Webkul/CMS/src/Http/Controllers/Shop/PagePresenterController.php b/packages/Webkul/CMS/src/Http/Controllers/Shop/PagePresenterController.php index b7e54981a..26ebb99a7 100644 --- a/packages/Webkul/CMS/src/Http/Controllers/Shop/PagePresenterController.php +++ b/packages/Webkul/CMS/src/Http/Controllers/Shop/PagePresenterController.php @@ -3,9 +3,8 @@ namespace Webkul\CMS\Http\Controllers\Shop; use Webkul\CMS\Http\Controllers\Controller; -use Webkul\CMS\Repositories\CMSRepository as CMS; -use Webkul\Core\Repositories\ChannelRepository as Channel; -use Webkul\Core\Repositories\LocaleRepository as Locale; +use Webkul\CMS\Repositories\CMSRepository; +use Webkul\Core\Repositories\LocaleRepository; /** * PagePresenter controller @@ -13,73 +12,58 @@ use Webkul\Core\Repositories\LocaleRepository as Locale; * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ - class PagePresenterController extends Controller +class PagePresenterController extends Controller { /** - * To hold the request variables from route file + * CMSRepository object + * + * @var Object */ - protected $_config; + protected $cmsRepository; /** - * To hold the channel reposotry instance + * LocaleRepository object + * + * @var Object */ - protected $channel; + protected $localeRepository; /** - * To hold the locale reposotry instance + * Create a new controller instance. + * + * @param \Webkul\CMS\Repositories\CMSRepository $cmsRepository + * @param \Webkul\Core\Repositories\LocaleRepository $localeRepository + * @return void */ - protected $locale; - - /** - * To hold the CMSRepository instance - */ - protected $cms; - - public function __construct(Channel $channel, Locale $locale, CMS $cms) + public function __construct( + CMSRepository $cmsRepository, + LocaleRepository $localeRepository + ) { - /** - * Channel repository instance - */ - $this->channel = $channel; + $this->cmsRepository = $cmsRepository; - /** - * Locale repository instance - */ - $this->locale = $locale; - - /** - * CMS repository instance - */ - $this->cms = $cms; - - $this->_config = request('_config'); + $this->localeRepository = $localeRepository; } /** - * To extract the page content and load it in the respective view file\ + * To extract the page content and load it in the respective view file * - * @return view + * @param string $slug + * @return \Illuminate\View\View */ public function presenter($slug) { - $currentChannel = core()->getCurrentChannel(); - $currentLocale = app()->getLocale(); + $currentLocale = $this->localeRepository->findOneByField('code', app()->getLocale()); - $currentLocale = $this->locale->findOneWhere([ - 'code' => $currentLocale - ]); + $page = $this->cmsRepository->findOneWhere([ + 'url_key' => $slug, + 'locale_id' => $currentLocale->id, + 'channel_id' => core()->getCurrentChannel()->id + ]); - $page = $this->cms->findOneWhere([ - 'url_key' => $slug, - 'locale_id' => $currentLocale->id, - 'channel_id' => $currentChannel->id - ]); - - if ($page) { - return view('shop::cms.page')->with('page', $page); - } else { + if (! $page) abort(404); - } + return view('shop::cms.page')->with('page', $page); } } \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Contracts/CartRule.php b/packages/Webkul/CartRule/src/Contracts/CartRule.php new file mode 100644 index 000000000..bbc60e2e2 --- /dev/null +++ b/packages/Webkul/CartRule/src/Contracts/CartRule.php @@ -0,0 +1,7 @@ +increments('id'); $table->string('name')->nullable(); $table->string('description')->nullable(); - $table->datetime('starts_from')->nullable(); - $table->datetime('ends_till')->nullable(); + $table->date('starts_from')->nullable(); + $table->date('ends_till')->nullable(); $table->boolean('status')->default(0); - $table->integer('per_customer')->unsigned()->default(0); - $table->boolean('is_guest')->default(0); - $table->boolean('use_coupon')->default(0); - $table->integer('usage_limit')->unsigned()->default(0); - $table->json('conditions')->nullable(); - $table->json('actions')->nullable(); - $table->boolean('end_other_rules')->default(0); - $table->integer('priority')->unsigned()->default(0); - $table->boolean('uses_attribute_conditions')->default(0); - $table->longtext('product_ids')->nullable(); - $table->integer('sort_order')->unsigned()->default(0); - $table->string('action_type')->nullable(); - $table->decimal('disc_amount', 12, 4)->default(0); - $table->decimal('disc_quantity', 12, 4)->default(1); - $table->string('disc_threshold')->default(1); $table->integer('coupon_type')->default(1); - $table->boolean('auto_generation')->default(0); + $table->boolean('use_auto_generation')->default(0); + $table->integer('usage_per_customer')->default(0); + $table->integer('uses_per_coupon')->default(0); + $table->integer('times_used')->unsigned()->default(0); + $table->boolean('condition_type')->default(1); + $table->json('conditions')->nullable(); + $table->boolean('end_other_rules')->default(0); + $table->boolean('uses_attribute_conditions')->default(0); + $table->string('action_type')->nullable(); + $table->decimal('discount_amount', 12, 4)->default(0); + $table->integer('discount_quantity')->default(1); + $table->string('discount_step')->default(1); $table->boolean('apply_to_shipping')->default(0); $table->boolean('free_shipping')->default(0); + $table->integer('sort_order')->unsigned()->default(0); $table->timestamps(); }); } diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_05_13_024340_create_cart_rule_channels_table.php b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024322_create_cart_rule_channels_table.php similarity index 91% rename from packages/Webkul/Discount/src/Database/Migrations/2019_05_13_024340_create_cart_rule_channels_table.php rename to packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024322_create_cart_rule_channels_table.php index 3808c6545..067a452fa 100644 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_05_13_024340_create_cart_rule_channels_table.php +++ b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024322_create_cart_rule_channels_table.php @@ -14,12 +14,13 @@ class CreateCartRuleChannelsTable extends Migration public function up() { Schema::create('cart_rule_channels', function (Blueprint $table) { - $table->increments('id'); $table->integer('cart_rule_id')->unsigned(); - $table->foreign('cart_rule_id')->references('id')->on('cart_rules')->onDelete('cascade'); $table->integer('channel_id')->unsigned(); + + $table->primary(['cart_rule_id', 'channel_id']); + + $table->foreign('cart_rule_id')->references('id')->on('cart_rules')->onDelete('cascade'); $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); - $table->timestamps(); }); } diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_05_13_024419_create_cart_rule_customer_groups_table.php b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024323_create_cart_rule_customer_groups_table.php similarity index 90% rename from packages/Webkul/Discount/src/Database/Migrations/2019_05_13_024419_create_cart_rule_customer_groups_table.php rename to packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024323_create_cart_rule_customer_groups_table.php index 4396b999a..312237d98 100644 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_05_13_024419_create_cart_rule_customer_groups_table.php +++ b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024323_create_cart_rule_customer_groups_table.php @@ -14,12 +14,14 @@ class CreateCartRuleCustomerGroupsTable extends Migration public function up() { Schema::create('cart_rule_customer_groups', function (Blueprint $table) { - $table->increments('id'); $table->integer('cart_rule_id')->unsigned(); - $table->foreign('cart_rule_id')->references('id')->on('cart_rules')->onDelete('cascade'); $table->integer('customer_group_id')->unsigned(); + + + $table->primary(['cart_rule_id', 'customer_group_id']); + + $table->foreign('cart_rule_id')->references('id')->on('cart_rules')->onDelete('cascade'); $table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade'); - $table->timestamps(); }); } diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_05_30_141207_create_cart_rule_cart_table.php b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024324_create_cart_rule_translations_table.php similarity index 54% rename from packages/Webkul/Discount/src/Database/Migrations/2019_05_30_141207_create_cart_rule_cart_table.php rename to packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024324_create_cart_rule_translations_table.php index 82c7505a0..9c71333d7 100644 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_05_30_141207_create_cart_rule_cart_table.php +++ b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024324_create_cart_rule_translations_table.php @@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class CreateCartRuleCartTable extends Migration +class CreateCartRuleTranslationsTable extends Migration { /** * Run the migrations. @@ -13,13 +13,13 @@ class CreateCartRuleCartTable extends Migration */ public function up() { - Schema::create('cart_rule_cart', function (Blueprint $table) { + Schema::create('cart_rule_translations', function (Blueprint $table) { $table->increments('id'); - $table->integer('cart_rule_id')->unsigned()->nullable(); + $table->string('locale'); + $table->text('label')->nullable(); + $table->integer('cart_rule_id')->unsigned(); + $table->unique(['cart_rule_id', 'locale']); $table->foreign('cart_rule_id')->references('id')->on('cart_rules')->onDelete('cascade'); - $table->integer('cart_id')->unsigned()->nullable(); - $table->foreign('cart_id')->references('id')->on('cart')->onDelete('cascade'); - $table->timestamps(); }); } @@ -30,6 +30,6 @@ class CreateCartRuleCartTable extends Migration */ public function down() { - Schema::dropIfExists('cart_rule_cart'); + Schema::dropIfExists('cart_rule_translations'); } } diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_05_23_175727_create_cart_rule_customers_table.php b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024325_create_cart_rule_customers_table.php similarity index 84% rename from packages/Webkul/Discount/src/Database/Migrations/2019_05_23_175727_create_cart_rule_customers_table.php rename to packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024325_create_cart_rule_customers_table.php index fbe323ab1..a16452c6f 100644 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_05_23_175727_create_cart_rule_customers_table.php +++ b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024325_create_cart_rule_customers_table.php @@ -15,12 +15,13 @@ class CreateCartruleCustomersTable extends Migration { Schema::create('cart_rule_customers', function (Blueprint $table) { $table->increments('id'); + $table->bigInteger('times_used')->unsigned()->default(0); + $table->integer('cart_rule_id')->unsigned(); $table->foreign('cart_rule_id')->references('id')->on('cart_rules')->onDelete('cascade'); + $table->integer('customer_id')->unsigned(); $table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade'); - $table->bigInteger('usage_throttle')->unsigned()->default(0); - $table->timestamps(); }); } @@ -31,6 +32,6 @@ class CreateCartruleCustomersTable extends Migration */ public function down() { - Schema::dropIfExists('cart_rule_customers'); + Schema::dropIfExists('cartrule_customers'); } } diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_05_23_180457_create_cart_rule_coupons_table.php b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024326_create_cart_rule_coupons_table.php similarity index 80% rename from packages/Webkul/Discount/src/Database/Migrations/2019_05_23_180457_create_cart_rule_coupons_table.php rename to packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024326_create_cart_rule_coupons_table.php index 67eea0030..89741800e 100644 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_05_23_180457_create_cart_rule_coupons_table.php +++ b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024326_create_cart_rule_coupons_table.php @@ -15,15 +15,16 @@ class CreateCartruleCouponsTable extends Migration { Schema::create('cart_rule_coupons', function (Blueprint $table) { $table->increments('id'); - $table->integer('cart_rule_id')->unsigned(); - $table->foreign('cart_rule_id')->references('id')->on('cart_rules')->onDelete('cascade'); - $table->string('prefix')->nullable(); - $table->string('suffix')->nullable(); $table->string('code')->nullable(); $table->integer('usage_limit')->unsigned()->default(0); $table->integer('usage_per_customer')->unsigned()->default(0); - $table->integer('usage_throttle')->unsigned()->default(0); + $table->integer('times_used')->unsigned()->default(0); $table->integer('type')->unsigned()->default(0); + $table->boolean('is_primary')->default(0); + $table->date('expired_at')->nullable(); + + $table->integer('cart_rule_id')->unsigned(); + $table->foreign('cart_rule_id')->references('id')->on('cart_rules')->onDelete('cascade'); $table->timestamps(); }); } @@ -35,6 +36,6 @@ class CreateCartruleCouponsTable extends Migration */ public function down() { - Schema::dropIfExists('cart_rule_coupons'); + Schema::dropIfExists('cartrule_coupons'); } } diff --git a/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024327_create_cart_rule_coupon_usage_table.php b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024327_create_cart_rule_coupon_usage_table.php new file mode 100644 index 000000000..ae0339b0a --- /dev/null +++ b/packages/Webkul/CartRule/src/Database/Migrations/2019_05_13_024327_create_cart_rule_coupon_usage_table.php @@ -0,0 +1,37 @@ +increments('id'); + $table->integer('times_used')->default(0); + + $table->integer('cart_rule_coupon_id')->unsigned(); + $table->foreign('cart_rule_coupon_id')->references('id')->on('cart_rule_coupons')->onDelete('cascade'); + + $table->integer('customer_id')->unsigned(); + $table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('cart_rule_coupon_usage'); + } +} diff --git a/packages/Webkul/CartRule/src/Helpers/CartRule.php b/packages/Webkul/CartRule/src/Helpers/CartRule.php new file mode 100644 index 000000000..8ad0c4dac --- /dev/null +++ b/packages/Webkul/CartRule/src/Helpers/CartRule.php @@ -0,0 +1,523 @@ +cartRuleRepository = $cartRuleRepository; + + $this->cartRuleCouponRepository = $cartRuleCouponRepository; + + $this->cartRuleCouponUsageRepository = $cartRuleCouponUsageRepository; + + $this->cartRuleCustomerRepository = $cartRuleCustomerRepository; + + $this->customerGroupRepository = $customerGroupRepository; + + $this->validator = $validator; + } + + /** + * Collect discount on cart + * + * @return void + */ + public function collect() + { + $cart = Cart::getCart(); + + $this->calculateCartItemTotals($cart->items()->get()); + + foreach ($cart->items()->get() as $item) { + $this->process($item); + + if ($item->children()->count() && $item->product->getTypeInstance()->isChildrenCalculated()) + $this->devideDiscount($item); + } + + $this->processShippingDiscount($cart); + + $this->processFreeShippingDiscount($cart); + + $this->validateCouponCode(); + } + + /** + * Returns cart rules + * + * @return Collection + */ + public function getCartRules() + { + static $cartRules; + + if ($cartRules) + return $cartRules; + + $customerGroupId = null; + + if (Cart::getCurrentCustomer()->check()) { + $customerGroupId = Cart::getCurrentCustomer()->user()->customer_group_id; + } else { + if ($customerGuestGroup = $this->customerGroupRepository->findOneByField('code', 'guest')) + $customerGroupId = $customerGuestGroup->id; + } + + $cartRules = $this->cartRuleRepository->scopeQuery(function($query) use ($customerGroupId) { + return $query->leftJoin('cart_rule_customer_groups', 'cart_rules.id', '=', 'cart_rule_customer_groups.cart_rule_id') + ->leftJoin('cart_rule_channels', 'cart_rules.id', '=', 'cart_rule_channels.cart_rule_id') + ->where('cart_rule_customer_groups.customer_group_id', $customerGroupId) + ->where('cart_rule_channels.channel_id', core()->getCurrentChannel()->id) + ->where(function ($query1) { + $query1->where('cart_rules.starts_from', '<=', Carbon::now()->format('Y-m-d'))->orWhereNull('cart_rules.starts_from'); + }) + ->where(function ($query2) { + $query2->where('cart_rules.ends_till', '>=', Carbon::now()->format('Y-m-d'))->orWhereNull('cart_rules.ends_till'); + }) + ->orderBy('sort_order', 'asc'); + })->findWhere(['status' => 1]); + + return $cartRules; + } + + /** + * Check if cart rule can be applied + * + * @param CartRule $rule + * @return boolean + */ + public function canProcessRule($rule) + { + $cart = Cart::getCart(); + + if ($rule->coupon_type) { + if (strlen($cart->coupon_code)) { + $coupon = $this->cartRuleCouponRepository->findOneWhere([ + 'cart_rule_id' => $rule->id, + 'code' => $cart->coupon_code, + ]); + + if ($coupon) { + if ($coupon->usage_limit && $coupon->times_used >= $coupon->usage_limit) + return false; + + if ($cart->customer_id && $coupon->usage_per_customer) { + $couponUsage = $this->cartRuleCouponUsageRepository->findOneWhere([ + 'cart_rule_coupon_id' => $coupon->id, + 'customer_id' => $cart->customer_id + ]); + + if ($couponUsage && $couponUsage->times_used >= $coupon->usage_per_customer) + return false; + } + } else { + return false; + } + } else { + return false; + } + } + + if ($rule->usage_per_customer) { + $ruleCustomer = $this->cartRuleCustomerRepository->findOneWhere([ + 'cart_rule_id' => $rule->id, + 'customer_id' => $cart->customer_id, + ]); + + if ($ruleCustomer && $ruleCustomer->times_used >= $rule->usage_per_customer) + return false; + } + + return true; + } + + /** + * Cart item discount calculation process + * + * @param CartItem $item + * @return void + */ + public function process($item) + { + $item->discount_percent = 0; + $item->discount_amount = 0; + $item->base_discount_amount = 0; + + $cart = $item->cart; + + $cart->applied_cart_rule_ids = null; + + $appliedRuleIds = []; + + foreach ($this->getCartRules() as $rule) { + if (! $this->canProcessRule($rule)) + continue; + + if (! $this->validator->validate($rule, $item)) + continue; + + $quantity = $rule->discount_quantity ? min($item->quantity, $rule->discount_quantity) : $item->quantity; + + $discountAmount = $baseDiscountAmount = 0; + + switch ($rule->action_type) { + case 'by_percent': + $rulePercent = min(100, $rule->discount_amount); + + $discountAmount = ($quantity * $item->price - $item->discount_amount) * ($rulePercent / 100); + + $baseDiscountAmount = ($quantity * $item->base_price - $item->base_discount_amount) * ($rulePercent / 100); + + if (! $rule->discount_quantity || $rule->discount_quantity > $quantity) { + $discountPercent = min(100, $item->discount_percent + $rulePercent); + + $item->discount_percent = $discountPercent; + } + + break; + + case 'by_fixed': + $discountAmount = $quantity * core()->convertPrice($rule->discount_amount); + + $baseDiscountAmount = $quantity * $rule->discount_amount; + + break; + + case 'cart_fixed': + if ($this->itemTotals[$rule->id]['total_items'] <= 1) { + $discountAmount = core()->convertPrice($rule->discount_amount); + + $baseDiscountAmount = min($item->base_price * $quantity, $rule->discount_amount); + } else { + $discountRate = $item->base_price * $quantity / $this->itemTotals[$rule->id]['base_total_price']; + + $maxDiscount = $rule->discount_amount * $discountRate; + + $discountAmount = core()->convertPrice($maxDiscount); + + $baseDiscountAmount = min($item->base_price * $quantity, $maxDiscount); + } + + $discountAmount = min($item->price * $quantity, $discountAmount); + + break; + + case 'buy_x_get_y': + if (! $rule->discount_step || $rule->discount_amount > $rule->discount_step) + break; + + $buyAndDiscountQty = $rule->discount_step + $rule->discount_amount; + + $qtyPeriod = floor($quantity / $buyAndDiscountQty); + + $freeQty = $quantity - $qtyPeriod * $buyAndDiscountQty; + + $discountQty = $qtyPeriod * $rule->discount_amount; + + if ($freeQty > $rule->discount_step) + $discountQty += $freeQty - $rule->discount_step; + + $discountAmount = $discountQty * $item->price; + + $baseDiscountAmount = $discountQty * $item->base_price; + + break; + } + + $item->discount_amount = min($item->discount_amount + $discountAmount, $item->price * $quantity); + $item->base_discount_amount = min($item->base_discount_amount + $baseDiscountAmount, $item->base_price * $quantity); + + $appliedRuleIds[$rule->id] = $rule->id; + + if ($rule->end_other_rules) + break; + } + + $item->applied_cart_rule_ids = join(',', $appliedRuleIds); + + $item->save(); + + $cartAppliedCartRuleIds = array_merge(explode(',', $cart->applied_cart_rule_ids), $appliedRuleIds); + + $cartAppliedCartRuleIds = array_filter($cartAppliedCartRuleIds); + + $cartAppliedCartRuleIds = array_unique($cartAppliedCartRuleIds); + + $cart->applied_cart_rule_ids = join(',', $cartAppliedCartRuleIds); + + $cart->save(); + } + + /** + * Cart shipping discount calculation process + * + * @param Cart $cart + * @return void + */ + public function processShippingDiscount($cart) + { + if (! $selectedShipping = $cart->selected_shipping_rate) + return; + + $selectedShipping->discount_amount = 0; + $selectedShipping->base_discount_amount = 0; + + $appliedRuleIds = []; + + foreach ($this->getCartRules() as $rule) { + if (! $this->canProcessRule($rule)) + continue; + + if (! $this->validator->validate($rule, $cart)) + continue; + + if (! $rule || ! $rule->apply_to_shipping) + continue; + + $discountAmount = $baseDiscountAmount = 0; + + switch ($rule->action_type) { + case 'by_percent': + $rulePercent = min(100, $rule->discount_amount); + + $discountAmount = ($selectedShipping->price - $selectedShipping->discount_amount) * $rulePercent / 100; + + $baseDiscountAmount = ($selectedShipping->base_price - $selectedShipping->base_discount_amount) * $rulePercent / 100; + + break; + + case 'by_fixed': + $discountAmount = core()->convertPrice($rule->discount_amount); + + $baseDiscountAmount = $rule->discount_amount; + + break; + } + + $selectedShipping->discount_amount = min($selectedShipping->discount_amount + $discountAmount, $selectedShipping->price); + + $selectedShipping->base_discount_amount = min( + $selectedShipping->base_discount_amount + $baseDiscountAmount, + $selectedShipping->base_price + ); + + $selectedShipping->save(); + + $appliedRuleIds[$rule->id] = $rule->id; + + if ($rule->end_other_rules) + break; + } + + $selectedShipping->save(); + + $cartAppliedCartRuleIds = array_merge(explode(',', $cart->applied_cart_rule_ids), $appliedRuleIds); + + $cartAppliedCartRuleIds = array_filter($cartAppliedCartRuleIds); + + $cartAppliedCartRuleIds = array_unique($cartAppliedCartRuleIds); + + $cart->applied_cart_rule_ids = join(',', $cartAppliedCartRuleIds); + + $cart->save(); + + return $this; + } + + /** + * Cart free shipping discount calculation process + * + * @param Cart $cart + * @return void + */ + public function processFreeShippingDiscount($cart) + { + if (! $selectedShipping = $cart->selected_shipping_rate) + return; + + $selectedShipping->discount_amount = 0; + + $selectedShipping->base_discount_amount = 0; + + $appliedRuleIds = []; + + foreach ($this->getCartRules() as $rule) { + if (! $this->canProcessRule($rule)) + continue; + + if (! $this->validator->validate($rule, $cart)) + continue; + + if (! $rule || ! $rule->free_shipping) + continue; + + $selectedShipping->price = 0; + + $selectedShipping->base_price = 0; + + $selectedShipping->save(); + + $appliedRuleIds[$rule->id] = $rule->id; + + if ($rule->end_other_rules) + break; + } + + $cartAppliedCartRuleIds = array_merge(explode(',', $cart->applied_cart_rule_ids), $appliedRuleIds); + + $cartAppliedCartRuleIds = array_filter($cartAppliedCartRuleIds); + + $cartAppliedCartRuleIds = array_unique($cartAppliedCartRuleIds); + + $cart->applied_cart_rule_ids = join(',', $cartAppliedCartRuleIds); + + $cart->save(); + } + + /** + * Calculate cart item totals for each rule + * + * @param mixed $items + * @return Validator + */ + public function calculateCartItemTotals($items) + { + foreach ($this->getCartRules() as $rule) { + if ($rule->action_type == 'cart_fixed') { + $totalPrice = $totalBasePrice = $validCount = 0; + + foreach ($items as $item) { + if (! $this->canProcessRule($rule, $item)) + continue; + + $quantity = $rule->discount_quantity ? min($item->quantity, $rule->discount_quantity) : $item->quantity; + + $totalBasePrice += $item->base_price * $quantity; + + $validCount++; + } + + $this->itemTotals[$rule->id] = [ + 'base_total_price' => $totalBasePrice, + 'total_items' => $validCount, + ]; + } + } + } + + /** + * Check if coupon code is valid or not, if not remove from cart + * + * @return void + */ + public function validateCouponCode() + { + $cart = Cart::getCart(); + + if (! $cart->coupon_code) + return; + + $coupon = $this->cartRuleCouponRepository->findOneByField('code', $cart->coupon_code); + + if (! $coupon || ! in_array($coupon->cart_rule_id, explode(',', $cart->applied_cart_rule_ids))) + Cart::removeCouponCode(); + } + + /** + * Devide discount amount to children + * + * @param CartItem $item + * @return void + */ + protected function devideDiscount($item) + { + foreach ($item->children as $child) { + $ratio = $item->base_total != 0 ? $child->base_total / $item->base_total : 0; + + foreach (['discount_amount', 'base_discount_amount'] as $column) { + if (! $item->{$column}) + continue; + + $child->{$column} = round(($item->{$column} * $ratio), 4); + + $child->save(); + } + } + } +} \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Http/Controllers/CartRuleController.php b/packages/Webkul/CartRule/src/Http/Controllers/CartRuleController.php new file mode 100644 index 000000000..dc90a01b5 --- /dev/null +++ b/packages/Webkul/CartRule/src/Http/Controllers/CartRuleController.php @@ -0,0 +1,206 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CartRuleController extends Controller +{ + /** + * Initialize _config, a default request parameter with route + * + * @param array + */ + protected $_config; + + /** + * To hold Cart repository instance + * + * @var CartRuleRepository + */ + protected $cartRuleRepository; + + /** + * To hold CartRuleCouponRepository repository instance + * + * @var CartRuleCouponRepository + */ + protected $cartRuleCouponRepository; + + /** + * Create a new controller instance. + * + * @param \Webkul\CartRule\Repositories\CartRuleRepository $cartRuleRepository + * @param \Webkul\CartRule\Repositories\CartRuleCouponRepository $cartRuleCouponRepository + * @return void + */ + public function __construct( + CartRuleRepository $cartRuleRepository, + CartRuleCouponRepository $cartRuleCouponRepository + ) + { + $this->_config = request('_config'); + + $this->cartRuleRepository = $cartRuleRepository; + + $this->cartRuleCouponRepository = $cartRuleCouponRepository; + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view($this->_config['view']); + } + + /** + * Store a newly created resource in storage. + * + * @return \Illuminate\Http\Response + */ + public function store() + { + $this->validate(request(), [ + 'name' => 'required', + 'channels' => 'required|array|min:1', + 'customer_groups' => 'required|array|min:1', + 'coupon_type' => 'required', + 'use_auto_generation' => 'required_if:coupon_type,==,1', + 'coupon_code' => 'required_if:use_auto_generation,==,0', + 'starts_from' => 'nullable|date', + 'ends_till' => 'nullable|date|after_or_equal:starts_from', + 'action_type' => 'required', + 'discount_amount' => 'required|numeric' + ]); + + $data = request()->all(); + + Event::fire('promotions.cart_rule.create.before'); + + $cartRule = $this->cartRuleRepository->create($data); + + Event::fire('promotions.cart_rule.create.after', $cartRule); + + session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Cart Rule'])); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $cartRule = $this->cartRuleRepository->findOrFail($id); + + return view($this->_config['view'], compact('cartRule')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $this->validate(request(), [ + 'name' => 'required', + 'channels' => 'required|array|min:1', + 'customer_groups' => 'required|array|min:1', + 'coupon_type' => 'required', + 'use_auto_generation' => 'required_if:coupon_type,==,1', + 'coupon_code' => 'required_if:use_auto_generation,==,0', + 'starts_from' => 'nullable|date', + 'ends_till' => 'nullable|date|after_or_equal:starts_from', + 'action_type' => 'required', + 'discount_amount' => 'required|numeric' + ]); + + $cartRule = $this->cartRuleRepository->findOrFail($id); + + Event::fire('promotions.cart_rule.update.before', $cartRule); + + $cartRule = $this->cartRuleRepository->update(request()->all(), $id); + + Event::fire('promotions.cart_rule.update.after', $cartRule); + + session()->flash('success', trans('admin::app.response.update-success', ['name' => 'Cart Rule'])); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + $cartRule = $this->cartRuleRepository->findOrFail($id); + + try { + Event::fire('promotions.cart_rule.delete.before', $id); + + $this->cartRuleRepository->delete($id); + + Event::fire('promotions.cart_rule.delete.after', $id); + + session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Cart Rule'])); + + return response()->json(['message' => true], 200); + } catch(\Exception $e) { + session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Cart Rule'])); + } + + return response()->json(['message' => false], 400); + } + + /** + * Generate coupon code for cart rule + * + * @return \Illuminate\Http\JsonResponse + */ + public function generateCoupons() + { + $this->validate(request(), [ + 'coupon_qty' => 'required|integer|min:1', + 'code_length' => 'required|integer|min:10', + 'code_format' => 'required' + ]); + + if (! request('id')) + return response()->json(['message' => trans('admin::app.promotions.cart-rules.cart-rule-not-defind-error')], 400); + + $this->cartRuleCouponRepository->generateCoupons(request()->all(), request('id')); + + return response()->json(['message' => trans('admin::app.response.create-success', ['name' => 'Cart rule coupons'])]); + } +} \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Http/Controllers/CartRuleCouponController.php b/packages/Webkul/CartRule/src/Http/Controllers/CartRuleCouponController.php new file mode 100644 index 000000000..7da633cb8 --- /dev/null +++ b/packages/Webkul/CartRule/src/Http/Controllers/CartRuleCouponController.php @@ -0,0 +1,55 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CartRuleCouponController extends Controller +{ + /** + * To hold CartRuleCouponRepository repository instance + * + * @var CartRuleCouponRepository + */ + protected $cartRuleCouponRepository; + + /** + * Create a new controller instance. + * + * @param \Webkul\CartRule\Repositories\CartRuleCouponRepository $cartRuleCouponRepository + * @return void + */ + public function __construct(CartRuleCouponRepository $cartRuleCouponRepository) + { + $this->cartRuleCouponRepository = $cartRuleCouponRepository; + } + + /** + * Mass Delete the coupons + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function massDelete() + { + $couponIds = explode(',', request()->input('indexes')); + + foreach ($couponIds as $couponId) { + $coupon = $this->cartRuleCouponRepository->find($couponId); + + if ($coupon) + $this->cartRuleCouponRepository->delete($couponId); + } + + session()->flash('success', trans('admin::app.promotions.cart-rules.mass-delete-success')); + + return redirect()->back(); + } +} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Http/Controllers/Controller.php b/packages/Webkul/CartRule/src/Http/Controllers/Controller.php similarity index 87% rename from packages/Webkul/Discount/src/Http/Controllers/Controller.php rename to packages/Webkul/CartRule/src/Http/Controllers/Controller.php index dc4b61e7c..259457d89 100644 --- a/packages/Webkul/Discount/src/Http/Controllers/Controller.php +++ b/packages/Webkul/CartRule/src/Http/Controllers/Controller.php @@ -1,9 +1,9 @@ + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class Cart +{ + /** + * CartRule object + * + * @var CartRule + */ + protected $cartRuleHepler; + + /** + * Create a new listener instance. + * + * @param Webkul\CartRule\Repositories\CartRule $cartRuleHepler + * @return void + */ + public function __construct(CartRule $cartRuleHepler) + { + $this->cartRuleHepler = $cartRuleHepler; + } + + /** + * Aplly valid cart rules to cart + * + * @param Cart $cart + * @return void + */ + public function applyCartRules($cart) + { + $this->cartRuleHepler->collect(); + } +} \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Listeners/Order.php b/packages/Webkul/CartRule/src/Listeners/Order.php new file mode 100755 index 000000000..f22fdfa35 --- /dev/null +++ b/packages/Webkul/CartRule/src/Listeners/Order.php @@ -0,0 +1,139 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class Order +{ + /** + * CartRuleRepository object + * + * @var CartRuleRepository + */ + protected $cartRuleRepository; + + /** + * CartRuleCustomerRepository object + * + * @var CartRuleCustomerRepository + */ + protected $cartRuleCustomerRepository; + + /** + * CartRuleCouponRepository object + * + * @var CartRuleCouponRepository + */ + protected $cartRuleCouponRepository; + + /** + * CartRuleCouponUsageRepository object + * + * @var CartRuleCouponUsageRepository + */ + protected $cartRuleCouponUsageRepository; + + /** + * Create a new listener instance. + * + * @param Webkul\CartRule\Repositories\CartRuleRepository $cartRuleRepository + * @param Webkul\CartRule\Repositories\CartRuleCustomerRepository $cartRuleCustomerRepository + * @param Webkul\CartRule\Repositories\CartRuleCouponRepository $cartRuleCouponRepository + * @param Webkul\CartRule\Repositories\CartRuleCouponUsageRepository $cartRuleCouponUsageRepository + * @return void + */ + public function __construct( + CartRuleRepository $cartRuleRepository, + CartRuleCustomerRepository $cartRuleCustomerRepository, + CartRuleCouponRepository $cartRuleCouponRepository, + CartRuleCouponUsageRepository $cartRuleCouponUsageRepository + ) + { + $this->cartRuleRepository = $cartRuleRepository; + + $this->cartRuleCustomerRepository = $cartRuleCustomerRepository; + + $this->cartRuleCouponRepository = $cartRuleCouponRepository; + + $this->cartRuleCouponUsageRepository = $cartRuleCouponUsageRepository; + } + + /** + * Save cart rule and cart rule coupon properties after place order + * + * @param Order $order + * @return void + */ + public function manageCartRule($order) + { + if (! $order->discount_amount) + return; + + $cartRuleIds = explode(',', $order->applied_cart_rule_ids); + + $cartRuleIds = array_unique($cartRuleIds); + + foreach ($cartRuleIds as $ruleId) { + $rule = $this->cartRuleRepository->find($ruleId); + + if (! $rule) + continue; + + $rule->update(['times_used' => $rule->times_used + 1]); + + if (! $order->customer_id) + continue; + + $ruleCustomer = $this->cartRuleCustomerRepository->findOneWhere([ + 'customer_id' => $order->customer_id, + 'cart_rule_id' => $ruleId + ]); + + if ($ruleCustomer) { + $this->cartRuleCustomerRepository->update(['times_used' => $ruleCustomer->times_used + 1], $ruleCustomer->id); + } else { + $this->cartRuleCustomerRepository->create([ + 'customer_id' => $order->customer_id, + 'cart_rule_id' => $ruleId, + 'times_used' => 1 + ]); + } + } + + if (! $order->coupon_code) + return; + + $coupon = $this->cartRuleCouponRepository->findOneByField('code', $order->coupon_code); + + if ($coupon) { + $this->cartRuleCouponRepository->update(['times_used' => $coupon->times_used + 1], $coupon->id); + + if ($order->customer_id) { + $couponUsage = $this->cartRuleCouponUsageRepository->findOneWhere([ + 'customer_id' => $order->customer_id, + 'cart_rule_coupon_id' => $coupon->id + ]); + + if ($couponUsage) { + $this->cartRuleCouponUsageRepository->update(['times_used' => $couponUsage->times_used + 1], $couponUsage->id); + } else { + $this->cartRuleCouponUsageRepository->create([ + 'customer_id' => $order->customer_id, + 'cart_rule_coupon_id' => $coupon->id, + 'times_used' => 1 + ]); + } + } + } + } +} \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Models/CartRule.php b/packages/Webkul/CartRule/src/Models/CartRule.php new file mode 100644 index 000000000..6392a1c59 --- /dev/null +++ b/packages/Webkul/CartRule/src/Models/CartRule.php @@ -0,0 +1,66 @@ + 'array', + ]; + + // public $translatedAttributes = ['name']; + + /** + * Get the channels that owns the cart rule. + */ + public function channels() + { + return $this->belongsToMany(ChannelProxy::modelClass(), 'cart_rule_channels'); + } + + /** + * Get the customer groups that owns the cart rule. + */ + public function customer_groups() + { + return $this->belongsToMany(CustomerGroupProxy::modelClass(), 'cart_rule_customer_groups'); + } + + /** + * Get the coupons that owns the cart rule. + */ + public function coupons() + { + return $this->hasOne(CartRuleCouponProxy::modelClass()); + } + + /** + * Get primary coupon code for cart rule. + */ + public function coupon_code() + { + return $this->coupons()->where('is_primary', 1); + } + + /** + * Get primary coupon code for cart rule. + */ + public function getCouponCodeAttribute() + { + $coupon = $this->coupon_code()->first(); + + if (! $coupon) + return; + + return $coupon->code; + } +} \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Models/CartRuleCoupon.php b/packages/Webkul/CartRule/src/Models/CartRuleCoupon.php new file mode 100644 index 000000000..045af59a1 --- /dev/null +++ b/packages/Webkul/CartRule/src/Models/CartRuleCoupon.php @@ -0,0 +1,19 @@ +belongsTo(CartRuleProxy::modelClass()); + } +} \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Models/CartRuleCouponProxy.php b/packages/Webkul/CartRule/src/Models/CartRuleCouponProxy.php new file mode 100644 index 000000000..4a8f20030 --- /dev/null +++ b/packages/Webkul/CartRule/src/Models/CartRuleCouponProxy.php @@ -0,0 +1,10 @@ +loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); + + $this->app->register(EventServiceProvider::class); + } + + /** + * Register services. + * + * @return void + */ + public function register() + { + } +} \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Providers/EventServiceProvider.php b/packages/Webkul/CartRule/src/Providers/EventServiceProvider.php new file mode 100755 index 000000000..a5b5d7133 --- /dev/null +++ b/packages/Webkul/CartRule/src/Providers/EventServiceProvider.php @@ -0,0 +1,21 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CartRuleCouponRepository extends Repository +{ + /** + * @var array + */ + protected $charsets = [ + 'alphanumeric' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', + 'alphabetical' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'numeric' => '0123456789' + ]; + + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\CartRule\Contracts\CartRuleCoupon'; + } + + /** + * Creates coupons for cart rule + * + * @param array $data + * @param integer $cartRuleId + * @return void + */ + public function generateCoupons($data, $cartRuleId) + { + $cartRule = app('Webkul\CartRule\Repositories\CartRuleRepository')->findOrFail($cartRuleId); + + for ($i = 0; $i < $data['coupon_qty']; $i++) { + parent::create([ + 'cart_rule_id' => $cartRuleId, + 'code' => $data['code_prefix'] . $this->getRandomString($data['code_format'], $data['code_length']) . $data['code_suffix'], + 'usage_limit' => $cartRule->uses_per_coupon ?? 0, + 'usage_per_customer' => $cartRule->usage_per_customer ?? 0, + 'is_primary' => 0, + 'expired_at' => $cartRule->ends_till ?: null + ]); + } + } + + /** + * Creates coupons for cart rule + * + * @param string $format + * @param integer $length + * @return string + */ + public function getRandomString($format, $length) + { + $couponCode = ''; + + for ($i = 0; $i < $length; $i++) { + $couponCode .= $this->charsets[$format][rand(0, strlen($this->charsets[$format]) - 1)]; + } + + return $couponCode; + } +} \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Repositories/CartRuleCouponUsageRepository.php b/packages/Webkul/CartRule/src/Repositories/CartRuleCouponUsageRepository.php new file mode 100755 index 000000000..5d6350ba8 --- /dev/null +++ b/packages/Webkul/CartRule/src/Repositories/CartRuleCouponUsageRepository.php @@ -0,0 +1,24 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CartRuleCouponUsageRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\CartRule\Contracts\CartRuleCouponUsage'; + } +} \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Repositories/CartRuleCustomerRepository.php b/packages/Webkul/CartRule/src/Repositories/CartRuleCustomerRepository.php new file mode 100755 index 000000000..e3218eb94 --- /dev/null +++ b/packages/Webkul/CartRule/src/Repositories/CartRuleCustomerRepository.php @@ -0,0 +1,24 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CartRuleCustomerRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\CartRule\Contracts\CartRuleCustomer'; + } +} \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Repositories/CartRuleRepository.php b/packages/Webkul/CartRule/src/Repositories/CartRuleRepository.php new file mode 100755 index 000000000..80847ee67 --- /dev/null +++ b/packages/Webkul/CartRule/src/Repositories/CartRuleRepository.php @@ -0,0 +1,478 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CartRuleRepository extends Repository +{ + /** + * AttributeFamilyRepository object + * + * @var AttributeFamilyRepository + */ + protected $attributeFamilyRepository; + + /** + * AttributeRepository object + * + * @var AttributeRepository + */ + protected $attributeRepository; + + /** + * CategoryRepository class + * + * @var CategoryRepository + */ + protected $categoryRepository; + + /** + * CartRuleCouponRepository object + * + * @var CartRuleCouponRepository + */ + protected $cartRuleCouponRepository; + + /** + * TaxCategoryRepository class + * + * @var TaxCategoryRepository + */ + protected $taxCategoryRepository; + + /** + * CountryRepository class + * + * @var CountryRepository + */ + protected $countryRepository; + + /** + * CountryStateRepository class + * + * @var CountryStateRepository + */ + protected $countryStateRepository; + + /** + * Create a new repository instance. + * + * @param Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamilyRepository + * @param Webkul\Attribute\Repositories\AttributeRepository $attributeRepository + * @param Webkul\Category\Repositories\CategoryRepository $categoryRepository + * @param Webkul\CartRule\Repositories\CartRuleCouponRepository $cartRuleCouponRepository + * @param Webkul\Tax\Repositories\TaxCategoryRepository $taxCategoryRepository + * @param Webkul\Core\Repositories\CountryRepository $countryRepository + * @param Webkul\Core\Repositories\CountryStateRepository $countryStateRepository + * @param Illuminate\Container\Container $app + * @return void + */ + public function __construct( + AttributeFamilyRepository $attributeFamilyRepository, + AttributeRepository $attributeRepository, + CategoryRepository $categoryRepository, + CartRuleCouponRepository $cartRuleCouponRepository, + TaxCategoryRepository $taxCategoryRepository, + CountryRepository $countryRepository, + CountryStateRepository $countryStateRepository, + App $app + ) + { + $this->attributeFamilyRepository = $attributeFamilyRepository; + + $this->attributeRepository = $attributeRepository; + + $this->categoryRepository = $categoryRepository; + + $this->cartRuleCouponRepository = $cartRuleCouponRepository; + + $this->taxCategoryRepository = $taxCategoryRepository; + + $this->countryRepository = $countryRepository; + + $this->countryStateRepository = $countryStateRepository; + + parent::__construct($app); + } + + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\CartRule\Contracts\CartRule'; + } + + /** + * @param array $data + * @return mixed + */ + public function create(array $data) + { + $data['starts_from'] = $data['starts_from'] ?: null; + + $data['ends_till'] = $data['ends_till'] ?: null; + + $data['status'] = ! isset($data['status']) ? 0 : 1; + + $cartRule = parent::create($data); + + $cartRule->channels()->sync($data['channels']); + + $cartRule->customer_groups()->sync($data['customer_groups']); + + if ($data['coupon_type'] && ! $data['use_auto_generation']) { + $this->cartRuleCouponRepository->create([ + 'cart_rule_id' => $cartRule->id, + 'code' => $data['coupon_code'], + 'usage_limit' => $data['usage_per_customer'] ?? 0, + 'usage_per_customer' => $data['usage_per_customer'] ?? 0, + 'is_primary' => 1, + 'expired_at' => $data['ends_till'] ?: null + ]); + } + + return $cartRule; + } + + /** + * @param array $data + * @param array $id + * @param string $attribute + * @return mixed + */ + public function update(array $data, $id, $attribute = "id") + { + $data['starts_from'] = $data['starts_from'] ?: null; + + $data['ends_till'] = $data['ends_till'] ?: null; + + $data['status'] = ! isset($data['status']) ? 0 : 1; + + $data['conditions'] = $data['conditions'] ?? []; + + $cartRule = $this->find($id); + + parent::update($data, $id, $attribute); + + $cartRule->channels()->sync($data['channels']); + + $cartRule->customer_groups()->sync($data['customer_groups']); + + if ($data['coupon_type']) { + if (! $data['use_auto_generation']) { + $cartRuleCoupon = $this->cartRuleCouponRepository->findOneWhere(['is_primary' => 1, 'cart_rule_id' => $cartRule->id]); + + if ($cartRuleCoupon) { + $this->cartRuleCouponRepository->update([ + 'code' => $data['coupon_code'], + 'usage_limit' => $data['uses_per_coupon'] ?? 0, + 'usage_per_customer' => $data['usage_per_customer'] ?? 0, + 'expired_at' => $data['ends_till'] ?: null + ], $cartRuleCoupon->id); + } else { + $this->cartRuleCouponRepository->create([ + 'cart_rule_id' => $cartRule->id, + 'code' => $data['coupon_code'], + 'usage_limit' => $data['uses_per_coupon'] ?? 0, + 'usage_per_customer' => $data['usage_per_customer'] ?? 0, + 'is_primary' => 1, + 'expired_at' => $data['ends_till'] ?: null + ]); + } + } else { + $this->cartRuleCouponRepository->deleteWhere(['is_primary' => 1, 'cart_rule_id' => $cartRule->id]); + + $this->cartRuleCouponRepository->getModel()->where('cart_rule_id', $cartRule->id)->update([ + 'usage_limit' => $data['uses_per_coupon'] ?? 0, + 'usage_per_customer' => $data['usage_per_customer'] ?? 0, + 'expired_at' => $data['ends_till'] ?: null + ]); + } + } else { + $cartRuleCoupon = $this->cartRuleCouponRepository->deleteWhere(['is_primary' => 1, 'cart_rule_id' => $cartRule->id]); + } + + return $cartRule; + } + + /** + * Returns attributes for cart rule conditions + * + * @return array + */ + public function getConditionAttributes() + { + $attributes = [ + [ + 'key' => 'cart', + 'label' => trans('admin::app.promotions.cart-rules.cart-attribute'), + 'children' => [ + [ + 'key' => 'cart|base_sub_total', + 'type' => 'price', + 'label' => trans('admin::app.promotions.cart-rules.subtotal') + ], [ + 'key' => 'cart|items_qty', + 'type' => 'integer', + 'label' => trans('admin::app.promotions.cart-rules.total-items-qty') + ], [ + 'key' => 'cart|payment_method', + 'type' => 'select', + 'options' => $this->getPaymentMethods(), + 'label' => trans('admin::app.promotions.cart-rules.payment-method') + ], [ + 'key' => 'cart|shipping_method', + 'type' => 'select', + 'options' => $this->getShippingMethods(), + 'label' => trans('admin::app.promotions.cart-rules.shipping-method') + ], [ + 'key' => 'cart|postcode', + 'type' => 'text', + 'label' => trans('admin::app.promotions.cart-rules.shipping-postcode') + ], [ + 'key' => 'cart|state', + 'type' => 'select', + 'options' => $this->groupedStatesByCountries(), + 'label' => trans('admin::app.promotions.cart-rules.shipping-state') + ], [ + 'key' => 'cart|country', + 'type' => 'select', + 'options' => $this->getCountries(), + 'label' => trans('admin::app.promotions.cart-rules.shipping-country') + ] + ] + ], [ + 'key' => 'cart_item', + 'label' => trans('admin::app.promotions.cart-rules.cart-item-attribute'), + 'children' => [ + [ + 'key' => 'cart_item|base_price', + 'type' => 'price', + 'label' => trans('admin::app.promotions.cart-rules.price-in-cart') + ], [ + 'key' => 'cart_item|quantity', + 'type' => 'integer', + 'label' => trans('admin::app.promotions.cart-rules.qty-in-cart') + ], [ + 'key' => 'cart_item|base_total_weight', + 'type' => 'decimal', + 'label' => trans('admin::app.promotions.cart-rules.total-weight') + ], [ + 'key' => 'cart_item|base_total', + 'type' => 'price', + 'label' => trans('admin::app.promotions.cart-rules.subtotal') + ] + ] + ], [ + 'key' => 'product', + 'label' => trans('admin::app.promotions.cart-rules.product-attribute'), + 'children' => [ + [ + 'key' => 'product|category_ids', + 'type' => 'multiselect', + 'label' => trans('admin::app.promotions.cart-rules.categories'), + 'options' => $categories = $this->categoryRepository->getCategoryTree() + ], [ + 'key' => 'product|children::category_ids', + 'type' => 'multiselect', + 'label' => trans('admin::app.promotions.cart-rules.children-categories'), + 'options' => $categories + ], [ + 'key' => 'product|parent::category_ids', + 'type' => 'multiselect', + 'label' => trans('admin::app.promotions.cart-rules.parent-categories'), + 'options' => $categories + ], [ + 'key' => 'product|attribute_family_id', + 'type' => 'select', + 'label' => trans('admin::app.promotions.cart-rules.attribute_family'), + 'options' => $this->getAttributeFamilies() + ] + ] + ] + ]; + + foreach ($this->attributeRepository->findWhereNotIn('type', ['textarea', 'image', 'file']) as $attribute) { + $attributeType = $attribute->type; + + if ($attribute->code == 'tax_category_id') { + $options = $this->getTaxCategories(); + } else { + $options = $attribute->options; + } + + if ($attribute->validation == 'decimal') + $attributeType = 'decimal'; + + if ($attribute->validation == 'numeric') + $attributeType = 'integer'; + + $attributes[2]['children'][] = [ + 'key' => 'product|' . $attribute->code, + 'type' => $attribute->type, + 'label' => $attribute->name, + 'options' => $options + ]; + + $attributes[2]['children'][] = [ + 'key' => 'product|children::' . $attribute->code, + 'type' => $attribute->type, + 'label' => trans('admin::app.promotions.cart-rules.attribute-name-children-only', ['attribute_name' => $attribute->name]), + 'options' => $options + ]; + + $attributes[2]['children'][] = [ + 'key' => 'product|parent::' . $attribute->code, + 'type' => $attribute->type, + 'label' => trans('admin::app.promotions.cart-rules.attribute-name-parent-only', ['attribute_name' => $attribute->name]), + 'options' => $options + ]; + } + + return $attributes; + } + + /** + * Returns all payment methods + * + * @return array + */ + public function getPaymentMethods() + { + $methods = []; + + foreach (config('paymentmethods') as $paymentMethod) { + $object = app($paymentMethod['class']); + + $methods[] = [ + 'id' => $object->getCode(), + 'admin_name' => $object->getTitle() + ]; + } + + return $methods; + } + + /** + * Returns all shipping methods + * + * @return array + */ + public function getShippingMethods() + { + $methods = []; + + foreach (config('carriers') as $shippingMethod) { + $object = app($shippingMethod['class']); + + $methods[] = [ + 'id' => $object->getCode(), + 'admin_name' => $object->getTitle() + ]; + } + + return $methods; + } + + /** + * Returns all countries + * + * @return array + */ + public function getTaxCategories() + { + $taxCategories = []; + + foreach ($this->taxCategoryRepository->all() as $taxCategory) { + $taxCategories[] = [ + 'id' => $taxCategory->id, + 'admin_name' => $taxCategory->name, + ]; + } + + return $taxCategories; + } + + /** + * Returns all attribute families + * + * @return array + */ + public function getAttributeFamilies() + { + $attributeFamilies = []; + + foreach ($this->attributeFamilyRepository->all() as $attributeFamily) { + $attributeFamilies[] = [ + 'id' => $attributeFamily->id, + 'admin_name' => $attributeFamily->name, + ]; + } + + return $attributeFamilies; + } + + /** + * Returns all countries + * + * @return array + */ + public function getCountries() + { + $countries = []; + + foreach ($this->countryRepository->all() as $country) { + $countries[] = [ + 'id' => $country->code, + 'admin_name' => $country->name, + ]; + } + + return $countries; + } + + /** + * Retrieve all grouped states by country code + * + * @return array + */ + public function groupedStatesByCountries() + { + $collection = []; + + foreach ($this->countryRepository->all() as $country) { + $countryStates = $this->countryStateRepository->findWhere( + ['country_id' => $country->id], + ['code', 'default_name as admin_name'] + )->toArray(); + + if (! count($countryStates)) + continue; + + $collection[] = [ + 'id' => $country->code, + 'admin_name' => $country->name, + 'states' => $countryStates + ]; + } + + return $collection; + } +} \ No newline at end of file diff --git a/packages/Webkul/CatalogRule/src/Console/Commands/PriceRuleIndex.php b/packages/Webkul/CatalogRule/src/Console/Commands/PriceRuleIndex.php new file mode 100644 index 000000000..4f856c979 --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Console/Commands/PriceRuleIndex.php @@ -0,0 +1,53 @@ +catalogRuleIndexHelper = $catalogRuleIndexHelper; + + parent::__construct(); + } + + /** + * Execute the console command. + * + * @return mixed + */ + public function handle() + { + // $this->catalogRuleIndexHelper->reindexComplete(); + } +} \ No newline at end of file diff --git a/packages/Webkul/CatalogRule/src/Contracts/CatalogRule.php b/packages/Webkul/CatalogRule/src/Contracts/CatalogRule.php new file mode 100644 index 000000000..c322bdc78 --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Contracts/CatalogRule.php @@ -0,0 +1,7 @@ +increments('id'); - $table->string('name'); - $table->text('description'); - $table->datetime('starts_from')->nullable(); - $table->datetime('ends_till')->nullable(); + $table->string('name')->nullable(); + $table->string('description')->nullable(); + $table->date('starts_from')->nullable(); + $table->date('ends_till')->nullable(); $table->boolean('status')->default(0); + $table->boolean('condition_type')->default(1); $table->json('conditions')->nullable(); - $table->json('actions')->nullable(); $table->boolean('end_other_rules')->default(0); - $table->string('action_code')->nullable(); - $table->decimal('discount_amount', 20, 4)->default(0.0000); + $table->string('action_type')->nullable(); + $table->decimal('discount_amount', 12, 4)->default(0); + $table->integer('sort_order')->unsigned()->default(0); $table->timestamps(); }); } diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130458_create_catalog_rule_channels_table.php b/packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_03_184651_create_catalog_rule_channels_table.php similarity index 91% rename from packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130458_create_catalog_rule_channels_table.php rename to packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_03_184651_create_catalog_rule_channels_table.php index 32e0ea36e..8f0053237 100644 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130458_create_catalog_rule_channels_table.php +++ b/packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_03_184651_create_catalog_rule_channels_table.php @@ -14,12 +14,13 @@ class CreateCatalogRuleChannelsTable extends Migration public function up() { Schema::create('catalog_rule_channels', function (Blueprint $table) { - $table->increments('id'); - $table->integer('channel_id')->unsigned(); - $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); $table->integer('catalog_rule_id')->unsigned(); + $table->integer('channel_id')->unsigned(); + + $table->primary(['catalog_rule_id', 'channel_id']); + $table->foreign('catalog_rule_id')->references('id')->on('catalog_rules')->onDelete('cascade'); - $table->timestamps(); + $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); }); } diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130451_create_catalog_rule_customer_groups_table.php b/packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_03_184732_create_catalog_rule_customer_groups_table.php similarity index 86% rename from packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130451_create_catalog_rule_customer_groups_table.php rename to packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_03_184732_create_catalog_rule_customer_groups_table.php index 7337cef44..5670c6a80 100644 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130451_create_catalog_rule_customer_groups_table.php +++ b/packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_03_184732_create_catalog_rule_customer_groups_table.php @@ -14,12 +14,14 @@ class CreateCatalogRuleCustomerGroupsTable extends Migration public function up() { Schema::create('catalog_rule_customer_groups', function (Blueprint $table) { - $table->increments('id'); - $table->integer('customer_group_id')->unsigned(); - $table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade'); $table->integer('catalog_rule_id')->unsigned(); + $table->integer('customer_group_id')->unsigned(); + + + $table->primary(['catalog_rule_id', 'customer_group_id'], 'catalog_rule_id_customer_group_id_primary'); + $table->foreign('catalog_rule_id')->references('id')->on('catalog_rules')->onDelete('cascade'); - $table->timestamps(); + $table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade'); }); } diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130550_create_catalog_rule_products_table.php b/packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_06_101110_create_catalog_rule_products_table.php similarity index 80% rename from packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130550_create_catalog_rule_products_table.php rename to packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_06_101110_create_catalog_rule_products_table.php index 2f456559e..8628050ac 100644 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130550_create_catalog_rule_products_table.php +++ b/packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_06_101110_create_catalog_rule_products_table.php @@ -14,20 +14,25 @@ class CreateCatalogRuleProductsTable extends Migration public function up() { Schema::create('catalog_rule_products', function (Blueprint $table) { - $table->bigIncrements('id'); - $table->integer('catalog_rule_id')->unsigned(); - $table->foreign('catalog_rule_id')->references('id')->on('catalog_rules')->onDelete('cascade'); + $table->increments('id'); $table->datetime('starts_from')->nullable(); $table->datetime('ends_till')->nullable(); - $table->integer('customer_group_id')->unsigned(); - $table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade'); - $table->integer('channel_id')->unsigned(); - $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); + $table->boolean('end_other_rules')->default(0); + $table->string('action_type')->nullable(); + $table->decimal('discount_amount', 12, 4)->default(0); + $table->integer('sort_order')->unsigned()->default(0); + $table->integer('product_id')->unsigned(); $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); - $table->string('action_code')->nullable(); - $table->decimal('action_amount', 20, 4)->default(0.0000); - $table->timestamps(); + + $table->integer('customer_group_id')->unsigned(); + $table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade'); + + $table->integer('catalog_rule_id')->unsigned(); + $table->foreign('catalog_rule_id')->references('id')->on('catalog_rules')->onDelete('cascade'); + + $table->integer('channel_id')->unsigned(); + $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); }); } @@ -40,4 +45,4 @@ class CreateCatalogRuleProductsTable extends Migration { Schema::dropIfExists('catalog_rule_products'); } -} \ No newline at end of file +} diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130583_create_catalog_rule_products_price_table.php b/packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_06_110507_create_catalog_rule_product_prices_table.php similarity index 76% rename from packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130583_create_catalog_rule_products_price_table.php rename to packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_06_110507_create_catalog_rule_product_prices_table.php index a5af74b08..dab445de0 100644 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130583_create_catalog_rule_products_price_table.php +++ b/packages/Webkul/CatalogRule/src/Database/Migrations/2019_12_06_110507_create_catalog_rule_product_prices_table.php @@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class CreateCatalogRuleProductsPriceTable extends Migration +class CreateCatalogRuleProductPricesTable extends Migration { /** * Run the migrations. @@ -13,20 +13,24 @@ class CreateCatalogRuleProductsPriceTable extends Migration */ public function up() { - Schema::create('catalog_rule_products_price', function (Blueprint $table) { - $table->bigIncrements('id'); - $table->integer('channel_id')->unsigned(); - $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); - $table->integer('customer_group_id')->unsigned(); - $table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade'); - $table->integer('product_id')->unsigned(); - $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); - $table->integer('catalog_rule_id')->unsigned(); - $table->foreign('catalog_rule_id')->references('id')->on('catalog_rules')->onDelete('cascade'); - $table->decimal('rule_price', 20, 4)->default(0.0000); + Schema::create('catalog_rule_product_prices', function (Blueprint $table) { + $table->increments('id'); + $table->decimal('price', 12, 4)->default(0); + $table->date('rule_date'); $table->datetime('starts_from')->nullable(); $table->datetime('ends_till')->nullable(); - $table->timestamps(); + + $table->integer('product_id')->unsigned(); + $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); + + $table->integer('customer_group_id')->unsigned(); + $table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade'); + + $table->integer('catalog_rule_id')->unsigned(); + $table->foreign('catalog_rule_id')->references('id')->on('catalog_rules')->onDelete('cascade'); + + $table->integer('channel_id')->unsigned(); + $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); }); } @@ -37,6 +41,6 @@ class CreateCatalogRuleProductsPriceTable extends Migration */ public function down() { - Schema::dropIfExists('catalog_rule_products_price'); + Schema::dropIfExists('catalog_rule_product_prices'); } } diff --git a/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleIndex.php b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleIndex.php new file mode 100644 index 000000000..fd9b6cc5f --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleIndex.php @@ -0,0 +1,137 @@ +catalogRuleRepository = $catalogRuleRepository; + + $this->catalogRuleProductHelper = $catalogRuleProductHelper; + + $this->catalogRuleProductPriceHelper = $catalogRuleProductPriceHelper; + } + + /** + * Full reindex + * + * @return void + */ + public function reindexComplete() + { + try { + $this->cleanIndexes(); + + foreach ($this->getCatalogRules() as $rule) { + $this->catalogRuleProductHelper->insertRuleProduct($rule); + } + + $this->catalogRuleProductPriceHelper->indexRuleProductPrice(1000); + } catch (\Exception $e) { + + } + } + + /** + * Full reindex + * + * @param Product $product + * @return void + */ + public function reindexProduct($product) + { + try { + if (! $product->getTypeInstance()->priceRuleCanBeApplied()) + return; + + $productIds = $product->getTypeInstance()->isComposite() + ? $product->getTypeInstance()->getChildrenIds() + : [$product->id]; + + $this->cleanIndexes($productIds); + + foreach ($this->getCatalogRules() as $rule) { + $this->catalogRuleProductHelper->insertRuleProduct($rule, 1000, $product); + } + + $this->catalogRuleProductPriceHelper->indexRuleProductPrice(1000, $product); + } catch (\Exception $e) { + + } + } + + /** + * Deletes catalog rule product and catalog rule product price indexes + * + * @param array $productIds + * @return void + */ + public function cleanIndexes($productIds = []) + { + $this->catalogRuleProductHelper->cleanProductIndex($productIds); + + $this->catalogRuleProductPriceHelper->cleanProductPriceIndex($productIds); + } + + /** + * Returns catalog rules + * + * @return Collection + */ + public function getCatalogRules() + { + static $catalogRules; + + if ($catalogRules) + return $catalogRules; + + $catalogRules = $this->catalogRuleRepository->scopeQuery(function($query) { + return $query->where(function ($query1) { + $query1->where('catalog_rules.starts_from', '<=', Carbon::now()->format('Y-m-d'))->orWhereNull('catalog_rules.starts_from'); + }) + ->where(function ($query2) { + $query2->where('catalog_rules.ends_till', '>=', Carbon::now()->format('Y-m-d'))->orWhereNull('catalog_rules.ends_till'); + }) + ->orderBy('sort_order', 'asc'); + })->findWhere(['status' => 1]); + + return $catalogRules; + } +} \ No newline at end of file diff --git a/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProduct.php b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProduct.php new file mode 100644 index 000000000..60e3aa629 --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProduct.php @@ -0,0 +1,253 @@ +attributeRepository = $attributeRepository; + + $this->productRepository = $productRepository; + + $this->catalogRuleProductRepository = $catalogRuleProductRepository; + + $this->validator = $validator; + } + + /** + * Collect discount on cart + * + * @param CatalogRule $rule + * @param integer $batchCount + * @return void + */ + public function insertRuleProduct($rule, $batchCount = 1000, $product = null) + { + $productIds = $this->getMatchingProductIds($rule, $product); + + $rows = []; + + $startsFrom = $rule->starts_from ? Carbon::createFromTimeString($rule->starts_from . " 00:00:01") : null; + + $endsTill = $rule->ends_till ? Carbon::createFromTimeString($rule->ends_till . " 23:59:59") : null; + + foreach ($productIds as $productId) { + foreach ($rule->channels()->pluck('id') as $channelId) { + foreach ($rule->customer_groups()->pluck('id') as $customerGroupId) { + $rows[] = [ + 'starts_from' => $startsFrom, + 'ends_till' => $endsTill, + 'catalog_rule_id' => $rule->id, + 'channel_id' => $channelId, + 'customer_group_id' => $customerGroupId, + 'product_id' => $productId, + 'discount_amount' => $rule->discount_amount, + 'action_type' => $rule->action_type, + 'end_other_rules' => $rule->end_other_rules, + 'sort_order' => $rule->sort_order, + ]; + + if (count($rows) == $batchCount) { + $this->catalogRuleProductRepository->getModel()->insert($rows); + + $rows = []; + } + } + } + } + + if (! empty($rows)) + $this->catalogRuleProductRepository->getModel()->insert($rows); + } + + /** + * Get array of product ids which are matched by rule + * + * @param CatalogRule $rule + * @param Product $product + * @return array + */ + public function getMatchingProductIds($rule, $product = null) + { + $qb = $this->productRepository->scopeQuery(function($query) use($rule, $product) { + $qb = $query->distinct() + ->addSelect('products.*') + ->leftJoin('product_flat', 'products.id', '=', 'product_flat.product_id') + ->leftJoin('channels', 'product_flat.channel', '=', 'channels.code') + ->whereIn('channels.id', $rule->channels()->pluck('id')->toArray()); + + if ($product) + $qb->where('products.id', $product->id); + + if (! $rule->conditions) + return $qb; + + $appliedAttributes = []; + + foreach ($rule->conditions as $condition) { + if (! $condition['attribute'] + || ! isset($condition['value']) + || is_null($condition['value']) + || $condition['value'] == '' + || in_array($condition['attribute'], $appliedAttributes)) + continue; + + $appliedAttributes[] = $condition['attribute']; + + $chunks = explode('|', $condition['attribute']); + + $qb = $this->addAttributeToSelect(end($chunks), $qb); + } + + return $qb; + }); + + $validatedProductIds = []; + + foreach ($qb->get() as $product) { + if (! $product->getTypeInstance()->priceRuleCanBeApplied()) + continue; + + if ($this->validator->validate($rule, $product)) { + if ($product->getTypeInstance()->isComposite()) { + $validatedProductIds = array_merge($validatedProductIds, $product->getTypeInstance()->getChildrenIds()); + } else { + $validatedProductIds[] = $product->id; + } + } + } + + return array_unique($validatedProductIds); + } + + /** + * Add product attribute condition to query + * + * @param string $attributeCode + * @param QueryBuilder $query + * @return QueryBuilder + */ + public function addAttributeToSelect($attributeCode, $query) + { + $attribute = $this->attributeRepository->findOneByField('code', $attributeCode); + + if (! $attribute) + return $query; + + $query = $query->leftJoin('product_attribute_values as ' . 'pav_' . $attribute->code, function($qb) use($attribute) { + $qb = $qb->where('pav_' . $attribute->code . '.channel', $attribute->value_per_channel ? core()->getDefaultChannelCode() : null) + ->where('pav_' . $attribute->code . '.locale', $attribute->value_per_locale ? app()->getLocale() : null); + + $qb->on('products.id', 'pav_' . $attribute->code . '.product_id') + ->where('pav_' . $attribute->code . '.attribute_id', $attribute->id); + }); + + $query = $query->addSelect('pav_' . $attribute->code . '.' . ProductAttributeValue::$attributeTypeFields[$attribute->type] . ' as ' . $attribute->code); + + return $query; + } + + /** + * Returns catalog rule products + * + * @param Product $product + * @return Collection + */ + public function getCatalogRuleProducts($product = null) + { + $results = $this->catalogRuleProductRepository->scopeQuery(function($query) use($product) { + $qb = $query->distinct() + ->select('catalog_rule_products.*') + ->leftJoin('products', 'catalog_rule_products.product_id', '=', 'products.id') + ->orderBy('channel_id', 'asc') + ->orderBy('customer_group_id', 'asc') + ->orderBy('product_id', 'asc') + ->orderBy('sort_order', 'asc') + ->orderBy('catalog_rule_id', 'asc'); + + $qb = $this->addAttributeToSelect('price', $qb); + + if ($product) { + if (! $product->getTypeInstance()->priceRuleCanBeApplied()) + return $qb; + + if ($product->getTypeInstance()->isComposite()) { + $qb->whereIn('catalog_rule_products.product_id', $product->getTypeInstance()->getChildrenIds()); + } else { + $qb->where('catalog_rule_products.product_id', $product->id); + } + } + + return $qb; + })->get(); + + return $results; + } + + /** + * Returns catalog rules + * + * @param CatalogRule $rule + * @return void + */ + public function cleanProductIndex($productIds = []) + { + if (count($productIds)) { + $this->catalogRuleProductRepository->getModel()->whereIn('product_id', $productIds)->delete(); + } else { + $this->catalogRuleProductRepository->deleteWhere([ + ['product_id', 'like', '%%'] + ]); + } + } +} \ No newline at end of file diff --git a/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProductPrice.php b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProductPrice.php new file mode 100644 index 000000000..358b37cd5 --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProductPrice.php @@ -0,0 +1,217 @@ +catalogRuleProductPriceRepository = $catalogRuleProductPriceRepository; + + $this->catalogRuleProductHelper = $catalogRuleProductHelper; + + $this->customerGroupRepository = $customerGroupRepository; + } + + /** + * Return current logged in customer + * + * @return Customer | Boolean + */ + public function getCurrentCustomer() + { + $guard = request()->has('token') ? 'api' : 'customer'; + + return auth()->guard($guard); + } + + /** + * Collect discount on cart + * + * @param integer $batchCount + * @param Product $product + * @return void + */ + public function indexRuleProductPrice($batchCount, $product = null) + { + $dates = [ + 'current' => $currentDate = Carbon::now(), + 'previous' => (clone $currentDate)->subDays('1')->setTime(23, 59, 59), + 'next' => (clone $currentDate)->addDays('1')->setTime(0, 0, 0), + ]; + + $prices = $endRuleFlags = []; + + $previousKey = null; + + $catalogRuleProducts = $this->catalogRuleProductHelper->getCatalogRuleProducts($product); + + foreach ($catalogRuleProducts as $row) { + $productKey = $row->product_id . '-' . $row->channel_id . '-' . $row->customer_group_id; + + if ($previousKey && $previousKey != $productKey) { + $endRuleFlags = []; + + if (count($prices) > $batchCount) { + $this->catalogRuleProductPriceRepository->getModel()->insert($prices); + + $prices = []; + } + } + + foreach ($dates as $key => $date) { + if ((! $row->starts_from || $date >= $row->starts_from) + && (! $row->ends_till || $date <= $row->ends_till)) + { + $priceKey = $date->getTimestamp() . '-' . $productKey; + + if (isset($endRuleFlags[$priceKey])) + continue; + + if (! isset($prices[$priceKey])) { + $prices[$priceKey] = [ + 'rule_date' => $date, + 'catalog_rule_id' => $row->catalog_rule_id, + 'channel_id' => $row->channel_id, + 'customer_group_id' => $row->customer_group_id, + 'product_id' => $row->product_id, + 'price' => $this->calculate($row), + 'starts_from' => $row->starts_from, + 'ends_till' => $row->ends_till, + ]; + } else { + $prices[$priceKey]['price'] = $this->calculate($row, $prices[$priceKey]); + + $prices[$priceKey]['starts_from'] = max($prices[$priceKey]['starts_from'], $row->starts_from); + + $prices[$priceKey]['ends_till'] = min($prices[$priceKey]['ends_till'], $row->ends_till); + } + + if ($row->end_other_rules) + $endRuleFlags[$priceKey] = true; + } + } + + $previousKey = $productKey; + } + + $this->catalogRuleProductPriceRepository->getModel()->insert($prices); + } + + /** + * Calculates product price based on rule + * + * @param array $rule + * @param Product|null $productData + * @return float + */ + public function calculate($rule, $productData = null) + { + $price = $productData && isset($productData['price']) ? $productData['price'] : $rule->price; + + switch ($rule->action_type) { + case 'to_fixed': + $price = min($rule->discount_amount, $price); + + break; + + case 'to_percent': + $price = $price * $rule->discount_amount / 100; + + break; + + case 'by_fixed': + $price = max(0, $price - $rule->discount_amount); + + break; + + case 'by_percent': + $price = $price * (1 - $rule->discount_amount / 100); + + break; + } + + return $price; + } + + /** + * Clean product price index + * + * @param array $productIds + * @return void + */ + public function cleanProductPriceIndex($productIds = []) + { + if (count($productIds)) { + $this->catalogRuleProductPriceRepository->getModel()->whereIn('product_id', $productIds)->delete(); + } else { + $this->catalogRuleProductPriceRepository->deleteWhere([ + ['product_id', 'like', '%%'] + ]); + } + } + + /** + * Get catalog rules product price for specific date, channel and customer group + * + * @param Product $product + * @return void + */ + public function getRulePrice($product) + { + if ($this->getCurrentCustomer()->check()) { + $customerGroupId = $this->getCurrentCustomer()->user()->customer_group_id; + } else { + $customerGroup = $this->customerGroupRepository->findOneByField('code', 'guest'); + + if (! $customerGroup) + return; + + $customerGroupId = $customerGroup->id; + } + + return $this->catalogRuleProductPriceRepository->findOneWhere([ + 'product_id' => $product->id, + 'channel_id' => core()->getCurrentChannel()->id, + 'customer_group_id' => $customerGroupId, + 'rule_date' => Carbon::now()->format('Y-m-d'), + ]); + } +} \ No newline at end of file diff --git a/packages/Webkul/CatalogRule/src/Http/Controllers/CatalogRuleController.php b/packages/Webkul/CatalogRule/src/Http/Controllers/CatalogRuleController.php new file mode 100644 index 000000000..3bcceb50f --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Http/Controllers/CatalogRuleController.php @@ -0,0 +1,183 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CatalogRuleController extends Controller +{ + /** + * Initialize _config, a default request parameter with route + * + * @param array + */ + protected $_config; + + /** + * To hold Catalog repository instance + * + * @var CatalogRuleRepository + */ + protected $catalogRuleRepository; + + /** + * CatalogRuleIndex + * + * @var CatalogRuleIndex + */ + protected $catalogRuleIndexHelper; + + /** + * Create a new controller instance. + * + * @param \Webkul\CatalogRule\Repositories\CatalogRuleRepository $catalogRuleRepository + * @param \Webkul\CatalogRule\Helpers\CatalogRuleIndex $catalogRuleIndexHelper + * @return void + */ + public function __construct( + CatalogRuleRepository $catalogRuleRepository, + CatalogRuleIndex $catalogRuleIndexHelper + ) + { + $this->_config = request('_config'); + + $this->catalogRuleRepository = $catalogRuleRepository; + + $this->catalogRuleIndexHelper = $catalogRuleIndexHelper; + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view($this->_config['view']); + } + + /** + * Store a newly created resource in storage. + * + * @return \Illuminate\Http\Response + */ + public function store() + { + $this->validate(request(), [ + 'name' => 'required', + 'channels' => 'required|array|min:1', + 'customer_groups' => 'required|array|min:1', + 'starts_from' => 'nullable|date', + 'ends_till' => 'nullable|date|after_or_equal:starts_from', + 'action_type' => 'required', + 'discount_amount' => 'required|numeric' + ]); + + $data = request()->all(); + + Event::fire('promotions.catalog_rule.create.before'); + + $catalogRule = $this->catalogRuleRepository->create($data); + + Event::fire('promotions.catalog_rule.create.after', $catalogRule); + + $this->catalogRuleIndexHelper->reindexComplete(); + + session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Catalog Rule'])); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $catalogRule = $this->catalogRuleRepository->findOrFail($id); + + return view($this->_config['view'], compact('catalogRule')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $this->validate(request(), [ + 'name' => 'required', + 'channels' => 'required|array|min:1', + 'customer_groups' => 'required|array|min:1', + 'starts_from' => 'nullable|date', + 'ends_till' => 'nullable|date|after_or_equal:starts_from', + 'action_type' => 'required', + 'discount_amount' => 'required|numeric' + ]); + + $catalogRule = $this->catalogRuleRepository->findOrFail($id); + + Event::fire('promotions.catalog_rule.update.before', $catalogRule); + + $catalogRule = $this->catalogRuleRepository->update(request()->all(), $id); + + Event::fire('promotions.catalog_rule.update.after', $catalogRule); + + $this->catalogRuleIndexHelper->reindexComplete(); + + session()->flash('success', trans('admin::app.response.update-success', ['name' => 'Catalog Rule'])); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + $catalogRule = $this->catalogRuleRepository->findOrFail($id); + + try { + Event::fire('promotions.catalog_rule.delete.before', $id); + + $this->catalogRuleRepository->delete($id); + + Event::fire('promotions.catalog_rule.delete.after', $id); + + session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Catalog Rule'])); + + return response()->json(['message' => true], 200); + } catch(\Exception $e) { + session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Catalog Rule'])); + } + + return response()->json(['message' => false], 400); + } +} \ No newline at end of file diff --git a/packages/Webkul/CatalogRule/src/Http/Controllers/Controller.php b/packages/Webkul/CatalogRule/src/Http/Controllers/Controller.php new file mode 100644 index 000000000..78181ceb7 --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Http/Controllers/Controller.php @@ -0,0 +1,13 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class Product +{ + /** + * Product Repository Object + * + * @var Object + */ + protected $catalogRuleIndexHelper; + + /** + * Create a new listener instance. + * + * @param Webkul\CatalogRule\Helpers\CatalogRuleIndex $catalogRuleIndexHelper + * @return void + */ + public function __construct(CatalogRuleIndex $catalogRuleIndexHelper) + { + $this->catalogRuleIndexHelper = $catalogRuleIndexHelper; + } + + /** + * @param Product $product + * @return void + */ + public function createProductRuleIndex($product) + { + $this->catalogRuleIndexHelper->reindexProduct($product); + } +} \ No newline at end of file diff --git a/packages/Webkul/CatalogRule/src/Models/CatalogRule.php b/packages/Webkul/CatalogRule/src/Models/CatalogRule.php new file mode 100644 index 000000000..00e991506 --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Models/CatalogRule.php @@ -0,0 +1,33 @@ + 'array' + ]; + + /** + * Get the channels that owns the catalog rule. + */ + public function channels() + { + return $this->belongsToMany(ChannelProxy::modelClass(), 'catalog_rule_channels'); + } + + /** + * Get the customer groups that owns the catalog rule. + */ + public function customer_groups() + { + return $this->belongsToMany(CustomerGroupProxy::modelClass(), 'catalog_rule_customer_groups'); + } +} \ No newline at end of file diff --git a/packages/Webkul/CatalogRule/src/Models/CatalogRuleProduct.php b/packages/Webkul/CatalogRule/src/Models/CatalogRuleProduct.php new file mode 100644 index 000000000..dfa513113 --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Models/CatalogRuleProduct.php @@ -0,0 +1,13 @@ +loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); + + Event::listen('catalog.product.update.after', 'Webkul\CatalogRule\Listeners\Product@createProductRuleIndex'); + } + + /** + * Register services. + * + * @return void + */ + public function register() + { + $this->registerCommands(); + } + + /** + * Register the console commands of this package + */ + protected function registerCommands() + { + if ($this->app->runningInConsole()) + $this->commands([PriceRuleIndex::class]); + } +} \ No newline at end of file diff --git a/packages/Webkul/CatalogRule/src/Providers/ModuleServiceProvider.php b/packages/Webkul/CatalogRule/src/Providers/ModuleServiceProvider.php new file mode 100644 index 000000000..778b8a1d9 --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Providers/ModuleServiceProvider.php @@ -0,0 +1,14 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CatalogRuleProductPriceRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\CatalogRule\Contracts\CatalogRuleProductPrice'; + } +} \ No newline at end of file diff --git a/packages/Webkul/CatalogRule/src/Repositories/CatalogRuleProductRepository.php b/packages/Webkul/CatalogRule/src/Repositories/CatalogRuleProductRepository.php new file mode 100644 index 000000000..565781c29 --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Repositories/CatalogRuleProductRepository.php @@ -0,0 +1,24 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CatalogRuleProductRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\CatalogRule\Contracts\CatalogRuleProduct'; + } +} \ No newline at end of file diff --git a/packages/Webkul/CatalogRule/src/Repositories/CatalogRuleRepository.php b/packages/Webkul/CatalogRule/src/Repositories/CatalogRuleRepository.php new file mode 100644 index 000000000..16a59b5ee --- /dev/null +++ b/packages/Webkul/CatalogRule/src/Repositories/CatalogRuleRepository.php @@ -0,0 +1,225 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CatalogRuleRepository extends Repository +{ + /** + * AttributeFamilyRepository object + * + * @var AttributeFamilyRepository + */ + protected $attributeFamilyRepository; + + /** + * AttributeRepository object + * + * @var AttributeRepository + */ + protected $attributeRepository; + + /** + * CategoryRepository class + * + * @var CategoryRepository + */ + protected $categoryRepository; + + /** + * TaxCategoryRepository class + * + * @var TaxCategoryRepository + */ + protected $taxCategoryRepository; + + /** + * Create a new repository instance. + * + * @param Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamilyRepository + * @param Webkul\Attribute\Repositories\AttributeRepository $attributeRepository + * @param Webkul\Category\Repositories\CategoryRepository $categoryRepository + * @param Webkul\Tax\Repositories\TaxCategoryRepository $taxCategoryRepository + * @param Illuminate\Container\Container $app + * @return void + */ + public function __construct( + AttributeFamilyRepository $attributeFamilyRepository, + AttributeRepository $attributeRepository, + CategoryRepository $categoryRepository, + TaxCategoryRepository $taxCategoryRepository, + App $app + ) + { + $this->attributeFamilyRepository = $attributeFamilyRepository; + + $this->attributeRepository = $attributeRepository; + + $this->categoryRepository = $categoryRepository; + + $this->taxCategoryRepository = $taxCategoryRepository; + + parent::__construct($app); + } + + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\CatalogRule\Contracts\CatalogRule'; + } + + /** + * @param array $data + * @return mixed + */ + public function create(array $data) + { + $data['starts_from'] = $data['starts_from'] ?: null; + + $data['ends_till'] = $data['ends_till'] ?: null; + + $data['status'] = ! isset($data['status']) ? 0 : 1; + + $catalogRule = parent::create($data); + + $catalogRule->channels()->sync($data['channels']); + + $catalogRule->customer_groups()->sync($data['customer_groups']); + + return $catalogRule; + } + + /** + * @param array $data + * @param array $id + * @param string $attribute + * @return mixed + */ + public function update(array $data, $id, $attribute = "id") + { + $data['starts_from'] = $data['starts_from'] ?: null; + + $data['ends_till'] = $data['ends_till'] ?: null; + + $data['status'] = ! isset($data['status']) ? 0 : 1; + + $data['conditions'] = $data['conditions'] ?? []; + + $catalogRule = $this->find($id); + + parent::update($data, $id, $attribute); + + $catalogRule->channels()->sync($data['channels']); + + $catalogRule->customer_groups()->sync($data['customer_groups']); + + return $catalogRule; + } + + /** + * Returns attributes for catalog rule conditions + * + * @return array + */ + public function getConditionAttributes() + { + $attributes = [ + [ + 'key' => 'product', + 'label' => trans('admin::app.promotions.catalog-rules.product-attribute'), + 'children' => [ + [ + 'key' => 'product|category_ids', + 'type' => 'multiselect', + 'label' => trans('admin::app.promotions.catalog-rules.categories'), + 'options' => $this->categoryRepository->getCategoryTree() + ], [ + 'key' => 'product|attribute_family_id', + 'type' => 'select', + 'label' => trans('admin::app.promotions.catalog-rules.attribute_family'), + 'options' => $this->getAttributeFamilies() + ] + ] + ] + ]; + + foreach ($this->attributeRepository->findWhereNotIn('type', ['textarea', 'image', 'file']) as $attribute) { + $attributeType = $attribute->type; + + if ($attribute->code == 'tax_category_id') { + $options = $this->getTaxCategories(); + } else { + $options = $attribute->options; + } + + if ($attribute->validation == 'decimal') + $attributeType = 'decimal'; + + if ($attribute->validation == 'numeric') + $attributeType = 'integer'; + + $attributes[0]['children'][] = [ + 'key' => 'product|' . $attribute->code, + 'type' => $attribute->type, + 'label' => $attribute->name, + 'options' => $options + ]; + } + + return $attributes; + } + + /** + * Returns all tax categories + * + * @return array + */ + public function getTaxCategories() + { + $taxCategories = []; + + foreach ($this->taxCategoryRepository->all() as $taxCategory) { + $taxCategories[] = [ + 'id' => $taxCategory->id, + 'admin_name' => $taxCategory->name, + ]; + } + + return $taxCategories; + } + + /** + * Returns all attribute families + * + * @return array + */ + public function getAttributeFamilies() + { + $attributeFamilies = []; + + foreach ($this->attributeFamilyRepository->all() as $attributeFamily) { + $attributeFamilies[] = [ + 'id' => $attributeFamily->id, + 'admin_name' => $attributeFamily->name, + ]; + } + + return $attributeFamilies; + } +} \ No newline at end of file diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php index c640a30d0..729b32bdb 100755 --- a/packages/Webkul/Checkout/src/Cart.php +++ b/packages/Webkul/Checkout/src/Cart.php @@ -229,7 +229,7 @@ class Cart { { foreach ($data['qty'] as $itemId => $quantity) { $item = $this->cartItemRepository->findOneByField('id', $itemId); - + if (! $item) continue; @@ -345,7 +345,7 @@ class Cart { foreach ($guestCart->items as $key => $guestCartItem) { $found = false; - + foreach ($cart->items as $cartItem) { if (! $cartItem->product->getTypeInstance()->compareOptions($cartItem->additional, $guestCartItem->additional)) continue; @@ -492,7 +492,7 @@ class Cart { if ($cart->haveStockableItems()) { $shippingAddress = $data['shipping']; $shippingAddress['cart_id'] = $cart->id; - + if (isset($data['shipping']['address_id']) && $data['shipping']['address_id']) { $address = $this->customerAddressRepository->findOneWhere(['id'=> $data['shipping']['address_id']])->toArray(); @@ -614,6 +614,8 @@ class Cart { if (! $cart = $this->getCart()) return false; + Event::fire('checkout.cart.collect.totals.before', $cart); + $this->calculateItemsTax(); $cart->grand_total = $cart->base_grand_total = 0; @@ -636,11 +638,15 @@ class Cart { } if ($shipping = $cart->selected_shipping_rate) { - $cart->grand_total = (float) $cart->grand_total + $shipping->price; - $cart->base_grand_total = (float) $cart->base_grand_total + $shipping->base_price; + $cart->grand_total = (float) $cart->grand_total + $shipping->price - $shipping->discount_amount; + $cart->base_grand_total = (float) $cart->base_grand_total + $shipping->base_price - $shipping->base_discount_amount; + + $cart->discount_amount += $shipping->discount_amount; + $cart->base_discount_amount += $shipping->base_discount_amount; } $quantities = 0; + foreach ($cart->items as $item) { $quantities = $quantities + $item->quantity; } @@ -650,6 +656,8 @@ class Cart { $cart->items_qty = $quantities; $cart->save(); + + Event::fire('checkout.cart.collect.totals.after', $cart); } /** @@ -666,7 +674,7 @@ class Cart { //rare case of accident-->used when there are no items. if (count($cart->items) == 0) { $this->cartRepository->delete($cart->id); - + return false; } else { foreach ($cart->items as $item) { @@ -704,7 +712,7 @@ class Cart { if (! $taxCategory) continue; - + if ($item->product->getTypeInstance()->isStockable()) { $address = $cart->shipping_address; } else { @@ -712,22 +720,22 @@ class Cart { } $taxRates = $taxCategory->tax_rates()->where([ - 'state' => $address->state, 'country' => $address->country, ])->orderBy('tax_rate', 'desc')->get(); - if (count( $taxRates) > 0) { + if ($taxRates->count()) { foreach ($taxRates as $rate) { $haveTaxRate = false; + if ($rate->state != '' && $rate->state != $address->state) + continue; + if (! $rate->is_zip) { - if ($rate->zip_code == '*' || $rate->zip_code == $address->postcode) { + if ($rate->zip_code == '*' || $rate->zip_code == $address->postcode) $haveTaxRate = true; - } } else { - if ($address->postcode >= $rate->zip_from && $address->postcode <= $rate->zip_to) { + if ($address->postcode >= $rate->zip_from && $address->postcode <= $rate->zip_to) $haveTaxRate = true; - } } if ($haveTaxRate) { @@ -835,6 +843,8 @@ class Cart { 'base_sub_total' => $data['base_sub_total'], 'tax_amount' => $data['tax_total'], 'base_tax_amount' => $data['base_tax_total'], + 'coupon_code' => $data['coupon_code'], + 'applied_cart_rule_ids' => $data['applied_cart_rule_ids'], 'discount_amount' => $data['discount_amount'], 'base_discount_amount' => $data['base_discount_amount'], 'billing_address' => array_except($data['billing_address'], ['id', 'cart_id']), @@ -849,6 +859,8 @@ class Cart { 'shipping_description' => $data['selected_shipping_rate']['method_description'], 'shipping_amount' => $data['selected_shipping_rate']['price'], 'base_shipping_amount' => $data['selected_shipping_rate']['base_price'], + 'shipping_discount_amount' => $data['selected_shipping_rate']['discount_amount'], + 'base_shipping_discount_amount' => $data['selected_shipping_rate']['base_discount_amount'], 'shipping_address' => array_except($data['shipping_address'], ['id', 'cart_id']), ]); } @@ -902,7 +914,7 @@ class Cart { /** * Move a wishlist item to cart - * + * * @param WishlistItem $wishlistItem * @return boolean */ @@ -910,7 +922,7 @@ class Cart { { if (! $wishlistItem->product->getTypeInstance()->canBeMovedFromWishlistToCart($wishlistItem)) return false; - + if (! $wishlistItem->additional) $wishlistItem->additional = ['product_id' => $wishlistItem->product_id]; @@ -972,4 +984,37 @@ class Cart { return true; } + + /** + * Set coupon code to the cart + * + * @param string $code + * @return Cart + */ + public function setCouponCode($code) + { + $cart = $this->getCart(); + + $cart->coupon_code = $code; + + $cart->save(); + + return $this; + } + + /** + * Remove coupon code from cart + * + * @return Cart + */ + public function removeCouponCode() + { + $cart = $this->getCart(); + + $cart->coupon_code = null; + + $cart->save(); + + return $this; + } } \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_07_14_070809_add_products_selection_column_in_cart_rules_table.php b/packages/Webkul/Checkout/src/Database/Migrations/2019_11_25_171136_add_applied_cart_rule_ids_column_in_cart_table.php similarity index 55% rename from packages/Webkul/Discount/src/Database/Migrations/2019_07_14_070809_add_products_selection_column_in_cart_rules_table.php rename to packages/Webkul/Checkout/src/Database/Migrations/2019_11_25_171136_add_applied_cart_rule_ids_column_in_cart_table.php index c8c86276b..b6423d3be 100644 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_07_14_070809_add_products_selection_column_in_cart_rules_table.php +++ b/packages/Webkul/Checkout/src/Database/Migrations/2019_11_25_171136_add_applied_cart_rule_ids_column_in_cart_table.php @@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class AddProductsSelectionColumnInCartRulesTable extends Migration +class AddAppliedCartRuleIdsColumnInCartTable extends Migration { /** * Run the migrations. @@ -13,8 +13,8 @@ class AddProductsSelectionColumnInCartRulesTable extends Migration */ public function up() { - Schema::table('cart_rules', function (Blueprint $table) { - $table->json('products_selection')->nullable(); + Schema::table('cart', function (Blueprint $table) { + $table->string('applied_cart_rule_ids')->nullable(); }); } @@ -25,8 +25,8 @@ class AddProductsSelectionColumnInCartRulesTable extends Migration */ public function down() { - Schema::table('cart_rules', function (Blueprint $table) { - $table->dropColumn('products_selection'); + Schema::table('cart', function (Blueprint $table) { + // }); } } diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_06_25_110122_remove_is_guest_from_cart_rules_table.php b/packages/Webkul/Checkout/src/Database/Migrations/2019_11_25_171208_add_applied_cart_rule_ids_column_in_cart_items_table.php similarity index 57% rename from packages/Webkul/Discount/src/Database/Migrations/2019_06_25_110122_remove_is_guest_from_cart_rules_table.php rename to packages/Webkul/Checkout/src/Database/Migrations/2019_11_25_171208_add_applied_cart_rule_ids_column_in_cart_items_table.php index a34fe12d9..cb22375bf 100644 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_06_25_110122_remove_is_guest_from_cart_rules_table.php +++ b/packages/Webkul/Checkout/src/Database/Migrations/2019_11_25_171208_add_applied_cart_rule_ids_column_in_cart_items_table.php @@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class RemoveIsGuestFromCartRulesTable extends Migration +class AddAppliedCartRuleIdsColumnInCartItemsTable extends Migration { /** * Run the migrations. @@ -13,8 +13,8 @@ class RemoveIsGuestFromCartRulesTable extends Migration */ public function up() { - Schema::table('cart_rules', function (Blueprint $table) { - $table->dropColumn('is_guest'); + Schema::table('cart_items', function (Blueprint $table) { + $table->string('applied_cart_rule_ids')->nullable(); }); } @@ -25,8 +25,8 @@ class RemoveIsGuestFromCartRulesTable extends Migration */ public function down() { - Schema::table('cart_rules', function (Blueprint $table) { - $table->boolean('is_guest')->default(0); + Schema::table('cart_items', function (Blueprint $table) { + // }); } } diff --git a/packages/Webkul/Checkout/src/Database/Migrations/2019_11_30_165644_add_discount_columns_in_cart_shipping_rates_table.php b/packages/Webkul/Checkout/src/Database/Migrations/2019_11_30_165644_add_discount_columns_in_cart_shipping_rates_table.php new file mode 100644 index 000000000..8c7b48e44 --- /dev/null +++ b/packages/Webkul/Checkout/src/Database/Migrations/2019_11_30_165644_add_discount_columns_in_cart_shipping_rates_table.php @@ -0,0 +1,33 @@ +decimal('discount_amount', 12, 4)->default(0); + $table->decimal('base_discount_amount', 12, 4)->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('cart_shipping_rates', function (Blueprint $table) { + // + }); + } +} diff --git a/packages/Webkul/Checkout/src/Models/Cart.php b/packages/Webkul/Checkout/src/Models/Cart.php index 01cddea2b..9088531fa 100755 --- a/packages/Webkul/Checkout/src/Models/Cart.php +++ b/packages/Webkul/Checkout/src/Models/Cart.php @@ -12,8 +12,6 @@ class Cart extends Model implements CartContract protected $guarded = ['id', 'created_at', 'updated_at']; - protected $hidden = ['coupon_code']; - protected $with = ['items', 'items.children']; /** diff --git a/packages/Webkul/Checkout/src/Models/CartShippingRate.php b/packages/Webkul/Checkout/src/Models/CartShippingRate.php index 6ecf168cb..7c4447e33 100755 --- a/packages/Webkul/Checkout/src/Models/CartShippingRate.php +++ b/packages/Webkul/Checkout/src/Models/CartShippingRate.php @@ -7,7 +7,7 @@ use Webkul\Checkout\Contracts\CartShippingRate as CartShippingRateContract; class CartShippingRate extends Model implements CartShippingRateContract { - protected $fillable = ['carrier', 'carrier_title', 'method', 'method_title', 'method_description', 'price', 'base_price']; + protected $fillable = ['carrier', 'carrier_title', 'method', 'method_title', 'method_description', 'price', 'base_price', 'discount_amount', 'base_discount_amount']; /** * Get the post that owns the comment. diff --git a/packages/Webkul/Core/src/Config/concord.php b/packages/Webkul/Core/src/Config/concord.php index 311ede347..24c40b47a 100644 --- a/packages/Webkul/Core/src/Config/concord.php +++ b/packages/Webkul/Core/src/Config/concord.php @@ -19,7 +19,8 @@ return [ \Webkul\Sales\Providers\ModuleServiceProvider::class, \Webkul\Tax\Providers\ModuleServiceProvider::class, \Webkul\User\Providers\ModuleServiceProvider::class, - \Webkul\Discount\Providers\ModuleServiceProvider::class, + \Webkul\CatalogRule\Providers\ModuleServiceProvider::class, + \Webkul\CartRule\Providers\ModuleServiceProvider::class, \Webkul\CMS\Providers\ModuleServiceProvider::class ] ]; \ No newline at end of file diff --git a/packages/Webkul/Core/src/Contracts/CountryStateTranslation.php b/packages/Webkul/Core/src/Contracts/CountryStateTranslation.php new file mode 100644 index 000000000..b5e86d908 --- /dev/null +++ b/packages/Webkul/Core/src/Contracts/CountryStateTranslation.php @@ -0,0 +1,7 @@ +flash('success', trans('shop::app.wishlist.moved')); + session()->flash('success', trans('shop::app.customer.account.wishlist.moved')); } else { - session()->flash('info', trans('shop::app.wishlist.option-missing')); + session()->flash('info', trans('shop::app.checkout.cart.integrity.missing_options')); return redirect()->route('shop.productOrCategory.index', $wishlistItem->product->url_key); } diff --git a/packages/Webkul/Discount/composer.json b/packages/Webkul/Discount/composer.json deleted file mode 100644 index 78ac3d63e..000000000 --- a/packages/Webkul/Discount/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "bagisto/laravel-discount", - "license": "MIT", - "authors": [ - { - "name": "Prashant Singh", - "email": "prashant.singh852@webkul.com" - } - ], - "require": { - "propaganistas/laravel-intl": "^2.0" - }, - "autoload": { - "psr-4": { - "Webkul\\Discount\\": "src/" - } - }, - "extra": { - "laravel": { - "providers": [ - "Webkul\\Discount\\DiscountServiceProvider" - ], - "aliases": {} - } - }, - "minimum-stability": "dev" -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Actions/Cart/Action.php b/packages/Webkul/Discount/src/Actions/Cart/Action.php deleted file mode 100644 index cabe673a4..000000000 --- a/packages/Webkul/Discount/src/Actions/Cart/Action.php +++ /dev/null @@ -1,88 +0,0 @@ -rule; - - $cart = \Cart::getCart(); - - $items = $cart->items()->get(); - - $eligibleItems = collect(); - - if ($this->rule->action_type == 'whole_cart_to_percent' || $this->rule->action_type == 'whole_cart_to_fixed_amount') - $this->eligibleItems = $items; - - if (! $rule->uses_attribute_conditions) { - return $items; - } else { - $productIDs = explode(',', $rule->product_ids); - - foreach ($items as $item) { - foreach ($productIDs as $productID) { - $childrens = $item->children; - - foreach ($childrens as $children) { - if ($children->product_id == $productID) - $eligibleItems->push($item); - } - - if ($item->product_id == $productID) - $eligibleItems->push($item); - } - } - - return $eligibleItems; - } - } - - /** - * To check the items applicability - */ - public function checkApplicability() - { - $rule = $this->rule; - - $eligibleItems = $this->getEligibleItems($rule); - - $apply = function () use($rule, $eligibleItems) { - if ($rule->action_type == 'percent_of_product') { - return true; - } else { - if ($rule->action_type == 'whole_cart_to_percent' && $rule->uses_attribute_condition) { - $matchingIds = explode(',', $rule->product_ids); - - foreach ($matchingIds as $matchingId) { - foreach ($eligibleItems as $item) { - if (($item->child ? $item->child->product_id : $item->product_id) == $matchingId) - return true; - } - } - - return false; - } else { - return true; - } - } - }; - - return $apply(); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php b/packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php deleted file mode 100644 index 12f86396c..000000000 --- a/packages/Webkul/Discount/src/Actions/Cart/FixedAmount.php +++ /dev/null @@ -1,88 +0,0 @@ -rule = $rule; - } - - public function calculate($rule) - { - $impact = collect(); - - $totalDiscount = 0; - - if ($this->checkApplicability()) { - $eligibleItems = $this->getEligibleItems(); - - foreach ($eligibleItems as $item) { - $report = array(); - - $report['item_id'] = $item->id; - $report['child_items'] = collect(); - - $perItemDiscount = $rule->disc_amount / $eligibleItems->count(); - - $itemPrice = $item->base_price; - - $itemQuantity = $item->quantity; - - $discQuantity = $rule->disc_quantity; - $discQuantity = $itemQuantity <= $discQuantity ? $itemQuantity : $discQuantity; - - if ($item->product->getTypeInstance()->isComposite()) { - $isQtyZero = true; - - foreach ($item->children as $children) { - if ($children->quantity > 0) - $isQtyZero = false; - } - - if ($isQtyZero) { - // case for configurable products - $report['product_id'] = $item->children->first()->product_id; - } else { - // composites other than configurable - $report['product_id'] = $item->product_id; - - foreach ($item->children as $children) { - $childBaseTotal = $children->base_total; - - $itemDiscount = $childBaseTotal / ($item->base_total / 100); - - $children->discount = ($itemDiscount / 100) * $perItemDiscount; - - $children->discount = $children->base_total > $children->discount ? $children->discount : $children->base_total; - - $report['child_items']->push($children); - } - } - } else { - $report['product_id'] = $item->product_id; - } - - $discount = round($perItemDiscount, 4) * $discQuantity; - $discount = $discount <= $itemPrice * $discQuantity ? $discount : $itemPrice * $discQuantity; - - $report['discount'] = $discount; - $report['formatted_discount'] = core()->currency($discount); - - $impact->push($report); - - $totalDiscount = $totalDiscount + $discount; - - unset($report); - } - } - - $impact->discount = $totalDiscount; - $impact->formatted_discount = core()->currency($impact->discount); - - return $impact; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php b/packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php deleted file mode 100644 index 2f372a1e8..000000000 --- a/packages/Webkul/Discount/src/Actions/Cart/PercentOfProduct.php +++ /dev/null @@ -1,110 +0,0 @@ -rule = $rule; - } - - /** - * To calculate impact of cart rule's action of current items of cart instance - * - * @param CartRule $rule - * - * @return boolean - */ - public function calculate($rule) - { - $impact = collect(); - - $totalDiscount = 0; - - $applicability = $this->checkApplicability(); - - if ($applicability) { - $eligibleItems = $this->getEligibleItems(); - - $applicableDiscount = function () use ($eligibleItems) { - $total = 0; - - foreach ($eligibleItems as $item) { - $total = $total + $item->base_total; - } - - return $total; - }; - - foreach ($eligibleItems as $item) { - $report = array(); - - $report['item_id'] = $item->id; - $report['child_items'] = collect(); - - $perItemDiscount = $applicableDiscount() * ($rule->disc_amount / 100) / $eligibleItems->count(); - - $itemPrice = $item->base_price; - - $itemQuantity = $item->quantity; - - $discQuantity = $rule->disc_quantity; - $discQuantity = $itemQuantity <= $discQuantity ? $itemQuantity : $discQuantity; - - if ($item->product->getTypeInstance()->isComposite()) { - $isQtyZero = true; - - foreach ($item->children as $children) { - if ($children->quantity > 0) - $isQtyZero = false; - } - - if ($isQtyZero) { - // case for configurable products - $report['product_id'] = $item->children->first()->product_id; - } else { - // composites other than configurable - $report['product_id'] = $item->product_id; - - foreach ($item->children as $children) { - $childBaseTotal = $children->base_total; - - $itemDiscount = $childBaseTotal / ($item->base_total / 100); - - $children->discount = ($itemDiscount / 100) * $perItemDiscount; - - $children->discount = $children->base_total > $children->discount ? $children->discount : $children->base_total; - - $report['child_items']->push($children); - } - } - } else { - $report['product_id'] = $item->product_id; - } - - $discount = round($perItemDiscount, 4) * $discQuantity; - $discount = $discount <= $itemPrice * $discQuantity ? $discount : $itemPrice * $discQuantity; - - $report['discount'] = $discount; - $report['formatted_discount'] = core()->currency($discount); - - $impact->push($report); - - $totalDiscount = $totalDiscount + $discount; - - unset($report); - } - - $impact->discount = $totalDiscount; - $impact->formatted_discount = core()->currency($impact->discount); - - return $impact; - } - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Actions/Cart/WholeCartToFixed.php b/packages/Webkul/Discount/src/Actions/Cart/WholeCartToFixed.php deleted file mode 100644 index 7fbc39cd4..000000000 --- a/packages/Webkul/Discount/src/Actions/Cart/WholeCartToFixed.php +++ /dev/null @@ -1,24 +0,0 @@ -calculate($rule); - - return $result; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Actions/Cart/WholeCartToPercent.php b/packages/Webkul/Discount/src/Actions/Cart/WholeCartToPercent.php deleted file mode 100644 index ffd334370..000000000 --- a/packages/Webkul/Discount/src/Actions/Cart/WholeCartToPercent.php +++ /dev/null @@ -1,24 +0,0 @@ -calculate($rule); - - return $result; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Actions/Catalog/Action.php b/packages/Webkul/Discount/src/Actions/Catalog/Action.php deleted file mode 100644 index ddd2ddc56..000000000 --- a/packages/Webkul/Discount/src/Actions/Catalog/Action.php +++ /dev/null @@ -1,8 +0,0 @@ -discount_amount; - $price = $product->price; - - if ($discountAmount <= $price) { - $discount = $price - $discountAmount; - - return $discount; - } else { - return $price; - } - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Actions/Catalog/AdjustToPercent.php b/packages/Webkul/Discount/src/Actions/Catalog/AdjustToPercent.php deleted file mode 100644 index 6c085a63a..000000000 --- a/packages/Webkul/Discount/src/Actions/Catalog/AdjustToPercent.php +++ /dev/null @@ -1,19 +0,0 @@ -discount_amount; - - $price = $product->price; - - $discount = ($discountAmount / 100) * $price; - - return $discount; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Actions/Catalog/FixedAmount.php b/packages/Webkul/Discount/src/Actions/Catalog/FixedAmount.php deleted file mode 100644 index d37f65df9..000000000 --- a/packages/Webkul/Discount/src/Actions/Catalog/FixedAmount.php +++ /dev/null @@ -1,20 +0,0 @@ -discount_amount; - $price = $product->price; - - if ($discountAmount <= $price) { - return $discountAmount; - } else { - return $price; - } - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Actions/Catalog/PercentOfOriginal.php b/packages/Webkul/Discount/src/Actions/Catalog/PercentOfOriginal.php deleted file mode 100644 index 4fc7c0408..000000000 --- a/packages/Webkul/Discount/src/Actions/Catalog/PercentOfOriginal.php +++ /dev/null @@ -1,19 +0,0 @@ -discount_amount; - - $price = $product->price; - - $discount = ($discountAmount / 100) * $price; - - return $discount; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Config/discount-rules.php b/packages/Webkul/Discount/src/Config/discount-rules.php deleted file mode 100644 index 7f33b90e5..000000000 --- a/packages/Webkul/Discount/src/Config/discount-rules.php +++ /dev/null @@ -1,18 +0,0 @@ - [ - 'fixed_amount' => 'Webkul\Discount\Actions\Cart\FixedAmount', - 'percent_of_product' => 'Webkul\Discount\Actions\Cart\PercentOfProduct', - 'whole_cart_to_fixed' => 'Webkul\Discount\Actions\Cart\WholeCartToFixed', - 'whole_cart_to_percent' => 'Webkul\Discount\Actions\Cart\WholeCartToPercent' - ], - - 'catalog' => [ - 'fixed_amount' => 'Webkul\Discount\Actions\Catalog\FixedAmount', - 'final_price_to_percent' => 'Webkul\Discount\Actions\Catalog\AdjustToPercent', - 'percent_of_original' => 'Webkul\Discount\Actions\Catalog\PercentOfOriginal', - 'to_discount_value' => 'Webkul\Discount\Actions\Catalog\AdjustToDiscountValue' - ] -]; \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Config/rule-conditions.php b/packages/Webkul/Discount/src/Config/rule-conditions.php deleted file mode 100644 index f12629492..000000000 --- a/packages/Webkul/Discount/src/Config/rule-conditions.php +++ /dev/null @@ -1,174 +0,0 @@ - [ - 'all_are_true' => 'All conditions are true', - 'any_is_true' => 'Any condition is true', - ], - - 'cart' => [ - 'actions' => [ - 'fixed_amount' => 'Apply as fixed amount', - 'percent_of_product' => 'Percentage of product', - 'whole_cart_to_fixed' => 'Adjust whole cart to fixed amount', - 'whole_cart_to_percent' => 'Adjust whole cart to percent' - ], - - 'validation' => [ - 0 => 'percent_of_product', - 1 => 'fixed_amount', - 2 => 'whole_cart_to_percent', - 3 => 'whole_cart_to_fixed' - ], - - 'conditions' => [ - 'numeric' => [ - '=' => 'Equals', - '>=' => 'Greater or equals', - '<=' => 'Lesser or equals', - '>' => 'Greater than', - '<' => 'Lesser than' - ], - - 'string' => [ - '=' => 'Equals', - // '>=' => 'Greater or equals', - // '<=' => 'Lesser or equals', - // '>' => 'Greater than', - // '<' => 'Lesser than', - '{}' => 'Contains', - '!{}' => 'Does not contains' - ], - - 'boolean' => [ - 0 => 'True/Yes', - 1 => 'False/No' - ], - - 'symbols' => [ - '=' => 'equals', - '>=' => 'greater_or_equals', - '<=' => 'lesser_or_equals', - '>' => 'greater_than', - '<' => 'lesser_than', - '{}' => 'contains', - '={}' => 'is_one_of', - '!={}' => 'is_not_one_of', - '!{}' => 'does_not_contains' - ] - ], - - 'attributes' => [ - 0 => [ - 'code' => 'sub_total', - 'name' => 'Sub Total', - 'type' => 'numeric' - ], - 1 => [ - 'code' => 'total_items', - 'name' => 'Total Items', - 'type' => 'numeric' - ], - 2 => [ - 'code' => 'total_weight', - 'name' => 'Total Weight', - 'type' => 'numeric' - ], - 3 => [ - 'code' => 'shipping_method', - 'name' => 'Shipping Method', - 'type' => 'string' - ], - 4 => [ - 'code' => 'payment_method', - 'name' => 'Payment Method', - 'type' => 'string' - ], - 5 => [ - 'code' => 'shipping_postcode', - 'name' => 'Shipping Postcode', - 'type' => 'string' - ], - 6 => [ - 'code' => 'shipping_state', - 'name' => 'Shipping State', - 'type' => 'string' - ], - 7 => [ - 'code' => 'shipping_country', - 'name' => 'Shipping Country', - 'type' => 'string' - ], - 8 => [ - 'code' => 'shipping_city', - 'name' => 'Shipping City', - 'type' => 'string' - ] - ] - ], - - 'catalog' => [ - 'actions' => [ - 'percent_of_original' => 'Percentage of product', - 'fixed_amount' => 'Apply as fixed amount', - 'final_price_to_percent' => 'Adjust price to percentage', - 'to_discount_value' => 'Adjust price to given amount' - ], - - 'validation' => [ - 0 => 'percent_of_product', - 1 => 'fixed_amount', - 2 => 'buy_a_get_b', - 3 => 'fixed_amount_cart' - ], - - 'conditions' => [ - 'numeric' => [ - '=' => 'Equals', - '>=' => 'Greater or equals', - '<=' => 'Lesser or equals', - '>' => 'Greater than', - '<' => 'Lesser than', - ], - - 'string' => [ - '=' => 'Equals', - '>=' => 'Greater or equals', - '<=' => 'Lesser or equals', - '>' => 'Greater than', - '<' => 'Lesser than', - '{}' => 'Contains', - '!{}' => 'Does not contains' - ], - - 'select' => [ - '=' => 'Equals', - '{}' => 'Contains', - '!{}' => 'Does not contains' - ], - - 'multiselect' => [ - '=' => 'Equals', - '{}' => 'Contains', - '!{}' => 'Does not contains' - ], - - 'boolean' => [ - 0 => 'True/Yes', - 1 => 'False/No' - ], - - 'symbols' => [ - '=' => 'equals', - '>=' => 'greater_or_equals', - '<=' => 'lesser_or_equals', - '>' => 'greater_than', - '<' => 'lesser_than', - '{}' => 'contains', - '={}' => 'is_one_of', - '!={}' => 'is_not_one_of', - '!{}' => 'does_not_contains' - ] - ] - ] -]; \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Contracts/CartRule.php b/packages/Webkul/Discount/src/Contracts/CartRule.php deleted file mode 100644 index c6da453eb..000000000 --- a/packages/Webkul/Discount/src/Contracts/CartRule.php +++ /dev/null @@ -1,7 +0,0 @@ -increments('id'); - $table->integer('channel_id')->unsigned()->nullable(); - $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); - $table->integer('locale_id')->unsigned()->nullable(); - $table->foreign('locale_id')->references('id')->on('locales')->onDelete('cascade'); - $table->integer('cart_rule_id')->unsigned()->nullable(); - $table->foreign('cart_rule_id')->references('id')->on('cart_rules')->onDelete('cascade'); - $table->text('label')->nullable(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('cart_rule_labels'); - } -} diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_05_24_113949_create_cart_rule_coupons_usage_table.php b/packages/Webkul/Discount/src/Database/Migrations/2019_05_24_113949_create_cart_rule_coupons_usage_table.php deleted file mode 100644 index 60f23900e..000000000 --- a/packages/Webkul/Discount/src/Database/Migrations/2019_05_24_113949_create_cart_rule_coupons_usage_table.php +++ /dev/null @@ -1,39 +0,0 @@ -increments('id'); - $table->integer('coupon_id')->unsigned(); - $table->foreign('coupon_id')->references('id')->on('cart_rules')->onDelete('cascade'); - $table->integer('channel_id')->unsigned(); - $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); - $table->integer('customer_id')->unsigned(); - $table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade'); - $table->bigInteger('usage')->unsigned()->default(0); - $table->date('expired_on'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('cart_rule_coupons_usage'); - } -} diff --git a/packages/Webkul/Discount/src/Helpers/Cart/ConvertXToProductId.php b/packages/Webkul/Discount/src/Helpers/Cart/ConvertXToProductId.php deleted file mode 100644 index 9c49d609b..000000000 --- a/packages/Webkul/Discount/src/Helpers/Cart/ConvertXToProductId.php +++ /dev/null @@ -1,292 +0,0 @@ -category = $category; - - $this->attribute = $attributeRepository; - - $this->product = $product; - - $this->attributeOptionRepository = $attributeOptionRepository; - - $this->cartRule = $cartRule; - - $this->pav = $pav; - - $this->conditionSymbols = config('pricerules.cart.conditions.symbols'); - } - - /** - * Collects the attribute and category conditions - * - * @param Integer $ruleId - * - * @param Object $attrribute_conditions - */ - public function convertX($ruleId, $attribute_conditions) - { - $attributeConditions = $attribute_conditions; - - $categoryValues = $attributeConditions->categories ?? null; - - $attributeValues = $attributeConditions->attributes ?? null; - - if (! isset($categoryValues) && ! isset($attributeValues)) - return false; - - $categoryResult = collect(); - - if (isset($categoryValues) && count($categoryValues)) - $categoryResult = $this->convertFromCategories($categoryValues); - - $attributeResult = collect(); - - if (isset($attributeValues) && count($attributeValues)) - $attributeResult = $this->convertFromAttributes($attributeValues); - - // now call the function that will find all the unique product ids - $productIDs = $this->findAllUniqueIds($attributeResult, $categoryResult); - - // save the product ids against the cart rules - return $this->saveIDs($ruleId, $productIDs) ? true : false; - } - - /** - * This method will return product id from the attribute and attribute option params - * - * @return array - */ - public function convertFromAttributes($attributeOptions) - { - $products = collect(); - - foreach ($attributeOptions as $attributeOption) { - $selectedOptions = $attributeOption->value; - - if ($attributeOption->type == 'select' || $attributeOption->type == 'multiselect') { - $attribute = $this->attribute->findWhere(['code' => $attributeOption->attribute]); - - $attributeOptions = $attribute->first()->options; - - $selectedAttributeOptions = collect(); - - foreach ($attributeOptions as $attributeOption) { - foreach ($selectedOptions as $key => $value) { - if ($attributeOption->id == $value) - $selectedAttributeOptions->push($attributeOption); - } - } - - foreach($selectedAttributeOptions as $selectedAttributeOption) { - $typeColumn = $this->pav::$attributeTypeFields[$attribute->first()->type]; - - $pavResults = $this->pav->where( - "{$typeColumn}", $selectedAttributeOption->id - )->get(); - - foreach ($pavResults as $pavResult) { - if ($pavResult->product->type == 'simple') - $products->push($pavResult->product); - } - } - } else { - $attribute = $this->attribute->findWhere([ - 'code' => $attributeOption->attribute - ]); - - $pavValues = $attribute->first(); - - $selectedAttributeValues = collect(); - - $foundProducts = collect(); - - if ($attributeOption->attribute == 'sku') { - $testValue = $attributeOption->value; - $testCondition = $attributeOption->condition; - - if ($testCondition == '{}') { - $foundProducts = $this->product->findWhere([ - ['sku', 'like', '%'.$testValue.'%'], - ])->flatten()->all(); - } else if ($testCondition == '!{}') { - $foundProducts = $this->product->findWhere([ - ['sku', 'not like', '%'.$testValue.'%'], - ])->flatten()->all(); - } else if ($testCondition == '=') { - $foundProducts = $this->product->findWhere([ - ['sku', '=', $testValue], - ])->flatten()->all(); - } - } - - foreach($foundProducts as $foundProduct) { - $products->push($foundProduct); - } - } - } - - return $products; - } - - /** - * This method will return product id from the attribute and attribute option params - * - * @param Collection $categories - * - * @return array - */ - public function convertFromCategories($categories) - { - $products = collect(); - - foreach ($categories as $category) { - $data = $this->getAll($category->id); - - if ($data->count()) { - $products->push($data); - - unset($data); - } - } - - return $products->flatten()->all(); - } - - /** - * This method will remove the duplicates from the array and merge all the items into single array - * - * @param array - * - * @return array - */ - public function findAllUniqueIds(...$data) - { - $attributeResult = $data[0] ?? collect(); - $categoryResult = $data[1] ?? collect(); - - // find matched attribute options product ids - $mergedCollection = $attributeResult->merge($categoryResult); - - $productIDs = collect(); - - foreach ($mergedCollection as $merged) { - $productIDs->push($merged->id); - } - - // find all the unique product ids - return $productIDs->unique()->flatten()->all(); - } - - /** - * This method will save the product ids in the datastore - * - * @param integer $ruleId - * - * @param array $productIDs - * - * @return boolean - */ - public function saveIDs($ruleId, $productIDs) - { - $cartRule = $this->cartRule->find($ruleId); - - $productIDs = implode(',', $productIDs); - - return $cartRule->update(['product_ids' => $productIDs]); - } - - /** - * To get all product ids lying in the criteria - * - * @param integer $categoryId - * - * @return Collection - */ - public function getAll($categoryId = null) - { - return app('Webkul\Product\Repositories\ProductFlatRepository')->scopeQuery(function($query) use($categoryId) { - $channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode()); - - $locale = request()->get('locale') ?: app()->getLocale(); - - $qb = $query->distinct() - ->addSelect('product_flat.*') - ->leftJoin('products', 'product_flat.product_id', '=', 'products.id') - ->leftJoin('product_categories', 'products.id', '=', 'product_categories.product_id') - ->where('product_flat.channel', $channel) - ->where('product_flat.locale', $locale) - ->whereNotNull('product_flat.url_key'); - - if ($categoryId) - $qb->where('product_categories.category_id', $categoryId); - - $qb->where('product_flat.status', 1); - - $qb->where('product_flat.visible_individually', 1); - - $queryBuilder = $qb->leftJoin('product_flat as flat_variants', function($qb) use($channel, $locale) { - $qb->on('product_flat.id', '=', 'flat_variants.parent_id') - ->where('flat_variants.channel', $channel) - ->where('flat_variants.locale', $locale); - }); - - $qb = $qb->leftJoin('products as variants', 'products.id', '=', 'variants.parent_id'); - - return $qb->groupBy('product_flat.id'); - })->get(); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Helpers/Cart/CouponAbleRule.php b/packages/Webkul/Discount/src/Helpers/Cart/CouponAbleRule.php deleted file mode 100644 index 892bcd14e..000000000 --- a/packages/Webkul/Discount/src/Helpers/Cart/CouponAbleRule.php +++ /dev/null @@ -1,57 +0,0 @@ -validateIfAlreadyApplied(); - - $rules = $this->getApplicableRules($code); - - if ($rules->count() == 1) { - $rule = $rules->first(); - - $canApply = $this->canApply($rule); - - if ($canApply) { - $this->save($rule); - - $this->updateCartItemAndCart($rule); - - return true; - } - } else { - return false; - } - - return false; - } - - /** - * Removes the already applied coupon on the current cart instance - * - * @return boolean - */ - public function remove() - { - $cart = Cart::getCart(); - - $existingRule = $this->cartRuleCart->findWhere(['cart_id' => $cart->id]); - - $this->clearDiscount(); - - return true; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Helpers/Cart/Discount.php b/packages/Webkul/Discount/src/Helpers/Cart/Discount.php deleted file mode 100644 index 415a6b657..000000000 --- a/packages/Webkul/Discount/src/Helpers/Cart/Discount.php +++ /dev/null @@ -1,994 +0,0 @@ -cartRule = $cartRule; - - $this->cartRuleCart = $cartRuleCart; - - $this->cartItem = $cartItem; - - $this->rules = config('discount-rules'); - } - - /** - * Abstract method apply - */ - abstract public function apply($code); - - /** - * To find all the suitable rules that can be applied on the current cart - * - * @return collection $rules - */ - public function getApplicableRules($code = null) - { - $rules = collect(); - - if ($code != null) { - $eligibleRules = $this->cartRule->findWhere(['use_coupon' => 1, 'status' => 1]); - - foreach($eligibleRules as $rule) { - if ($rule->coupons->code == $code) { - $rules->push($rule); - - break; - } - } - } else { - $rules = $this->cartRule->findWhere(['use_coupon' => 0, 'status' => 1]); - } - - $filteredRules = collect(); - - // time based constraints - foreach ($rules as $rule) { - if ($this->checkApplicability($rule)) { - if ($rule->starts_from != null && $rule->ends_till == null) { - if (Carbon::parse($rule->starts_from) < now()) { - $rule->impact = $this->calculateImpact($rule); - - $filteredRules->push($rule); - } - } else if ($rule->starts_from == null && $rule->ends_till != null) { - if (Carbon::parse($rule->ends_till) > now()) { - $rule->impact = $this->calculateImpact($rule); - - $filteredRules->push($rule); - } - } else if ($rule->starts_from != null && $rule->ends_till != null) { - if (Carbon::parse($rule->starts_from) < now() && now() < Carbon::parse($rule->ends_till)) { - $rule->impact = $this->calculateImpact($rule); - - $filteredRules->push($rule); - } - } else { - $rule->impact = $this->calculateImpact($rule); - - $filteredRules->push($rule); - } - } - } - - return $filteredRules; - } - - /** - * To find that one rule that is going to be applied on the current cart - * - * @param Collection $rules - * - * @return CartRule $rule - */ - public function breakTie($rules) - { - $result = $this->sortByLeastPriority($rules); - - if (count($result) > 1) { - // check for max impact criteria - if (count($result) > 1) { - $result = $this->findMaxImpact($result); - - if (count($result) > 1) { - $result = $this->findOldestRule($result); - - return $result; - } else if (count($result) == 1) { - return $result->first(); - } else { - return collect(); - } - } else if (count($result) == 1) { - return $result->first(); - } else { - return collect(); - } - } else if (count($result) == 1) { - return $result->first(); - } else { - return collect(); - } - - return collect(); - } - - /** - * To find the oldes rule - * - * @param Collection $rules - * - * @return CartRule $oldestRule - */ - public function findOldestRule($rules) - { - $leastID = 999999999999; - - foreach ($rules as $index => $rule) { - if ($rule->id < $leastID) { - $leastID = $rule->id; - $oldestRule = $rule; - } - } - - return $oldestRule; - } - - /** - * To sort the rules by the least priority - * - * @param Collection $rules - * - * @return Collection $rule - */ - public function sortByLeastPriority($rules) - { - $sortedRules = collect(); - - $minPriority = $rules->min('priority'); - - foreach ($rules as $rule) { - if ($rule->priority == $minPriority) - $sortedRules->push($rule); - } - - return $sortedRules; - } - - /** - * To check where rule ends other rules - * - * @param CartRule $rule - * - * @return $rule - */ - public function isEndRule($rule) - { - if ($rule->end_other_rules) { - return true; - } else { - return false; - } - } - - /** - * To find whether rule can be applied or not - * - * @param CartRule $rule - * - * @return boolean - */ - public function canApply($rule) - { - $cart = \Cart::getCart(); - - $alreadyApplied = $this->cartRuleCart->findWhere(['cart_id' => $cart->id]); - - if ($alreadyApplied->count() && $alreadyApplied->first()->cart_rule->id == $rule->id) { - if ($this->validateRule($alreadyApplied->first()->cart_rule)) { - $this->reassess($alreadyApplied->first()->cart_rule, $cart); - - return false; - } else { - $this->clearDiscount(); - - return true; - } - } else if ($alreadyApplied->count() && $alreadyApplied->first()->cart_rule->id != $rule->id && ! $alreadyApplied->first()->cart_rule->end_other_rules) { - if ($rule->use_coupon) { - if ($alreadyApplied->first()->cart_rule->use_coupon) { - $rules = collect(); - - $alreadyAppliedRule = $alreadyApplied->first()->cart_rule; - $alreadyAppliedRule->impact = $this->calculateImpact($alreadyAppliedRule); - - $rule->impact = $this->calculateImpact($alreadyAppliedRule); - - $rules->push($alreadyAppliedRule); - $rules->push($rule); - - $result = $this->breakTie($rules); - - if ($result->id == $rule->id) { - return true; - } else { - return false; - } - } else { - return true; - } - } else { - // this case will work when non couponable rule is applied and another non couponable rule is created - // again break tie - $rules = collect(); - - $alreadyAppliedRule = $alreadyApplied->first()->cart_rule; - $alreadyAppliedRule->impact = $this->calculateImpact($alreadyAppliedRule); - - $rule->impact = $this->calculateImpact($alreadyAppliedRule); - - $rules->push($alreadyAppliedRule); - $rules->push($rule); - - $result = $this->breakTie($rules); - - if ($result) { - if ($result->id != $rule->id) { - return true; - } else { - return false; - } - } - } - } else { - return true; - } - } - - /** - * To reassess the discount in case no. of items gets changed - * - * @return Void - */ - public function reassess($rule) - { - $rule->impact = $this->calculateImpact($rule); - - $this->updateCartItemAndCart($rule); - - return $rule; - } - - /** - * To return cart rule which has the max impact - * - * @param Collection $rules - * - * @return Collection $rule - */ - public function findMaxImpact($rules) - { - $maxImpact = collect(); - - $maxDiscount = 0; - - if ($rules->count()) { - $maxDiscount = $rules->max('impact.discount'); - - foreach ($rules as $rule) { - if ($rule->impact->discount == $maxDiscount) - $maxImpact = $maxImpact->push($rule); - } - } else { - return collect(); - } - - return $maxImpact; - } - - /** - * To calculate the impact of the rule - * - * @return collection - */ - public function calculateImpact($rule) - { - $impact = $this->getActionInstance($rule); - - $outcome = $impact->calculate($rule); - - return $outcome; - } - - /** - * Return the instance of the related rule's action type - * - * @param CartRule $rule - * - * @return Object - */ - public function getActionInstance($rule) - { - $this->rules = config('discount-rules'); - - $actionType = new $this->rules['cart'][$rule->action_type]($rule); - - return $actionType; - } - - /** - * Checks whether rules is getting applied on current cart instance or not - * - * @param CartRule $rule - * - * @return Boolean - */ - public function checkApplicability($rule) - { - $cart = \Cart::getCart(); - - $timeBased = false; - - $channelBased = false; - - // time based constraints - if ($rule->starts_from != null && $rule->ends_till == null) { - if (Carbon::parse($rule->starts_from) < now()) - $timeBased = true; - } else if ($rule->starts_from == null && $rule->ends_till != null) { - if (Carbon::parse($rule->ends_till) > now()) - $timeBased = true; - } else if ($rule->starts_from != null && $rule->ends_till != null) { - if (Carbon::parse($rule->starts_from) < now() && now() < Carbon::parse($rule->ends_till)) - $timeBased = true; - } else { - $timeBased = true; - } - - // channel based constraints - foreach ($rule->channels as $channel) { - if ($channel->channel_id == core()->getCurrentChannel()->id) - $channelBased = true; - } - - $customerGroupBased = false; - - // customer groups based constraints - if (auth()->guard('customer')->check()) { - foreach ($rule->customer_groups as $customer_group) { - if (auth()->guard('customer')->user()->group->exists()) { - if ($customer_group->customer_group_id == auth()->guard('customer')->user()->group->id) - $customerGroupBased = true; - } - } - } else { - foreach ($rule->customer_groups as $customer_group) { - if ($customer_group->customer_group->code == 'guest') - $customerGroupBased = true; - } - } - - $conditionsBased = true; - - //check conditions - if ($rule->conditions != null) { - $conditions = json_decode(json_decode($rule->conditions)); - - $test_mode = array_last($conditions); - - if ($test_mode->criteria == 'any_is_true') - $conditionsBased = $this->testIfAnyConditionIsTrue($conditions, $cart); - - if ($test_mode->criteria == 'all_are_true') - $conditionsBased = $this->testIfAllConditionAreTrue($conditions, $cart); - } - - $partialMatch = 0; - - if ($rule->uses_attribute_conditions) { - $productIDs = explode(',', $rule->product_ids); - - foreach ($productIDs as $productID) { - foreach ($cart->items as $item) { - if ($item->product_id == $productID) - $partialMatch = 1; - } - - $childrens = $item->children; - - foreach ($childrens as $children) { - if ($children->product_id == $productID) - $partialMatch = 1; - } - } - } - - if ($channelBased && $customerGroupBased && $timeBased && $conditionsBased) { - if ($rule->uses_attribute_conditions == 1 && $partialMatch) { - return true; - } else if ($rule->uses_attribute_conditions == 0) { - return true; - } else { - return false; - } - } else { - return false; - } - } - - /** - * Save the rule in the CartRule for current cart instance - * - * @param CartRule $rule - * - * @return Boolean - */ - public function save($rule) - { - $cart = \Cart::getCart(); - - $alreadyApplied = $this->cartRuleCart->findWhere(['cart_id' => $cart->id]); - - if ($alreadyApplied->count()) { - $result = $alreadyApplied->first()->update(['cart_rule_id' => $rule->id]); - } else { - $result = $this->cartRuleCart->create(['cart_id' => $cart->id, 'cart_rule_id' => $rule->id]); - } - - return $result ? true : false; - } - - /** - * Apply on shipping - * - * @param CartRule $apploedRule - * - * @param Cart $cart - * - * @return void - */ - public function applyOnShipping($appliedRule, $cart) - { - $cart = \Cart::getCart(); - - if (isset($cart->selected_shipping_rate)) { - if ($appliedRule->free_shipping && $cart->selected_shipping_rate->base_price > 0) { - $cart->selected_shipping_rate->update(['price' => 0, 'base_price' => 0]); - } else if ($appliedRule->free_shipping == 0 && $appliedRule->apply_to_shipping && $cart->selected_shipping_rate->base_price > 0) { - $actionType = config('discount-rules')[$appliedRule->action_type]; - - if ($appliedRule->apply_to_shipping) { - $actionInstance = new $actionType; - - $discountOnShipping = $actionInstance->calculateOnShipping($cart); - - $discountOnShipping = ($discountOnShipping / 100) * $cart->selected_shipping_rate->base_price; - - $cart->selected_shipping_rate->update([ - 'price' => $cart->selected_shipping_rate->price - core()->convertPrice($discountOnShipping, $cart->cart_currency_code), - 'base_price' => $cart->selected_shipping_rate->base_price - $discountOnShipping - ]); - } - } - } - } - - /** - * Resets the shipping for the current items in the cart - * - * @param Cart $cart - * - * @return Void - */ - public function resetShipping($cart) - { - $cart = \Cart::getCart(); - - if (isset($cart->selected_shipping_rate->carrier)) { - $shippingRate = config('carriers')[$cart->selected_shipping_rate->carrier]['class']; - - $actualShippingRate = new $shippingRate; - $actualShippingRate = $actualShippingRate->calculate(); - - if (is_array($actualShippingRate)) { - foreach($actualShippingRate as $actualRate) { - if ($actualRate->method == $cart->selected_shipping_rate->method) { - $actualShippingRate = $actualRate; - - break; - } - } - } - - $actualShippingPrice = $actualShippingRate->price; - $actualShippingBasePrice = $actualShippingRate->base_price; - $cartShippingRate = $cart->selected_shipping_rate; - - $cartShippingRate->update(['price' => $actualShippingPrice, 'base_price' => $actualShippingBasePrice]); - } - } - - /** - * Update discount for least worth item - * - * @param CartRule $rule - * - * @return Boolean - */ - public function updateCartItemAndCart($rule) - { - $cart = Cart::getCart(); - - $itemImpacts = $rule->impact; - - foreach ($itemImpacts as $itemImpact) { - $item = $this->cartItem->findOneWhere(['id' => $itemImpact['item_id']]); - - if (isset($itemImpact['child_items']) && $itemImpact['child_items']->count()) { - $totalItemDiscount = 0.0000; - - foreach ($itemImpact['child_items'] as $child) { - $discount = $child->discount; - - $totalItemDiscount = $totalItemDiscount + $discount; - - unset($child->discount); - - $child->update([ - 'discount_amount' => core()->convertPrice($discount, $cart->cart_currency_code), - 'base_discount_amount' => $discount - ]); - - if ($rule->action_type == 'percent_of_product') { - $child->update(['discount_percent' => $rule->discount_amount]); - } - - if ($rule->use_coupon) { - $coupon = $rule->coupons->code; - - $child->update(['coupon_code' => $coupon]); - } - - $this->updateParent($child, $totalItemDiscount, $cartCurrencyCode = $cart->cart_currency_code); - } - } else { - $item->update([ - 'discount_amount' => core()->convertPrice($itemImpact['discount'], $cart->cart_currency_code), - 'base_discount_amount' => $itemImpact['discount'] - ]); - - if ($rule->action_type == 'percent_of_product') { - $item->update(['discount_percent' => $rule->discount_amount]); - } - - if ($rule->use_coupon) { - $coupon = $rule->coupons->code; - - $item->update(['coupon_code' => $coupon]); - } - } - } - - if ($rule->use_coupon) { - $cart->update(['coupon_code' => $rule->coupons->code]); - } - - // if ($rule->free_shipping || $rule->apply_on_shipping) { - // $this->applyOnShipping($rule); - // } - - Cart::collectTotals(); - - return true; - } - - /** - * To update the discount on parent CartItem - */ - private function updateParent($item, $discount, $currencyCode) - { - $parentItem = $this->cartItem->findOneWhere(['id' => $item->parent_id]); - - $parentItem->update([ - 'base_discount_amount' => $discount, - 'discount_amount' => core()->convertPrice($discount, $currencyCode) - ]); - } - - /** - * Removes any cart rule from the current cart instance - * - * @return Boolean - */ - public function clearDiscount() - { - $cart = Cart::getCart(); - - $cartItems = $cart->items; - - // remove all the discount properties from items - foreach ($cartItems as $item) { - $item->update([ - 'coupon_code' => NULL, - 'discount_percent' => 0, - 'discount_amount' => 0, - 'base_discount_amount' => 0 - ]); - } - - // remove all the discount properties from cart - $cart->update([ - 'coupon_code' => NULL, - 'discount_amount' => 0, - 'base_discount_amount' => 0 - ]); - - // find & remove cart rule from cart rule cart resource - $cartRuleCart = $this->cartRuleCart->findWhere(['cart_id' => $cart->id]); - - $cartRuleCart->first()->delete(); - - return true; - } - - /** - * Validate the currently applied cart rule - * - * @param CartRule $rule - * - * @return Boolean - */ - public function validateRule($rule) - { - $applicability = $this->checkApplicability($rule); - - if ($applicability && $rule->status) { - return true; - } else { - return false; - } - } - - /** - * Will validate already applied rule - * - * @return Void - */ - public function validateIfAlreadyApplied() - { - $cart = \Cart::getCart(); - - $alreadyAppliedRule = $this->cartRuleCart->findWhere(['cart_id' => $cart->id]); - - if ($alreadyAppliedRule->count()) { - $alreadyAppliedCartRule = $alreadyAppliedRule->first()->cart_rule; - - $result = $this->validateRule($alreadyAppliedCartRule); - - if (! $result) { - $this->clearDiscount(); - - $alreadyAppliedRule->first()->delete(); - } else { - $this->reassess($alreadyAppliedCartRule); - } - } - } - - /** - * Retreives all the payment methods from application config - * - * @return Array - */ - public function getPaymentMethods() - { - $paymentMethods = config('paymentmethods'); - - return $paymentMethods; - } - - /** - * Retreives all the shippin methods from the application config - * - * @return array - */ - public function getShippingMethods() - { - $shippingMethods = config('carriers'); - - return $shippingMethods; - } - - /** - * Checks the rule against the current cart instance whether rule conditions are applicable - * or not - * - * @param Array $conditions - * - * @param Cart $cart - * - * @return Boolean - */ - protected function testIfAllConditionAreTrue($conditions, $cart) - { - $paymentMethods = $this->getPaymentMethods(); - - $shippingMethods = $this->getShippingMethods(); - - array_pop($conditions); - - $shipping_address = $cart->getShippingAddressAttribute() ?? null; - - $shipping_method = $cart->selected_shipping_rate->method_title ?? null; - - $shipping_country = $shipping_address->country ?? null; - - $shipping_state = $shipping_address->state ?? null; - - $shipping_postcode = $shipping_address->postcode ?? null; - - $shipping_city = $shipping_address->city ?? null; - - $payment_method = isset($cart->payment) ? $paymentMethods[$cart->payment->method]['title'] : null; - - $sub_total = $cart->base_sub_total; - - $total_items = $cart->items_qty; - - $total_weight = 0; - - foreach ($cart->items as $item) { - $total_weight = $total_weight + $item->base_total_weight; - } - - $result = true; - - foreach ($conditions as $condition) { - $result = true; - - if (! isset($condition->attribute) || ! isset($condition->condition) || ! isset($condition->value) || ! isset($condition->type) || ! $condition->value != []) { - $result = false; - - continue; - } - - if (isset($condition->attribute)) { - $actual_value = ${$condition->attribute}; - } else { - $result = false; - } - - if (isset($condition->value)) { - $test_value = $condition->value; - - } else { - $result = false; - } - - if (isset($condition->condition)) { - $test_condition = $condition->condition; - } - else { - $result = false; - } - - if ($condition->type == 'string') { - $actual_value = strtolower($actual_value); - - $test_value = strtolower($test_value); - } - - if ($test_condition == '=') { - if ($actual_value != $test_value) { - $result = false; - - break; - } - } else if ($test_condition == '>=') { - if (! ($actual_value >= $test_value)) { - $result = false; - - break; - } - } else if ($test_condition == '<=') { - if (! ($actual_value <= $test_value)) { - $result = false; - - break; - } - } else if ($test_condition == '>') { - if (! ($actual_value > $test_value)) { - $result = false; - - break; - } - } else if ($test_condition == '<') { - if (! ($actual_value < $test_value)) { - $result = false; - - break; - } - } else if ($test_condition == '{}') { - if (! str_contains($actual_value, $test_value)) { - $result = false; - - break; - } - } else if ($test_condition == '!{}') { - if (str_contains($actual_value, $test_value)) { - $result = false; - - break; - } - } - } - - return $result; - } - - /** - * Checks the rule against the current cart instance whether rule conditions are applicable - * or not - * - * @param Array $conditions - * - * @param Cart $cart - * - * @return Boolean - */ - protected function testIfAnyConditionIsTrue($conditions, $cart) - { - $paymentMethods = $this->getPaymentMethods(); - - $shippingMethods = $this->getShippingMethods(); - - array_pop($conditions); - - $result = false; - - $shipping_address = $cart->getShippingAddressAttribute() ?? null; - - $shipping_method = $cart->selected_shipping_rate->method_title ?? null; - - $shipping_country = $shipping_address->country ?? null; - - $shipping_state = $shipping_address->state ?? null; - - $shipping_postcode = $shipping_address->postcode ?? null; - - $shipping_city = $shipping_address->city ?? null; - - $payment_method = isset($cart->payment) ? $paymentMethods[$cart->payment->method]['title'] : null; - - $sub_total = $cart->base_sub_total; - - $total_items = $cart->items_qty; - - $total_weight = 0; - - foreach($cart->items as $item) { - $total_weight = $total_weight + $item->base_total_weight; - } - - foreach ($conditions as $condition) { - if (! isset($condition->attribute) || ! isset($condition->condition) || ! isset($condition->value)) { - continue; - } - - if (isset($condition->attribute)) { - $actual_value = ${$condition->attribute}; - } else { - $result = false; - } - - if (isset($condition->value)) { - $test_value = $condition->value; - } else { - $result = false; - } - - if (isset($condition->condition)) { - $test_condition = $condition->condition; - } else { - $result = false; - } - - if ($condition->type == 'numeric' || $condition->type == 'string' || $condition->type == 'text') { - if ($condition->type == 'string') { - $actual_value = strtolower($actual_value); - - $test_value = strtolower($test_value); - } - - if ($test_condition == '=') { - if ($actual_value == $test_value) { - $result = true; - - break; - } - } else if ($test_condition == '>=') { - if ($actual_value >= $test_value) { - $result = true; - - break; - } - } else if ($test_condition == '<=') { - if ($actual_value <= $test_value) { - $result = true; - - break; - } - } else if ($test_condition == '>') { - if ($actual_value > $test_value) { - $result = true; - - break; - } - } else if ($test_condition == '<') { - if ($actual_value < $test_value) { - $result = true; - - break; - } - } else if ($test_condition == '{}') { - if (str_contains($actual_value, $test_value)) { - $result = true; - - break; - } - } else if ($test_condition == '!{}') { - if (! str_contains($actual_value, $test_value)) { - $result = true; - - break; - } - } - } - } - - return $result; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Helpers/Cart/NonCouponAbleRule.php b/packages/Webkul/Discount/src/Helpers/Cart/NonCouponAbleRule.php deleted file mode 100644 index 713cce2d4..000000000 --- a/packages/Webkul/Discount/src/Helpers/Cart/NonCouponAbleRule.php +++ /dev/null @@ -1,46 +0,0 @@ -validateIfAlreadyApplied(); - - $rules = $this->getApplicableRules(); - - if ($rules->count() == 1) { - $rule = $rules->first(); - - $canApply = $this->canApply($rule); - - if ($canApply && isset($rule->impact)) { - $result = $this->save($rule); - - $this->updateCartItemAndCart($rule); - } - } else if ($rules->count() > 1) { - $rule = $this->breakTie($rules); - - $canApply = $this->canApply($rule); - - if ($canApply) { - $this->save($rule); - - $this->updateCartItemAndCart($rule); - } - } else { - return false; - } - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Helpers/Cart/ValidatesDiscount.php b/packages/Webkul/Discount/src/Helpers/Cart/ValidatesDiscount.php deleted file mode 100644 index f6b0b68c3..000000000 --- a/packages/Webkul/Discount/src/Helpers/Cart/ValidatesDiscount.php +++ /dev/null @@ -1,26 +0,0 @@ -validateIfAlreadyApplied(); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Helpers/Catalog/Apply.php b/packages/Webkul/Discount/src/Helpers/Catalog/Apply.php deleted file mode 100644 index 95c8f22e0..000000000 --- a/packages/Webkul/Discount/src/Helpers/Catalog/Apply.php +++ /dev/null @@ -1,542 +0,0 @@ - @prashant-webkul - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class Apply extends Sale -{ - /** - * To hold the catalog rule repository instance - */ - protected $catalogRule; - - /** - * To maintain the list of deceased rules and remove their records if present - */ - protected $activeRules; - - /** - * To maintain the list of deceased rules and remove their records if present - */ - protected $deceased; - - /** - * Holds convertXToProductId instance - */ - protected $convertX; - - /** - * Hold catalog rule products repository instance - */ - protected $catalogRuleProduct; - - /** - * Hold catalog rule products price repository instance - */ - protected $catalogRuleProductPrice; - - /** - * Hold ProductRepository instance - */ - protected $product; - - /** - * To hold the rule classes - */ - protected $rules; - - /** - * @param CatalogRule $catalogRule - */ - public function __construct( - CatalogRule $catalogRule, - ConvertX $convertX, - CatalogRuleProducts $catalogRuleProduct, - CatalogRuleProductsPrice $catalogRuleProductPrice, - Product $product - ) { - $this->catalogRule = $catalogRule; - - $this->convertX = $convertX; - - $this->catalogRuleProduct = $catalogRuleProduct; - - $this->catalogRuleProductPrice = $catalogRuleProductPrice; - - $this->product = $product; - - $this->active = collect(); - - $this->activeRules = collect(); - - $this->deceased = collect(); - - $this->rules = config('discount-rules.catalog'); - } - - /** - * To apply the new catalog rules and sync previous rules changes, - */ - public function apply() - { - $rules = $this->catalogRule->all(); - - foreach ($rules as $rule) { - $validated = $this->checkApplicability($rule); - - if ($validated) { - $this->active->push($rule->id); - - $this->activeRules->push($rule); - } else { - $this->deceased->push($rule->id); - } - } - - if ($this->active->count()) { - $productIDs = array(); - - foreach ($this->activeRules as $rule) { - $productIDs = $this->getProductIds($rule); - - if ($productIDs) { - $productIDs = $this->expandProducts($productIDs); - - $this->setSale($rule, $productIDs); - } - } - } else { - // handle the deceased rules here or call the declutter handler over here - // dd($this->deceased); - } - } - - /** - * To set the sale price for products falling catalog rule criteria - * - * @param CatalogRule $catalogRule - * - * @return Void - */ - public function setSale($rule, $productIDs) - { - if (is_array($productIDs)) { - // apply on selected products - foreach ($productIDs as $productID) { - // catalog rule product resource is updated here - $this->createOrUpdateCatalogRuleProduct($rule, $productID); - - // catalog rule product price resource is updated here - $this->createOrUpdateCatalogRuleProductPrice($rule, $productID); - } - } else if ($productIDs == '*') { - $this->catalogRuleProduct->createOrUpdateCatalogRuleProduct($rule, $productIDs); - - $this->catalogRuleProductPrice->createOrUpdateCatalogRuleProductPrice($rule, $productIDs); - } - } - - /** - * Create or update catalog rule product resource - * - * @param CatalogRule $rule - * @param Integer $productID - * - * @return Void - */ - public function createOrUpdateCatalogRuleProduct($rule, $productID) - { - $channels = $rule->channels; - $customerGroups = $rule->customer_groups; - - $channelsGroupsCross = $channels->crossJoin($customerGroups); - - if ($productID == '*') { - $products = $this->product->all('id'); - - foreach ($channelsGroupsCross as $channelGroup) { - $channelId = $channelGroup[0]->channel_id; - $groupId = $channelGroup[1]->customer_group_id; - - foreach ($products as $product) { - $productID = $product->id; - - $catalogRuleProduct = $this->catalogRuleProduct->findWhere([ - 'channel_id' => $channelId, - 'customer_group_id' => $groupId, - 'product_id' => $productID - ]); - - if ($catalogRuleProduct->count()) { - // check for tie breaker rules and then update - $product = $this->product->find($productID); - - $productPrice = $product->price; - - // check for tie breaker rules and then update - $previousRuleID = $catalogRuleProduct->first()->catalog_rule_id; - - $newRuleID = $rule->id; - - $winnerRuleId = $this->breakTie($previousRuleID, $newRuleID, $product); - - $discountAmount = $this->getDiscountAmount($product, $rule); - - $data = [ - 'catalog_rule_id' => $rule->id, - 'starts_from' => $rule->starts_from, - 'ends_till' => $rule->ends_till, - 'customer_group_id' => $groupId, - 'channel_id' => $channelId, - 'product_id' => $productID, - 'action_code' => $rule->action_code, - 'action_amount' => $discountAmount - ]; - - if ($rule->id == $winnerRuleId) { - $this->catalogRuleProduct->create($data); - } else { - $this->catalogRuleProduct->update($data, $catalogRuleProduct->first()->id); - } - } else { - $data = [ - 'catalog_rule_id' => $rule->id, - 'starts_from' => $rule->starts_from, - 'ends_till' => $rule->ends_till, - 'customer_group_id' => $groupId, - 'channel_id' => $channelId, - 'product_id' => $productID, - 'action_code' => $rule->action_code, - 'action_amount' => $rule->discount_amount - ]; - - $this->catalogRuleProduct->create($data); - } - } - } - } else { - foreach ($channelsGroupsCross as $channelGroup) { - $channelId = $channelGroup[0]->channel_id; - $groupId = $channelGroup[1]->customer_group_id; - - $catalogRuleProduct = $this->catalogRuleProduct->findWhere([ - 'channel_id' => $channelId, - 'customer_group_id' => $groupId, - 'product_id' => $productID - ]); - - if ($catalogRuleProduct->count()) { - $product = $this->product->find($productID); - $productPrice = $product->price; - - // check for tie breaker rules and then update - $previousRuleID = $catalogRuleProduct->first()->catalog_rule_id; - - $newRuleID = $rule->id; - - $winnerRuleId = $this->breakTie($previousRuleID, $newRuleID, $product); - - // update - if ($winnerRuleId != $rule->id) { - $discountAmount = $this->getDiscountAmount($product, $rule); - - $catalogRuleProduct->first()->update([ - 'catalog_rule_id' => $rule->id, - 'starts_from' => $rule->starts_from, - 'ends_till' => $rule->ends_till, - 'customer_group_id' => $groupId, - 'channel_id' => $channelId, - 'product_id' => $productID, - 'action_code' => $rule->action_code, - 'action_amount' => $discountAmount - ]); - } else { - //do reassessment - } - } else if ($catalogRuleProduct->count() == 0) { - $product = $this->product->find($productID); - - $discountAmount = $this->getDiscountAmount($product, $rule); - - $data = [ - 'catalog_rule_id' => $rule->id, - 'starts_from' => $rule->starts_from, - 'ends_till' => $rule->ends_till, - 'customer_group_id' => $groupId, - 'channel_id' => $channelId, - 'product_id' => $productID, - 'action_code' => $rule->action_code, - 'action_amount' => $discountAmount - ]; - - $this->catalogRuleProduct->create($data); - } else { - // do the reassessment updation if the cart rule action changes the new action and its amount needs to be updated - } - } - } - } - - /** - * Create or update catalog rule product resource - * - * @param CatalogRule $rule - * @param Integer $productID - * - * @return Void - */ - public function createOrUpdateCatalogRuleProductPrice($rule, $productID) - { - $channels = $rule->channels; - $customerGroups = $rule->customer_groups; - - $channelsGroupsCross = $channels->crossJoin($customerGroups); - - if ($productID == '*') { - $products = $this->product->all('id'); - - foreach ($channelsGroupsCross as $channelGroup) { - $channelId = $channelGroup[0]->channel_id; - $groupId = $channelGroup[1]->customer_group_id; - - foreach ($products as $product) { - $productID = $product->id; - - $catalogRuleProductPrice = $this->catalogRuleProductPrice->findWhere([ - 'channel_id' => $channelId, - 'customer_group_id' => $groupId, - 'product_id' => $productID - ]); - - if ($catalogRuleProductPrice->count()) { - // check for tie breaker rules and then update - $data = [ - 'catalog_rule_id' => $rule->id, - 'starts_from' => $rule->starts_from, - 'ends_till' => $rule->ends_till, - 'customer_group_id' => $groupId, - 'channel_id' => $channelId, - 'product_id' => $productID, - 'action_code' => $rule->action_code, - 'action_amount' => $rule->discount_amount - ]; - - $this->catalogRuleProductPrice->update($data, $catalogRuleProductPrice->first()->id); - } else { - $data = [ - 'catalog_rule_id' => $rule->id, - 'starts_from' => $rule->starts_from, - 'ends_till' => $rule->ends_till, - 'customer_group_id' => $groupId, - 'channel_id' => $channelId, - 'product_id' => $productID, - 'action_code' => $rule->action_code, - 'action_amount' => $rule->discount_amount - ]; - - $this->catalogRuleProductPrice->create($data); - } - } - } - } else { - foreach ($channelsGroupsCross as $channelGroup) { - $channelId = $channelGroup[0]->channel_id; - $groupId = $channelGroup[1]->customer_group_id; - - $catalogRuleProduct = $this->catalogRuleProduct->findWhere([ - 'channel_id' => $channelId, - 'customer_group_id' => $groupId, - 'product_id' => $productID - ]); - - $catalogRuleProductPrice = $this->catalogRuleProductPrice->findWhere([ - 'channel_id' => $channelId, - 'customer_group_id' => $groupId, - 'product_id' => $productID - ]); - - if ($catalogRuleProductPrice->count()) { - $catalogRuleProduct = $catalogRuleProduct->first(); - - $product = $this->product->find($productID); - - $productPrice = $product->price - $catalogRuleProduct->action_amount; - - $winnerRuleId = $this->breakTie($catalogRuleProduct->catalog_rule_id, $rule->id, $product); - - if ($winnerRuleId != $rule->id) { - $data = [ - 'catalog_rule_id' => $rule->id, - 'starts_from' => $rule->starts_from, - 'ends_till' => $rule->ends_till, - 'customer_group_id' => $groupId, - 'channel_id' => $channelId, - 'product_id' => $productID, - 'rule_price' => $productPrice - ]; - - $catalogRuleProductPrice->first()->update($data); - } else { - // do reassement - } - } else if ($catalogRuleProductPrice->count() == 0) { - $catalogRuleProduct = $catalogRuleProduct->first(); - - $discountAmount = $catalogRuleProduct->action_amount; - - $product = $this->product->find($productID); - - $productPrice = $product->price - $discountAmount; - - $data = [ - 'catalog_rule_id' => $rule->id, - 'starts_from' => $rule->starts_from, - 'ends_till' => $rule->ends_till, - 'customer_group_id' => $groupId, - 'channel_id' => $channelId, - 'product_id' => $productID, - 'rule_price' => $productPrice - ]; - - $this->catalogRuleProductPrice->create($data); - } else { - // do the reassessment updation if the cart rule action changes the new action and its amount needs to be updated - } - } - } - } - - /** - * Get discount amount for the rule and product - * - * @return Decimal $discountAmount - */ - public function getDiscountAmount($product, $rule) - { - - $actionClass = config('discount-rules.catalog')[$rule->action_code]; - - $actionInstance = new $actionClass(); - - $discountAmount = $actionInstance->calculate($rule, $product); - - return $discountAmount; - } - - /** - * To expand the productIDs of configurable products - * - * @param Array $productIDs - * - * @return Array - */ - protected function expandProducts($productIDs) - { - $products = app('Webkul\Product\Repositories\ProductRepository'); - - $newProductIDs = collect(); - - foreach ($productIDs as $productID) { - $product = $products->find($productID); - - if (ProductType::hasVariants($product->type)) { - $variants = $product->variants; - - foreach($variants as $variant) { - $newProductIDs->push($variant->id); - } - } else { - $newProductIDs->push($productID); - } - } - - if ($newProductIDs->count()) { - return $newProductIDs->toArray(); - } else { - return []; - } - } - - /** - * To break tie between two rules - * - * @param Integer $previousRuleID - * @param Integer $newRuleID - * - * @return String $id - */ - public function breakTie($previousRuleID, $newRuleID, $product) - { - $oldRule = $this->catalogRule->find($previousRuleID); - - $newRule = $this->catalogRule->find($newRuleID); - - if ($oldRule->ends_other_rules) { - return $oldRule->id; - } else { - $oldRuleDiscount = $this->getDiscountAmount($product, $oldRule); - - $newRuleDiscount = $this->getDiscountAmount($product, $newRule); - - if ($newRuleDiscount > $oldRuleDiscount) { - return $newRule->id; - } else { - return $oldRule->id; - } - } - } - - /** - * To declutter the catalog rules that are either inactive or deleted - * - * @return Boolean - */ - public function deClutter() - { - $rules = $this->catalogRule->all(); - - foreach ($rules as $rule) { - $validated = $this->checkApplicability($rule); - - if (! $validated) { - $this->deceased->push($rule->id); - } - } - - if (count($this->deceased)) { - $count = 0; - - foreach ($this->deceased as $deceased) { - $cartRuleProducts = $this->catalogRuleProduct->findWhere(['catalog_rule_id' => $deceased]); - - $cartRuleProductsPrice = $this->catalogRuleProductPrice->findWhere(['catalog_rule_id' => $deceased]); - - // obvious logic for removing entries as entries in both storage needs to be exactly equal for a product - foreach ($cartRuleProducts as $cartRuleProduct) { - // deletes cartRuleProducts resource - $cartRuleProduct->delete(); - - // deletes cartRuleProductsPrice resource - $cartRuleProductsPrice->delete(); - } - } - - return true; - } else { - return false; - } - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Helpers/Catalog/ConvertXToProductId.php b/packages/Webkul/Discount/src/Helpers/Catalog/ConvertXToProductId.php deleted file mode 100644 index b44eaea8b..000000000 --- a/packages/Webkul/Discount/src/Helpers/Catalog/ConvertXToProductId.php +++ /dev/null @@ -1,272 +0,0 @@ - @prashant-webkul - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class ConvertXToProductId -{ - /** - * CategoryRepository instance - */ - protected $category; - - /** - * AttributeRepository instance - */ - protected $attribute; - - /** - * ProductRepository instance - */ - protected $product; - - /** - * AttributeOptionRepository instance - */ - protected $attributeOption; - - /** - * CatalogRuleRepository instance - */ - protected $catalogRule; - - /** - * ProductAttributeValueRepository instance - */ - protected $pav; - - /** - * Condition symbols for matching the criteria with attributes selected - */ - protected $symbols; - - public function __construct( - Category $category, - Attribute $attribute, - Product $product, - AttributeOption $attributeOption, - CatalogRule $catalogRule, - ProductAttributeValue $pav - ) { - $this->category = $category; - - $this->attribute = $attribute; - - $this->product = $product; - - $this->attributeOption = $attributeOption; - - $this->catalogRule = $catalogRule; - - $this->pav = $pav; - - $this->conditionSymbols = config('pricerules.cart.conditions.symbols'); - } - - public function convertX($attributeConditions) - { - $categoryValues = $attributeConditions->categories; - - $attributeValues = $attributeConditions->attributes; - - if (! isset($categoryValues) && ! isset($attributeValues)) - return false; - - $categoryResult = collect(); - - if (isset($categoryValues) && count($categoryValues)) - $categoryResult = $this->convertFromCategories($categoryValues); - - $attributeResult = collect(); - - if (isset($attributeValues) && count($attributeValues)) - $attributeResult = $this->convertFromAttributes($attributeValues); - - // now call the function that will find all the unique product ids - $productIDs = $this->findAllUniqueIds($attributeResult, $categoryResult); - - return $productIDs; - } - - /** - * This method will return product id from the attribute and attribute option params - * - * @return array - */ - public function convertFromAttributes($attributeOptions) - { - $products = collect(); - - foreach ($attributeOptions as $attributeOption) { - if (isset($attributeOption->type) && $attributeOption->attribute != null && $attributeOption->condition != null && $attributeOption->value != [] && $attributeOption->type != null) { - $selectedOptions = $attributeOption->value; - - if ($attributeOption->type == 'select' || $attributeOption->type == 'multiselect') { - $attribute = $this->attribute->findWhere(['code' => $attributeOption->attribute]); - - $attributeOptions = $attribute->first()->options; - - $selectedAttributeOptions = collect(); - - foreach ($attributeOptions as $attributeOption) { - foreach ($selectedOptions as $key => $value) { - if ($attributeOption->id == $value) - $selectedAttributeOptions->push($attributeOption); - } - } - - foreach ($selectedAttributeOptions as $selectedAttributeOption) { - $typeColumn = $this->pav::$attributeTypeFields[$attribute->first()->type]; - - $pavResults = $this->pav->where( - "{$typeColumn}", - $selectedAttributeOption->id - )->get(); - - foreach ($pavResults as $pavResult) { - if ($pavResult->product->type == 'simple') - $products->push($pavResult->product); - } - } - } else { - $attribute = $this->attribute->findWhere(['code' => $attributeOption->attribute]); - - $pavValues = $attribute->first(); - - $selectedAttributeValues = collect(); - - if ($attributeOption->attribute == 'sku') { - $testValue = $attributeOption->value; - $testCondition = $attributeOption->condition; - - if ($testCondition == '{}') { - $foundProducts = $this->product->findWhere([ - ['sku', 'like', '%' . $testValue . '%'], - ['type', 'NOT IN', ProductType::getAllTypesHavingVariants()] - ])->flatten()->all(); - } else if ($testCondition == '!{}') { - $foundProducts = $this->product->findWhere([ - ['sku', 'not like', '%' . $testValue . '%'], - ['type', 'NOT IN', ProductType::getAllTypesHavingVariants()] - ])->flatten()->all(); - } else if ($testCondition == '=') { - $foundProducts = $this->product->findWhere([ - ['sku', '=', $testValue], - ['type', 'NOT IN', ProductType::getAllTypesHavingVariants()] - ])->flatten()->all(); - } - } - - foreach ($foundProducts as $foundProduct) { - $products->push($foundProduct); - } - } - } - } - - return $products; - } - - /** - * This method will return product id from the attribute and attribute option params - * - * @param Collection $categories - * - * @return array - */ - public function convertFromCategories($categories) - { - $products = collect(); - - foreach ($categories as $category) { - $data = $this->getAll($category->id); - - if ($data->count()) { - $products->push($data); - - unset($data); - } - } - - return $products->flatten()->all(); - } - - /** - * This method will remove the duplicates from the array and merge all the items into single array - * - * @param array - * - * @return array - */ - public function findAllUniqueIds(...$data) - { - $attributeResult = $data[0] ?? collect(); - $categoryResult = $data[1] ?? collect(); - - // find matched attribute options product ids - $mergedCollection = $attributeResult->merge($categoryResult); - - $productIDs = collect(); - - foreach ($mergedCollection as $merged) { - $productIDs->push($merged->id); - } - - // find all the unique product ids - $productIDs = $productIDs->unique(); - - return $productIDs->flatten()->all(); - } - - /** - * To get all product ids lying in the criteria - * - * @param integer $categoryId - * - * @return Collection - */ - public function getAll($categoryId = null) - { - $results = app('Webkul\Product\Repositories\ProductFlatRepository')->scopeQuery(function ($query) use ($categoryId) { - - $channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode()); - - $locale = request()->get('locale') ?: app()->getLocale(); - - $qb = $query->distinct() - ->select('products.id') - ->leftJoin('products', 'product_flat.product_id', '=', 'products.id') - ->leftJoin('product_categories', 'products.id', '=', 'product_categories.product_id') - ->whereNotNull('product_flat.url_key'); - - if ($categoryId) { - $qb->where('product_categories.category_id', $categoryId); - } - - $qb->where('product_flat.status', 1); - - $qb->where('product_flat.visible_individually', 1); - - $queryBuilder = $qb->leftJoin('product_flat as flat_variants', function ($qb) use ($channel, $locale) { - $qb->on('product_flat.id', '=', 'flat_variants.parent_id'); - }); - - return $qb->groupBy('product_flat.id'); - })->get(); - - return $results; - } -} diff --git a/packages/Webkul/Discount/src/Helpers/Catalog/Sale.php b/packages/Webkul/Discount/src/Helpers/Catalog/Sale.php deleted file mode 100644 index 294e61ef2..000000000 --- a/packages/Webkul/Discount/src/Helpers/Catalog/Sale.php +++ /dev/null @@ -1,85 +0,0 @@ - @prashant-webkul - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -abstract class Sale -{ - abstract function apply(); - - /** - * To validate rule - * - * @param CatalogRule $rule - * - * @return Boolean - */ - public function checkApplicability($rule) - { - $cart = \Cart::getCart(); - - $timeBased = false; - - $status = false; - - // time based constraints - if ($rule->starts_from != null && $rule->ends_till == null) { - if (Carbon::parse($rule->starts_from) < now()) - $timeBased = true; - } else if ($rule->starts_from == null && $rule->ends_till != null) { - if (Carbon::parse($rule->ends_till) > now()) - $timeBased = true; - } else if ($rule->starts_from != null && $rule->ends_till != null) { - if (Carbon::parse($rule->starts_from) < now() && now() < Carbon::parse($rule->ends_till)) - $timeBased = true; - } else { - $timeBased = true; - } - - if ($rule->status) - $status = true; - - if ($timeBased && $status) { - return true; - } else { - return false; - } - } - - /** - * Function to maintain products and catalog rule - * - * @param CatalogRule $rule - * - * @return String|NULL - */ - public function getProductIds($rule) - { - if ($rule->conditions) { - $conditions = $rule->conditions; - - while(gettype($conditions) == 'string') { - $conditions = json_decode($conditions); - } - - $productIDs = $this->convertX->convertX($conditions); - } else { - $productIDs = '*'; - } - - return $productIDs; - } - - /** - * Function to maintain products, catalog rule, price - */ - -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Http/Controllers/CartRuleController.php b/packages/Webkul/Discount/src/Http/Controllers/CartRuleController.php deleted file mode 100644 index cd85e7638..000000000 --- a/packages/Webkul/Discount/src/Http/Controllers/CartRuleController.php +++ /dev/null @@ -1,573 +0,0 @@ - @prashant-webkul - * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CartRuleController extends Controller -{ - /** - * Initialize _config, a default request parameter with route - */ - protected $_config; - - /** - * Property for Cart rule application - */ - protected $appliedConfig; - - /** - * To hold Cart repository instance - */ - protected $cartRule; - - /** - * To hold Rule Label repository instance - */ - protected $cartRuleLabel; - - /** - * To hold Coupons Repository instance - */ - protected $cartRuleCoupon; - - /** - * To hold category repository instance - */ - protected $category; - - /** - * To hold attribute repository instance - */ - protected $attribute; - - /** - * To hold the cart repository instance - */ - protected $cart; - - /** - * Convert X To Product ID. - * - */ - protected $convertX; - - public function __construct( - CartRule $cartRule, - CartRuleCoupons $cartRuleCoupon, - CartRuleLabels $cartRuleLabel, - Attribute $attribute, - Category $category, - ConvertX $convertX - ) - { - $this->_config = request('_config'); - - $this->cartRule = $cartRule; - - $this->cartRuleCoupon = $cartRuleCoupon; - - $this->cartRuleLabel = $cartRuleLabel; - - $this->attribute = $attribute; - - $this->category = $category; - - $this->convertX = $convertX; - - $this->appliedConfig = config('pricerules.cart'); - } - - /** - * @return \Illuminate\View\View - */ - public function index() - { - return view($this->_config['view']); - } - - /** - * @return \Illuminate\View\View - */ - public function create() - { - return view($this->_config['view'])->with('cart_rule', [$this->appliedConfig, $this->category->getPartial(), $this->getStatesAndCountries(), $this->attribute->getPartial()]); - } - - /** - * Stores the response from cart rule store page to datastore - * - * @return redirect - */ - public function store() - { - $this->validate(request(), [ - 'name' => 'required|string|unique:cart_rules,name', - 'description' => 'string', - 'starts_from' => 'nullable|date', - 'ends_till' => 'nullable|date|after_or_equal:starts_from', - 'customer_groups' => 'required|array', - 'channels' => 'required|array', - 'status' => 'required|boolean', - 'use_coupon' => 'boolean|required', - // 'usage_limit' => 'numeric|min:0', - // 'per_customer' => 'numeric|min:0', - 'action_type' => 'required|string', - 'disc_amount' => 'required|numeric', - 'disc_quantity' => 'numeric', - // 'disc_threshold' => 'numeric', - 'free_shipping' => 'required|boolean', - 'apply_to_shipping' => 'required|boolean', - 'code' => 'string|required_if:auto_generation,0', - 'all_conditions' => 'sometimes|nullable', - 'label' => 'array|nullable' - ]); - - $data = request()->all(); - - $attribute_conditions = $data['all_attributes']; - unset($data['all_attributes']); - - // unset token - unset($data['_token']); - - // check if starts_from is null - if ($data['starts_from'] == "") { - $data['starts_from'] = null; - } - - // check if end_till is null - if ($data['ends_till'] == "") { - $data['ends_till'] = null; - } - - // customer groups - $customer_groups = $data['customer_groups']; - - // unset customer groups - unset($data['customer_groups']); - - // unset criteria - unset($data['criteria']); - - // channels - $channels = $data['channels']; - - // unset channels - unset($data['channels']); - - // make labels - $labels = $data['label']; - - // unset labels - unset($data['label']); - - while (gettype($attribute_conditions) == 'string') { - $attribute_conditions = json_decode($attribute_conditions); - } - - if (! isset($attribute_conditions) || ! (count($attribute_conditions->categories) || count($attribute_conditions->attributes))) { - $data['uses_attribute_conditions'] = 0; - - $data['actions'] = [ - 'action_type' => $data['action_type'], - 'disc_amount' => $data['disc_amount'], - 'disc_quantity' => $data['disc_quantity'] - ]; - } else { - $data['uses_attribute_conditions'] = 1; - - $data['actions'] = [ - 'action_type' => $data['action_type'], - 'disc_amount' => $data['disc_amount'], - 'disc_quantity' => $data['disc_quantity'], - 'attribute_conditions' => $attribute_conditions - ]; - } - - // prepare json object from conditions - $data['actions'] = json_encode($data['actions']); - - // check if all - if (! isset($data['all_conditions']) || $data['all_conditions'] == "[]" || $data['all_conditions'] == "") { - $data['conditions'] = null; - } else { - $data['conditions'] = json_encode($data['all_conditions']); - } - - // unset cart_attributes from conditions - unset($data['cart_attributes']); - - // unset attributes from conditions - unset($data['attributes']); - - // unset all_conditions from conditions - unset($data['all_conditions']); - - // prepare coupons if coupons are used - if ($data['use_coupon']) { - // if (isset($data['auto_generation']) && $data['auto_generation']) { - // auto generation is off for now - $data['auto_generation'] = 0; - - // save the coupon used in coupon section - $coupons['code'] = $data['code']; - - $couponExists = $this->cartRuleCoupon->findWhere([ - 'code' => $coupons['code'] - ]); - - if ($couponExists->count()) { - session()->flash('warning', trans('admin::app.promotion.status.duplicate-coupon')); - - return redirect()->back(); - } - - // set coupon usage per customer same as per_customer limit which is disabled for now - // $coupons['usage_per_customer'] = $data['per_customer']; //0 is for unlimited usage - // unset coupon code from coupon section - unset($data['code']); - // } else { - // $data['auto_generation'] = 1; - // } - - // if (isset($data['prefix'])) { - // $coupons['prefix'] = $data['prefix']; - // unset($data['prefix']); - // } - - // if (isset($data['suffix'])) { - // $coupons['suffix'] = $data['suffix']; - // unset($data['suffix']); - // } - - // $coupons['limit'] = 0; - } - - // per coupon usage limit - // if(isset($data['usage_limit'])) { - // $coupons['limit'] = $data['usage_limit']; - // } - - // create a cart rule - $ruleCreated = $this->cartRule->create($data); - - // can execute convertX here after when the rule is updated - if (isset($attribute_conditions) && $data['uses_attribute_conditions']) { - $this->convertX->convertX($ruleCreated->id, $attribute_conditions); - } - - // create customer groups for cart rule - $ruleGroupCreated = $this->cartRule->CustomerGroupSync($customer_groups, $ruleCreated); - - // create customer groups for channels - $ruleChannelCreated = $this->cartRule->ChannelSync($channels, $ruleCreated); - - // prepare labels - if (isset($labels['global'])) { - foreach (core()->getAllChannels() as $channel) { - $label1['channel_id'] = $channel->id; - - foreach($channel->locales as $locale) { - $label1['locale_id'] = $locale->id; - $label1['label'] = $labels['global']; - $label1['cart_rule_id'] = $ruleCreated->id; - - $ruleLabelCreated = $this->cartRuleLabel->create($label1); - } - } - } else { - $label2['label'] = $labels['global']; - $label2['cart_rule_id'] = $ruleCreated->id; - - $ruleLabelCreated = $this->cartRuleLabel->create($label2); - } - - // create coupon if present - if (isset($coupons)) { - $coupons['cart_rule_id'] = $ruleCreated->id; - $couponCreated = $this->cartRuleCoupon->create($coupons); - } - - if ($ruleCreated && $ruleChannelCreated && $ruleGroupCreated) { - if (isset($couponCreated) && $couponCreated) { - session()->flash('success', trans('admin::app.promotion.status.success-coupon')); - } - - session()->flash('success', trans('admin::app.promotion.status.success')); - } else { - session()->flash('success', trans('admin::app.promotion.status.success')); - - return redirect()->back(); - } - - return redirect()->route($this->_config['redirect']); - } - - /** - * @return \Illuminate\View\View - */ - public function edit($id) - { - $cart_rule = $this->cartRule->find($id); - - return view($this->_config['view'])->with('cart_rule', [ - $this->appliedConfig, - $this->category->getPartial(), - $this->getStatesAndCountries(), - $cart_rule, - $this->attribute->getPartial() - ]); - } - - /** - * Collects the response from cart rule update page and update datastore - * - * @return redirect - */ - public function update($id) - { - $this->validate(request(), [ - 'name' => 'required|string|unique:cart_rules,name,'.$id, - 'description' => 'string', - 'starts_from' => 'nullable|date', - 'ends_till' => 'nullable|date|after_or_equal:starts_from', - 'customer_groups' => 'required|array', - 'channels' => 'required|array', - 'status' => 'required|boolean', - 'use_coupon' => 'boolean|required', - // 'usage_limit' => 'numeric|min:0', - // 'per_customer' => 'numeric|min:0', - 'action_type' => 'required|string', - 'disc_amount' => 'required|numeric', - 'disc_quantity' => 'required|numeric', - // 'disc_threshold' => 'required|numeric', - 'free_shipping' => 'required|boolean', - 'apply_to_shipping' => 'required|boolean', - 'code' => 'string|required_if:user_coupon,1', - 'all_conditions' => 'present', - 'label' => 'array|nullable' - ]); - - // collecting request in $data - $data = request()->all(); - - $attribute_conditions = $data['all_attributes']; - unset($data['all_attributes']); - - // unset request token from $data - unset($data['_token']); - - // check if starts_from is null - if ($data['starts_from'] == "") { - $data['starts_from'] = null; - } - - // check if end_till is null - if ($data['ends_till'] == "") { - $data['ends_till'] = null; - } - - // set channels - $channels = $data['channels']; - - // unset the channels from $data - unset($data['channels']); - - // set customer_groups - $customer_groups = $data['customer_groups']; - - // unset customer groups - unset($data['customer_groups']); - - // set labels and unset them from $data - if (isset($data['label'])) { - $labels = $data['label']; - - unset($data['label']); - } - - // unset cart_attributes and attributes from $data - unset($data['cart_attributes']); - unset($data['attributes']); - - // prepare actions from data for json action - $attribute_conditions = json_decode($attribute_conditions); - - while (gettype($attribute_conditions) == 'string') { - $attribute_conditions = json_decode($attribute_conditions); - } - - if (! isset($attribute_conditions) || ! (count($attribute_conditions->categories) || count($attribute_conditions->attributes))) { - $data['uses_attribute_conditions'] = 0; - - $data['actions'] = [ - 'action_type' => $data['action_type'], - 'disc_amount' => $data['disc_amount'], - 'disc_quantity' => $data['disc_quantity'] - ]; - } else { - $data['uses_attribute_conditions'] = 1; - - $data['actions'] = [ - 'action_type' => $data['action_type'], - 'disc_amount' => $data['disc_amount'], - 'disc_quantity' => $data['disc_quantity'], - 'attribute_conditions' => $attribute_conditions - ]; - } - - // encode php array to json for actions - $data['actions'] = json_encode($data['actions']); - - // Prepares conditions from all conditions - if (! isset($data['all_conditions']) || $data['all_conditions'] == "[]" || $data['all_conditions'] == "") { - $data['conditions'] = null; - } else { - $data['conditions'] = json_encode($data['all_conditions']); - } - - unset($data['match_criteria']); - - // unset all_conditions from conditions - unset($data['all_conditions']); - - // set coupons from $data - if ($data['use_coupon']) { - // if (isset($data['auto_generation']) && $data['auto_generation']) { - $data['auto_generation'] = 0; - - $coupons['code'] = $data['code']; - - $couponExists = $this->cartRuleCoupon->findWhere([ - 'code' => $coupons['code'] - ]); - - if ($couponExists->count()) { - if ($couponExists->first()->cart_rule_id != $id) { - session()->flash('warning', trans('admin::app.promotion.status.duplicate-coupon')); - - return redirect()->back(); - } - } - - unset($data['code']); - // } else { - // $data['auto_generation'] = 1; - // } - - // if (isset($data['prefix'])) { - // $coupons['prefix'] = $data['prefix']; - // unset($data['prefix']); - // } - - // if (isset($data['suffix'])) { - // $coupons['suffix'] = $data['suffix']; - // unset($data['suffix']); - // } - // $coupons['limit'] = 0; - } - - // if (isset($data['usage_limit'])) { - // $coupons['limit'] = $data['usage_limit']; - // } - - // update cart rule - $ruleUpdated = $this->cartRule->update($data, $id); - - if (isset($attribute_conditions) && $data['uses_attribute_conditions']) { - // can execute convert X here after when the rule is updated - $this->convertX->convertX($ruleUpdated->id, $attribute_conditions); - } else { - $ruleUpdated->update([ - 'product_ids' => null - ]); - } - - // update customer groups for cart rule - $ruleGroupUpdated = $this->cartRule->CustomerGroupSync($customer_groups, $ruleUpdated); - - // update customer groups for cart rule - $ruleChannelUpdated = $this->cartRule->ChannelSync($channels, $ruleUpdated); - - // update labels - $labelsUpdated = $this->cartRule->LabelSync($labels, $ruleUpdated); - - // check coupons set conditions - if (isset($coupons)) { - // $coupons['usage_per_customer'] = $data['per_customer']; //0 is for unlimited usage - $coupons['cart_rule_id'] = $ruleUpdated->id; - - if ($ruleUpdated->coupons == null) { - $couponCreatedOrUpdated = $this->cartRuleCoupon->create($coupons); - } else { - $couponCreatedOrUpdated = $ruleUpdated->coupons->update($coupons); - } - } else { - if ($ruleUpdated->coupons != null) { - $ruleUpdated->coupons->delete(); - } - } - - if ($ruleUpdated && $ruleGroupUpdated && $ruleChannelUpdated) { - if (isset($couponCreatedOrUpdated) && $couponCreatedOrUpdated) { - session()->flash('success', trans('admin::app.promotion.status.success-coupon')); - } - - session()->flash('success', trans('admin::app.promotion.status.update-success')); - } else { - session()->flash('success', trans('admin::app.promotion.status.update-success')); - - return redirect()->back(); - } - - return redirect()->route($this->_config['redirect']); - } - - /** - * Deletes the cart rule - * - * @return JSON - */ - public function destroy($id) - { - $cartRule = $this->cartRule->findOrFail($id); - - if ($cartRule->delete()) { - session()->flash('success', trans('admin::app.promotion.status.delete-success')); - - return response()->json(['message' => true], 200); - } else { - session()->flash('error', trans('admin::app.promotion.status.delete-failed')); - - return response()->json(['message' => false], 400); - } - } - - /** - * Get Countries and states list from core helpers - * - * @return Array - */ - public function getStatesAndCountries() - { - $countries = core()->countries()->toArray(); - $states = core()->groupedStatesByCountries(); - - return [ - 'countries' => $countries, - 'states' => $states - ]; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Http/Controllers/CatalogRuleController.php b/packages/Webkul/Discount/src/Http/Controllers/CatalogRuleController.php deleted file mode 100644 index 9bb650a8f..000000000 --- a/packages/Webkul/Discount/src/Http/Controllers/CatalogRuleController.php +++ /dev/null @@ -1,437 +0,0 @@ - @prashant-webkul - * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CatalogRuleController extends Controller -{ - /** - * Initialize _config, a default request parameter with route - */ - protected $_config; - - /** - * Attribute $attribute - */ - protected $attribute; - - /** - * AttributeFamily $attributeFamily - */ - protected $attributeFamily; - - /** - * Category $category - */ - protected $category; - - /** - * Product $product - */ - protected $product; - - /** - * Property for catalog rule application - */ - protected $appliedConfig; - - /** - * Property for catalog rule application - */ - protected $appliedConditions; - - /** - * Property to hold Catalog Rule Channels Repository - */ - protected $catalogRuleChannels; - - /** - * Property to hold Catalog Rule Customer Groups Repository - */ - protected $catalogRuleCustomerGroups; - - /** - * To hold catalog repository instance - */ - protected $catalogRule; - - /** - * To hold Sale instance - */ - protected $apply; - - public function __construct( - Attribute $attribute, - AttributeFamily $attributeFamily, - Category $category, Product $product, - CatalogRule $catalogRule, - CatalogRuleChannels $catalogRuleChannels, - CatalogRuleCustomerGroups $catalogRuleCustomerGroups, - Apply $sale - ) { - $this->_config = request('_config'); - $this->attribute = $attribute; - $this->attributeFamily = $attributeFamily; - $this->category = $category; - $this->product = $product; - $this->sale = $sale; - $this->catalogRule = $catalogRule; - $this->catalogRuleChannels = $catalogRuleChannels; - $this->catalogRuleCustomerGroups = $catalogRuleCustomerGroups; - $this->appliedConfig = config('pricerules.catalog'); - $this->appliedConditions = config('pricerules.conditions'); - } - - public function index() - { - return view($this->_config['view']); - } - - /** - * To load create form for catalog rule - * - * @return View - */ - public function create() - { - return view($this->_config['view'])->with('catalog_rule', [$this->appliedConfig, $this->category->getPartial(), $this->getStatesAndCountries(), $this->attribute->getPartial()]); - } - - /** - * To store newly created catalog rule and store it - * - * @return Redirect - */ - public function store() - { - $this->validate(request(), [ - 'name' => 'required|string|unique:catalog_rules,name', - 'description' => 'string', - 'starts_from' => 'nullable|date', - 'ends_till' => 'nullable|date|after_or_equal:starts_from', - 'starts_from' => 'present|nullable|date', - 'ends_till' => 'present|nullable|date', - 'customer_groups' => 'required', - 'channels' => 'required', - 'status' => 'required|boolean', - 'end_other_rules' => 'required|boolean', - 'all_conditions' => 'present', - 'disc_amount' => 'sometimes', - 'disc_percent' => 'sometimes', - ]); - - $catalog_rule = request()->all(); - - $catalog_rule_channels = array(); - $catalog_rule_customer_groups = array(); - - // check if starts_from is null - if ($catalog_rule['starts_from'] == "") { - $catalog_rule['starts_from'] = null; - } - - // check if end_till is null - if ($catalog_rule['ends_till'] == "") { - $catalog_rule['ends_till'] = null; - } - - $catalog_rule_channels = $catalog_rule['channels']; - $catalog_rule_customer_groups = $catalog_rule['customer_groups']; - unset($catalog_rule['channels']); unset($catalog_rule['customer_groups']); - - unset($catalog_rule['criteria']); - - $catalog_rule['conditions'] = $catalog_rule['all_conditions']; - - unset($catalog_rule['all_conditions']); - - $catalog_rule['conditions'] = json_encode($catalog_rule['conditions']); - - if (isset($catalog_rule['disc_amount'])) { - $catalog_rule['actions'] = [ - 'action_code' => $catalog_rule['action_type'], - 'disc_amount' => $catalog_rule['disc_amount'] - ]; - } else if (isset($catalog_rule['disc_percent'])) { - $catalog_rule['actions'] = [ - 'action_code' => $catalog_rule['action_type'], - 'disc_percent' => $catalog_rule['disc_percent'], - ]; - } - - $catalog_rule['discount_amount'] = $catalog_rule['disc_amount']; - - $catalog_rule['action_code'] = $catalog_rule['action_type']; - - unset($catalog_rule['disc_amount']); - unset($catalog_rule['apply']); - unset($catalog_rule['attributes']); - unset($catalog_rule['_token']); - unset($catalog_rule['all_actions']); - - $catalog_rule['actions'] = json_encode($catalog_rule['actions']); - - $catalogRule = $this->catalogRule->create($catalog_rule); - - foreach($catalog_rule_channels as $catalog_rule_channel) { - $data['catalog_rule_id'] = $catalogRule->id; - $data['channel_id'] = $catalog_rule_channel; - - $catalogRuleChannels = $this->catalogRuleChannels->create($data); - } - - unset($data); - foreach ($catalog_rule_customer_groups as $catalog_rule_customer_group) { - $data['catalog_rule_id'] = $catalogRule->id; - $data['customer_group_id'] = $catalog_rule_customer_group; - - $catalogRuleCustomerGroups = $this->catalogRuleCustomerGroups->create($data); - } - - if($catalogRule && $catalogRuleChannels && $catalogRuleCustomerGroups) { - session()->flash('success', trans('admin::app.promotion.status.success')); - - return redirect()->route('admin.catalog-rule.index'); - } else { - session()->flash('error', trans('admin::app.promotion.status.failed')); - - return redirect()->back(); - } - } - - /** - * To load edit for previously created catalog rule - * - * @param $id - * - * @return View - */ - public function edit($id) - { - $catalog_rule = $this->catalogRule->find($id); - - $catalog_rule_channels = $this->catalogRuleChannels->findByField('catalog_rule_id', $id); - - $catalog_rule_customer_groups = $this->catalogRuleCustomerGroups->findByField('catalog_rule_id', $id); - - return view($this->_config['view'])->with('catalog_rule', [ - $this->attribute->getPartial(), - $this->category->getPartial(), - $this->fetchOptionableAttributes(), - $this->appliedConfig, - $this->appliedConditions, - $catalog_rule, - $catalog_rule_channels, - $catalog_rule_customer_groups, - $this->attributeFamily->getPartial() - ]); - } - - /** - * To update previously created catalog rule - * - * @param $id - * - * @return Redirect - */ - public function update($id) - { - $data = request()->input(); - - // $validated = \Validator::make($data, [ - // 'name' => 'required|string|unique:catalog_rules,name,' . $id, - // 'starts_from' => 'present|nullable|date', - // 'ends_till' => 'present|nullable|date', - // 'description' => 'string', - // 'customer_groups' => 'required', - // 'channels' => 'required', - // 'status' => 'required|boolean', - // 'end_other_rules' => 'required|boolean', - // 'all_conditions' => 'present', - // 'disc_amount' => 'sometimes', - // 'disc_percent' => 'sometimes' - // ]); - - // if ($validated->fails()) { - // dd($validated->errors()); - // } else { - // dd('passed'); - // } - - $this->validate(request(), [ - 'name' => 'required|string|unique:catalog_rules,name,'.$id, - // 'name' => 'required|string', - 'starts_from' => 'nullable|date', - 'ends_till' => 'nullable|date|after_or_equal:starts_from', - 'description' => 'string', - 'customer_groups' => 'required', - 'channels' => 'required', - 'status' => 'required|boolean', - 'end_other_rules' => 'required|boolean', - 'all_conditions' => 'present', - 'disc_amount' => 'sometimes', - 'disc_percent' => 'sometimes' - ]); - - $catalog_rule = request()->all(); - - $catalog_rule_channels = array(); - $catalog_rule_customer_groups = array(); - - // check if starts_from is null - if ($catalog_rule['starts_from'] == "") { - $catalog_rule['starts_from'] = null; - } - - // check if end_till is null - if ($catalog_rule['ends_till'] == "") { - $catalog_rule['ends_till'] = null; - } - - $catalog_rule_channels = $catalog_rule['channels']; - $catalog_rule_customer_groups = $catalog_rule['customer_groups']; - unset($catalog_rule['channels']); unset($catalog_rule['customer_groups']); - - unset($catalog_rule['criteria']); - - $catalog_rule['conditions'] = $catalog_rule['all_conditions']; - unset($catalog_rule['all_conditions']); - - if (isset($catalog_rule['disc_amount'])) { - $catalog_rule['action_code'] = $catalog_rule['action_type']; - $catalog_rule['actions'] = [ - 'action_code' => $catalog_rule['action_type'], - 'disc_amount' => $catalog_rule['disc_amount'] - ]; - } else if (isset($catalog_rule['disc_percent'])) { - $catalog_rule['action_code'] = $catalog_rule['action_type']; - $catalog_rule['actions'] = [ - 'action_code' => $catalog_rule['action'], - 'disc_percent' => $catalog_rule['disc_percent'], - ]; - } - - $catalog_rule['discount_amount'] = $catalog_rule['disc_amount']; - - unset($catalog_rule['disc_amount']); - unset($catalog_rule['apply']); - unset($catalog_rule['attributes']); - unset($catalog_rule['_token']); - unset($catalog_rule['all_actions']); - - $catalog_rule['actions'] = json_encode($catalog_rule['actions']); - $catalog_rule['conditions'] = json_encode($catalog_rule['conditions']); - - $catalogRule = $this->catalogRule->update($catalog_rule, $id); - - $catalogRuleChannels = $this->catalogRule->ChannelSync($catalog_rule_channels, $catalogRule); - $catalogRuleCustomerGroups = $this->catalogRule->CustomerGroupSync($catalog_rule_customer_groups, $catalogRule); - - if($catalogRule && $catalogRuleChannels && $catalogRuleCustomerGroups) { - session()->flash('success', trans('admin::app.promotion.status.update-success')); - - return redirect()->route($this->_config['redirect']); - } else { - session()->flash('error', trans('admin::app.promotion.status.update-failed')); - - return redirect()->back(); - } - } - - /** - * To apply the catalog rules - * - * @return Redirect - */ - public function applyRules() - { - $this->sale->apply(); - - session()->flash('success', trans('admin::app.promotion.processing-done')); - - return redirect()->route('admin.catalog-rule.index'); - } - - /** - * Initiates decluttering of rules and even reindexes the table if empty - * - * @return Response redirect - */ - public function deClutter() - { - $result = $this->sale->deClutter(); - - if ($result) { - session()->flash('success', trans('admin::app.promotion.declut-success')); - } else { - session()->flash('warning', trans('admin::app.promotion.declut-failure')); - } - - return redirect()->route($this->_config['redirect']); - } - - public function fetchOptionableAttributes() - { - $attributesWithOptions = array(); - - foreach($this->attribute->all() as $attribute) { - if (($attribute->type == 'select' || $attribute->type == 'multiselect') && $attribute->code != 'tax_category_id') { - $attributesWithOptions[$attribute->code] = $attribute->options->toArray(); - } - } - - return $attributesWithOptions; - } - - /** - * To delete existing catalog rule - * - * @param Integer $id - * - * @return Redirect - */ - public function destroy($id) - { - $catalogRule = $this->catalogRule->findOrFail($id); - - if ($catalogRule->delete()) { - session()->flash('success', trans('admin::app.promotion.status.delete-success')); - - return response()->json(['message' => true], 200); - } else { - session()->flash('error', trans('admin::app.promotion.status.delete-failed')); - - return response()->json(['message' => false], 400); - } - } - - /** - * Get Countries and states list from core helpers - * - * @return Array - */ - public function getStatesAndCountries() - { - $countries = core()->countries()->toArray(); - $states = core()->groupedStatesByCountries(); - - return [ - 'countries' => $countries, - 'states' => $states - ]; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Models/CartRule.php b/packages/Webkul/Discount/src/Models/CartRule.php deleted file mode 100644 index 6ea8b664d..000000000 --- a/packages/Webkul/Discount/src/Models/CartRule.php +++ /dev/null @@ -1,39 +0,0 @@ -hasMany(CartRuleChannels::modelClass()); - } - - public function customer_groups() - { - return $this->hasMany(CartRuleCustomerGroups::modelClass()); - } - - public function coupons() - { - return $this->hasOne(CartRuleCoupons::modelClass()); - } - - public function labels() - { - return $this->hasMany(CartRuleLabels::modelClass()); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Models/CartRuleCart.php b/packages/Webkul/Discount/src/Models/CartRuleCart.php deleted file mode 100644 index 66d2b503c..000000000 --- a/packages/Webkul/Discount/src/Models/CartRuleCart.php +++ /dev/null @@ -1,22 +0,0 @@ -hasOne(CartRule::modelClass(), 'id', 'cart_rule_id'); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Models/CartRuleCartProxy.php b/packages/Webkul/Discount/src/Models/CartRuleCartProxy.php deleted file mode 100644 index 98245e4d8..000000000 --- a/packages/Webkul/Discount/src/Models/CartRuleCartProxy.php +++ /dev/null @@ -1,10 +0,0 @@ -belongsTo(CartRule::modelClass(), 'cart_rule_id'); - } - - public function coupons_usage() - { - return $this->hasOne(CartRuleCouponsUsage::modelClass()); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Models/CartRuleCouponsProxy.php b/packages/Webkul/Discount/src/Models/CartRuleCouponsProxy.php deleted file mode 100644 index 8f2fb7f23..000000000 --- a/packages/Webkul/Discount/src/Models/CartRuleCouponsProxy.php +++ /dev/null @@ -1,10 +0,0 @@ -hasOne(CustomerGroupProxy::modelClass(), 'id', 'customer_group_id'); - } -} diff --git a/packages/Webkul/Discount/src/Models/CartRuleCustomerGroupsProxy.php b/packages/Webkul/Discount/src/Models/CartRuleCustomerGroupsProxy.php deleted file mode 100644 index e402be089..000000000 --- a/packages/Webkul/Discount/src/Models/CartRuleCustomerGroupsProxy.php +++ /dev/null @@ -1,10 +0,0 @@ -belongsTo(CartRule::modelClass(), 'cart_rule_id'); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Models/CartRuleCustomersProxy.php b/packages/Webkul/Discount/src/Models/CartRuleCustomersProxy.php deleted file mode 100644 index fed8df2c8..000000000 --- a/packages/Webkul/Discount/src/Models/CartRuleCustomersProxy.php +++ /dev/null @@ -1,10 +0,0 @@ -belongsTo(CartRule::modelClass(), 'cart_rule_id'); - } - - public function locale() - { - return $this->hasOne(Locale::modelClass(), 'id', 'locale_id'); - } - - public function channel() - { - return $this->hasOne(Channel::modelClass(), 'id', 'channel_id'); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Models/CatalogRule.php b/packages/Webkul/Discount/src/Models/CatalogRule.php deleted file mode 100644 index 1c29bc299..000000000 --- a/packages/Webkul/Discount/src/Models/CatalogRule.php +++ /dev/null @@ -1,25 +0,0 @@ -hasMany(CatalogRuleChannels::modelClass()); - } - - public function customer_groups() - { - return $this->hasMany(CatalogRuleCustomerGroups::modelClass()); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Models/CatalogRuleChannels.php b/packages/Webkul/Discount/src/Models/CatalogRuleChannels.php deleted file mode 100644 index d31ebf9de..000000000 --- a/packages/Webkul/Discount/src/Models/CatalogRuleChannels.php +++ /dev/null @@ -1,19 +0,0 @@ -belongsTo(CatalogRule::modelClass(), 'catalog_rule_id'); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Models/CatalogRuleChannelsProxy.php b/packages/Webkul/Discount/src/Models/CatalogRuleChannelsProxy.php deleted file mode 100644 index c723f5482..000000000 --- a/packages/Webkul/Discount/src/Models/CatalogRuleChannelsProxy.php +++ /dev/null @@ -1,10 +0,0 @@ -hasOne(CustomerGroupProxy::modelClass(), 'id', 'customer_group_id'); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Models/CatalogRuleCustomerGroupsProxy.php b/packages/Webkul/Discount/src/Models/CatalogRuleCustomerGroupsProxy.php deleted file mode 100644 index 12de4951a..000000000 --- a/packages/Webkul/Discount/src/Models/CatalogRuleCustomerGroupsProxy.php +++ /dev/null @@ -1,10 +0,0 @@ -loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); - } - - /** - * Register services. - * - * @return void - */ - public function register() - { - $this->registerConfig(); - } - - /** - * To merge the price rule configuration in price rule configuration - */ - protected function registerConfig() - { - $this->mergeConfigFrom( - dirname(__DIR__) . '/Config/rule-conditions.php', 'pricerules' - ); - - $this->mergeConfigFrom( - dirname(__DIR__) . '/Config/discount-rules.php', 'discount-rules' - ); - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Providers/ModuleServiceProvider.php b/packages/Webkul/Discount/src/Providers/ModuleServiceProvider.php deleted file mode 100644 index 4332e00dc..000000000 --- a/packages/Webkul/Discount/src/Providers/ModuleServiceProvider.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CartRuleCartRepository extends Repository -{ - /** - * Specify Model class name - * - * @return mixed - */ - function model() - { - return 'Webkul\Discount\Contracts\CartRuleCart'; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Repositories/CartRuleChannelsRepository.php b/packages/Webkul/Discount/src/Repositories/CartRuleChannelsRepository.php deleted file mode 100644 index 2d6209445..000000000 --- a/packages/Webkul/Discount/src/Repositories/CartRuleChannelsRepository.php +++ /dev/null @@ -1,24 +0,0 @@ - @prashant-webkul - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CartRuleChannelsRepository extends Repository -{ - /** - * Specify Model class name - * - * @return mixed - */ - function model() - { - return 'Webkul\Discount\Contracts\CartRuleChannels'; - } -} diff --git a/packages/Webkul/Discount/src/Repositories/CartRuleCouponsRepository.php b/packages/Webkul/Discount/src/Repositories/CartRuleCouponsRepository.php deleted file mode 100644 index 8b0e53f99..000000000 --- a/packages/Webkul/Discount/src/Repositories/CartRuleCouponsRepository.php +++ /dev/null @@ -1,24 +0,0 @@ - @prashant-webkul - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CartRuleCouponsRepository extends Repository -{ - /** - * Specify Model class name - * - * @return mixed - */ - function model() - { - return 'Webkul\Discount\Contracts\CartRuleCoupons'; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Repositories/CartRuleCustomerGroupsRepository.php b/packages/Webkul/Discount/src/Repositories/CartRuleCustomerGroupsRepository.php deleted file mode 100644 index cfd4dbe75..000000000 --- a/packages/Webkul/Discount/src/Repositories/CartRuleCustomerGroupsRepository.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CartRuleCustomerGroupsRepository extends Repository -{ - /** - * Specify Model class name - * - * @return mixed - */ - function model() - { - return 'Webkul\Discount\Contracts\CartRuleCustomerGroups'; - } -} diff --git a/packages/Webkul/Discount/src/Repositories/CartRuleLabelsRepository.php b/packages/Webkul/Discount/src/Repositories/CartRuleLabelsRepository.php deleted file mode 100644 index 2a4d03be7..000000000 --- a/packages/Webkul/Discount/src/Repositories/CartRuleLabelsRepository.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CartRuleLabelsRepository extends Repository -{ - /** - * Specify Model class name - * - * @return mixed - */ - function model() - { - return 'Webkul\Discount\Contracts\CartRuleLabels'; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Repositories/CartRuleRepository.php b/packages/Webkul/Discount/src/Repositories/CartRuleRepository.php deleted file mode 100644 index 6005f8d0f..000000000 --- a/packages/Webkul/Discount/src/Repositories/CartRuleRepository.php +++ /dev/null @@ -1,205 +0,0 @@ - - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CartRuleRepository extends Repository -{ - /** - * Will hold cartRuleChannelsRepository instance - */ - protected $cartRuleChannels; - - /** - * Will hold cartRuleCustomerGroupsRepository instance - */ - protected $cartRuleCustomerGroups; - - /** - * Will hold cartRuleCoupons instance - */ - protected $cartRuleCoupons; - - /** - * Will hold cartRuleCustomerGroupsRepository instance - */ - protected $cartRuleLabels; - - /** - * @param CartRuleChannels $cartRuleChannels - * @param CartRuleCustomerGroups $cartRuleCustomerGroups - * @param CartRuleCoupons $cartRuleCoupons - * @param - */ - public function __construct( - CartRuleChannels $cartRuleChannels, - CartRuleCustomerGroups $cartRuleCustomerGroups, - CartRuleCoupons $cartRuleCoupons, - CartRuleLabels $cartRuleLabels, - App $app - ) { - $this->cartRuleChannels = $cartRuleChannels; - $this->cartRuleCustomerGroups = $cartRuleCustomerGroups; - $this->cartRuleCoupons = $cartRuleCoupons; - $this->cartRuleLabel = $cartRuleLabels; - - parent::__construct($app); - } - - /** - * Specify Model class name - * - * @return mixed - */ - function model() - { - return 'Webkul\Discount\Contracts\CartRule'; - } - - /** - * To sync the customer groups related records - */ - public function CustomerGroupSync($newCustomerGroups, $cartRule) - { - $oldCustomerGroups = array(); - foreach ($cartRule->customer_groups as $oldCustomerGroup) { - array_push($oldCustomerGroups, ['id' => $oldCustomerGroup->id, 'customer_group_id' => $oldCustomerGroup->customer_group_id]); - } - - foreach ($oldCustomerGroups as $key => $oldCustomerGroup) { - $found = 0; - foreach ($newCustomerGroups as $newCustomerGroup) { - if ($oldCustomerGroup['customer_group_id'] == $newCustomerGroup) - $found = 1; - } - - if ($found == 0) { - $this->cartRuleCustomerGroups->find($oldCustomerGroup['id'])->delete(); - } else { - $found = 0; - } - } - - //unset the commons - if (count($newCustomerGroups) && count($oldCustomerGroups)) { - foreach ($oldCustomerGroups as $oldCustomerGroup) { - $found = 0; - foreach ($newCustomerGroups as $key => $newCustomerGroup) { - if ($oldCustomerGroup['customer_group_id'] == $newCustomerGroup) - unset($newCustomerGroups[$key]); - } - } - } - - //create the left ones - foreach ($newCustomerGroups as $newCustomerGroup) { - $data['customer_group_id'] = $newCustomerGroup; - $data['cart_rule_id'] = $cartRule->id; - - $this->cartRuleCustomerGroups->create($data); - } - - return true; - } - - /** - * To sync the channels related records - */ - public function ChannelSync($newChannels, $cartRule) - { - $oldChannels = array(); - - foreach ($cartRule->channels as $oldChannel) { - array_push($oldChannels, ['id' => $oldChannel->id, 'channel_id' => $oldChannel->channel_id]); - } - - foreach ($oldChannels as $key => $oldChannel) { - $found = 0; - foreach ($newChannels as $newChannel) { - if ($oldChannel['channel_id'] == $newChannel) - $found = 1; - } - - if ($found == 0) { - $this->cartRuleChannels->find($oldChannel['id'])->delete(); - } else { - $found = 0; - } - } - - //unset the commons - if (count($newChannels) && count($oldChannels)) { - foreach ($oldChannels as $oldChannel) { - $found = 0; - - foreach ($newChannels as $key => $newChannel) { - if ($oldChannel['channel_id'] == $newChannel) - unset($newChannels[$key]); - } - } - } - - //create the left ones - foreach ($newChannels as $newChannel) { - $data['channel_id'] = $newChannel; - $data['cart_rule_id'] = $cartRule->id; - - $this->cartRuleChannels->create($data); - } - - return true; - } - - /** - * To sync the labels associated with the cart rule - */ - public function LabelSync($labels, $cartRule) - { - foreach ($labels as $channelCode => $value) { - $localeCode = array_keys($value)[0]; - $localeValue = array_values($value)[0]; - - $updated = 0; - foreach ($cartRule->labels as $label) { - if ($label->channel->code == $channelCode && $label->locale->code == $localeCode) { - $label->update(['label' => $localeValue]); - - $updated = 1; - } - } - - if ($updated == 0) { - foreach (core()->getAllChannels() as $channel) { - if ($channel->code == $channelCode) - $newLabel['channel_id'] = $channel->id; - - foreach($channel->locales as $locale) { - if ($localeCode == $locale->code) { - $newLabel['locale_id'] = $locale->id; - $newLabel['label'] = $localeValue; - $newLabel['cart_rule_id'] = $cartRule->id; - - $ruleLabelCreated = $this->CartRuleLabels->create($newLabel); - } - } - } - } - - $updated = 0; - } - - return true; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Repositories/CatalogRuleChannelsRepository.php b/packages/Webkul/Discount/src/Repositories/CatalogRuleChannelsRepository.php deleted file mode 100644 index 50ade8dbc..000000000 --- a/packages/Webkul/Discount/src/Repositories/CatalogRuleChannelsRepository.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CatalogRuleChannelsRepository extends Repository -{ - /** - * Specify Model class name - * - * @return String - */ - function model() - { - return 'Webkul\Discount\Contracts\CatalogRuleChannels'; - } -} diff --git a/packages/Webkul/Discount/src/Repositories/CatalogRuleCustomerGroupsRepository.php b/packages/Webkul/Discount/src/Repositories/CatalogRuleCustomerGroupsRepository.php deleted file mode 100644 index 2d7184610..000000000 --- a/packages/Webkul/Discount/src/Repositories/CatalogRuleCustomerGroupsRepository.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CatalogRuleCustomerGroupsRepository extends Repository -{ - /** - * Specify Model class name - * - * @return String - */ - function model() - { - return 'Webkul\Discount\Contracts\CatalogRuleCustomerGroups'; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Repositories/CatalogRuleProductsPriceRepository.php b/packages/Webkul/Discount/src/Repositories/CatalogRuleProductsPriceRepository.php deleted file mode 100644 index 5becbb9eb..000000000 --- a/packages/Webkul/Discount/src/Repositories/CatalogRuleProductsPriceRepository.php +++ /dev/null @@ -1,51 +0,0 @@ - @prashant-webkul - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CatalogRuleProductsPriceRepository extends Repository -{ - /** - * To hold ProductRepository instance - */ - protected $product; - - /** - * To hold CatalogRuleProductRepository instance - * - */ - protected $catalogRuleProduct; - - /** - * @param Product $product - */ - public function __construct(Product $product, CatalogRuleProduct $catalogRuleProduct,App $app) - { - - $this->product = $product; - - $this->catalogRuleProduct = $catalogRuleProduct; - - parent::__construct($app); - } - - /** - * Specify Model class name - * - * @return String - */ - function model() - { - return 'Webkul\Discount\Contracts\CatalogRuleProductsPrice'; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/Repositories/CatalogRuleProductsRepository.php b/packages/Webkul/Discount/src/Repositories/CatalogRuleProductsRepository.php deleted file mode 100644 index aedf092fd..000000000 --- a/packages/Webkul/Discount/src/Repositories/CatalogRuleProductsRepository.php +++ /dev/null @@ -1,39 +0,0 @@ - @prashant-webkul - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CatalogRuleProductsRepository extends Repository -{ - /** - * CatalogRule Apply instance - */ - protected $apply; - - /** - * @param App $app - */ - public function __construct(App $app) - { - parent::__construct($app); - } - - /** - * Specify Model class name - * - * @return String - */ - function model() - { - return 'Webkul\Discount\Contracts\CatalogRuleProducts'; - } -} diff --git a/packages/Webkul/Discount/src/Repositories/CatalogRuleRepository.php b/packages/Webkul/Discount/src/Repositories/CatalogRuleRepository.php deleted file mode 100644 index da6b684ae..000000000 --- a/packages/Webkul/Discount/src/Repositories/CatalogRuleRepository.php +++ /dev/null @@ -1,155 +0,0 @@ - - * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CatalogRuleRepository extends Repository -{ - /** - * Will hold catalogRuleChannelsRepository instance - */ - protected $catalogRuleChannels; - - /** - * Will hold catalogRuleCustomerGroupsRepository instance - */ - protected $catalogRuleCustomerGroups; - - /** - * @param CatalogRuleChannels $catalogRuleChannels - * @param CatalogRuleCustomerGroups $catalogRuleCustomerGroups - * @param App $app - */ - public function __construct(CatalogRuleChannels $catalogRuleChannels, CatalogRuleCustomerGroups $catalogRuleCustomerGroups, App $app) - { - $this->catalogRuleChannels = $catalogRuleChannels; - - $this->catalogRuleCustomerGroups = $catalogRuleCustomerGroups; - - parent::__construct($app); - } - - /** - * Specify Model class name - * - * @return String - */ - function model() - { - return 'Webkul\Discount\Contracts\CatalogRule'; - } - - /** - * To sync the customer groups related records - * - * @param Array $newCustomerGroups - * @param CatalogRule $catalogRule - * - * @return Boolean - */ - public function CustomerGroupSync($newCustomerGroups, $catalogRule) - { - $oldCustomerGroups = array(); - foreach ($catalogRule->customer_groups as $oldCustomerGroup) { - array_push($oldCustomerGroups, ['id' => $oldCustomerGroup->id, 'customer_group_id' => $oldCustomerGroup->customer_group_id]); - } - - foreach ($oldCustomerGroups as $key => $oldCustomerGroup) { - $found = 0; - - foreach($newCustomerGroups as $newCustomerGroup) { - if ($oldCustomerGroup['customer_group_id'] == $newCustomerGroup) - $found = 1; - } - - if ($found == 0) { - $this->catalogRuleCustomerGroups->find($oldCustomerGroup['id'])->delete(); - } else { - $found = 0; - } - } - - //unset the commons - if (count($newCustomerGroups) && count($oldCustomerGroups)) { - foreach ($oldCustomerGroups as $oldCustomerGroup) { - $found = 0; - - foreach ($newCustomerGroups as $key => $newCustomerGroup) { - if ($oldCustomerGroup['customer_group_id'] == $newCustomerGroup) - unset($newCustomerGroups[$key]); - } - } - } - - //create the left ones - foreach ($newCustomerGroups as $newCustomerGroup) { - $data['customer_group_id'] = $newCustomerGroup; - $data['catalog_rule_id'] = $catalogRule->id; - - $this->catalogRuleCustomerGroups->create($data); - } - - return true; - } - - /** - * To sync the channels related records - * - * @param Array $newChannels - * @param CatalogRule $catalogRule - * - * @return Boolean - */ - public function ChannelSync($newChannels, $catalogRule) - { - $oldChannels = array(); - foreach ($catalogRule->channels as $oldChannel) { - array_push($oldChannels, ['id' => $oldChannel->id, 'channel_id' => $oldChannel->channel_id]); - } - - foreach ($oldChannels as $key => $oldChannel) { - $found = 0; - foreach($newChannels as $newChannel) { - if ($oldChannel['channel_id'] == $newChannel) - $found = 1; - } - - if ($found == 0) { - $this->catalogRuleChannels->find($oldChannel['id'])->delete(); - } else { - $found = 0; - } - } - - //unset the commons - if (count($newChannels) && count($oldChannels)) { - foreach ($oldChannels as $oldChannel) { - $found = 0; - - foreach ($newChannels as $key => $newChannel) { - if ($oldChannel['channel_id'] == $newChannel) - unset($newChannels[$key]); - } - } - } - - //create the left ones - foreach ($newChannels as $newChannel) { - $data['channel_id'] = $newChannel; - $data['catalog_rule_id'] = $catalogRule->id; - $this->catalogRuleChannels->create($data); - } - - return true; - } -} \ No newline at end of file diff --git a/packages/Webkul/Discount/src/resources/manifest.php b/packages/Webkul/Discount/src/resources/manifest.php deleted file mode 100644 index a5d9bb930..000000000 --- a/packages/Webkul/Discount/src/resources/manifest.php +++ /dev/null @@ -1,6 +0,0 @@ - 'Webkul Bagisto Discount', - 'version' => '0.0.1' - ]; diff --git a/packages/Webkul/Product/src/Database/Migrations/2020_01_13_131431_alter_float_value_column_type_in_product_attribute_values_table.php b/packages/Webkul/Product/src/Database/Migrations/2020_01_13_131431_alter_float_value_column_type_in_product_attribute_values_table.php new file mode 100644 index 000000000..8480dc59c --- /dev/null +++ b/packages/Webkul/Product/src/Database/Migrations/2020_01_13_131431_alter_float_value_column_type_in_product_attribute_values_table.php @@ -0,0 +1,32 @@ +decimal('float_value', 12, 4)->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('product_attribute_values', function (Blueprint $table) { + // + }); + } +} diff --git a/packages/Webkul/Product/src/Helpers/ProductType.php b/packages/Webkul/Product/src/Helpers/ProductType.php index 103b1ed58..68c523b50 100644 --- a/packages/Webkul/Product/src/Helpers/ProductType.php +++ b/packages/Webkul/Product/src/Helpers/ProductType.php @@ -28,6 +28,7 @@ class ProductType extends AbstractProduct */ public static function getAllTypesHavingVariants(): array { + $havingVariants = []; foreach (config('product_types') as $type) { if (self::hasVariants($type['key'])) { array_push($havingVariants, $type['key']); diff --git a/packages/Webkul/Product/src/Listeners/ProductFlat.php b/packages/Webkul/Product/src/Listeners/ProductFlat.php index ecb8ffe9a..338ade5fd 100644 --- a/packages/Webkul/Product/src/Listeners/ProductFlat.php +++ b/packages/Webkul/Product/src/Listeners/ProductFlat.php @@ -230,7 +230,7 @@ class ProductFlat } } - $productFlat->{$attribute->code} = $productAttributeValue[ProductAttributeValue::$attributeTypeFields[$attribute->type]]; + $productFlat->{$attribute->code} = $productAttributeValue[ProductAttributeValue::$attributeTypeFields[$attribute->type]] ?? null; if ($attribute->type == 'select') { $attributeOption = $this->attributeOptionRepository->find($product->{$attribute->code}); diff --git a/packages/Webkul/Product/src/Models/Product.php b/packages/Webkul/Product/src/Models/Product.php index dcf8f4673..ce9ab9d08 100755 --- a/packages/Webkul/Product/src/Models/Product.php +++ b/packages/Webkul/Product/src/Models/Product.php @@ -327,7 +327,7 @@ class Product extends Model implements ProductContract } } - return $attributeValue[ProductAttributeValue::$attributeTypeFields[$attribute->type]]; + return $attributeValue[ProductAttributeValue::$attributeTypeFields[$attribute->type]] ?? null; } /** diff --git a/packages/Webkul/Product/src/Repositories/ProductDownloadableLinkRepository.php b/packages/Webkul/Product/src/Repositories/ProductDownloadableLinkRepository.php index 5c51ba8f3..85543b73a 100755 --- a/packages/Webkul/Product/src/Repositories/ProductDownloadableLinkRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductDownloadableLinkRepository.php @@ -33,7 +33,7 @@ class ProductDownloadableLinkRepository extends Repository foreach ($data as $type => $file) { if (request()->hasFile($type)) { return [ - $type => $path = request()->file($type)->store('product/' . $productId), + $type => $path = request()->file($type)->store('product_downloadable_links/' . $productId), $type . '_name' => $file->getClientOriginalName(), $type . '_url' => Storage::url($path) ]; diff --git a/packages/Webkul/Product/src/Repositories/ProductDownloadableSampleRepository.php b/packages/Webkul/Product/src/Repositories/ProductDownloadableSampleRepository.php index 532ebe84f..6fdf97401 100755 --- a/packages/Webkul/Product/src/Repositories/ProductDownloadableSampleRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductDownloadableSampleRepository.php @@ -32,7 +32,7 @@ class ProductDownloadableSampleRepository extends Repository { if (request()->hasFile('file')) { return [ - 'file' => $path = request()->file('file')->store('product/' . $productId), + 'file' => $path = request()->file('file')->store('product_downloadable_links/' . $productId), 'file_name' => request()->file('file')->getClientOriginalName(), 'file_url' => Storage::url($path) ]; diff --git a/packages/Webkul/Product/src/Type/AbstractType.php b/packages/Webkul/Product/src/Type/AbstractType.php index d257ae928..e0017bf12 100644 --- a/packages/Webkul/Product/src/Type/AbstractType.php +++ b/packages/Webkul/Product/src/Type/AbstractType.php @@ -112,6 +112,13 @@ abstract class AbstractType */ protected $hasVariants = false; + /** + * Product children price can be calculated or not + * + * @var boolean + */ + protected $isChildrenCalculated = false; + /** * Create a new product type instance. * @@ -177,6 +184,10 @@ abstract class AbstractType continue; } + if ($attribute->type == 'price' && isset($data[$attribute->code]) && $data[$attribute->code] == '') { + $data[$attribute->code] = null; + } + if ($attribute->type == 'date' && $data[$attribute->code] == '' && $route != 'admin.catalog.products.massupdate') { $data[$attribute->code] = null; } @@ -252,6 +263,26 @@ abstract class AbstractType return $this; } + /** + * Returns children ids + * + * @return array + */ + public function getChildrenIds() + { + return []; + } + + /** + * Check if catalog rule can be applied + * + * @return bool + */ + public function priceRuleCanBeApplied() + { + return true; + } + /** * Return true if this product type is saleable * @@ -291,11 +322,21 @@ abstract class AbstractType * * @return bool */ - public function hasVariants(): bool + public function hasVariants() { return $this->hasVariants; } + /** + * Product children price can be calculated or not + * + * @return bool + */ + public function isChildrenCalculated() + { + return $this->isChildrenCalculated; + } + /** * @param integer $qty * @return bool @@ -452,12 +493,26 @@ abstract class AbstractType */ public function haveSpecialPrice() { - if (is_null($this->product->special_price) || ! (float) $this->product->special_price) { - return false; - } + $rulePrice = app('Webkul\CatalogRule\Helpers\CatalogRuleProductPrice')->getRulePrice($this->product); - if (core()->isChannelDateInInterval($this->product->special_price_from, $this->product->special_price_to)) { - return true; + if ((is_null($this->product->special_price) || ! (float) $this->product->special_price) && ! $rulePrice) + return false; + + if (! (float) $this->product->special_price) { + if ($rulePrice) { + $this->product->special_price = $rulePrice->price; + + return true; + } + } else { + if ($rulePrice && $rulePrice->price <= $this->product->special_price) { + $this->product->special_price = $rulePrice->price; + + return true; + } else { + if (core()->isChannelDateInInterval($this->product->special_price_from, $this->product->special_price_to)) + return true; + } } return false; diff --git a/packages/Webkul/Product/src/Type/Bundle.php b/packages/Webkul/Product/src/Type/Bundle.php index dad347cec..05018f331 100644 --- a/packages/Webkul/Product/src/Type/Bundle.php +++ b/packages/Webkul/Product/src/Type/Bundle.php @@ -68,6 +68,13 @@ class Bundle extends AbstractType */ protected $isComposite = true; + /** + * Product children price can be calculated or not + * + * @var boolean + */ + protected $isChildrenCalculated = true; + /** * Create a new product type instance. * @@ -126,6 +133,26 @@ class Bundle extends AbstractType return $product; } + /** + * Returns children ids + * + * @return array + */ + public function getChildrenIds() + { + return array_unique($this->product->bundle_options()->pluck('product_id')->toArray()); + } + + /** + * Check if catalog rule can be applied + * + * @return bool + */ + public function priceRuleCanBeApplied() + { + return false; + } + /** * Get product minimal price * @@ -133,22 +160,28 @@ class Bundle extends AbstractType */ public function getMinimalPrice() { - $optionPrices = []; + $minPrice = 0; + + $haveRequiredOptions = $this->haveRequiredOptions(); + + $minPrices = []; foreach ($this->product->bundle_options as $option) { - if(! $option->is_required) - continue; + $optionProductsPrices = $this->getOptionProductsPrices($option); - foreach ($option->bundle_option_products as $index => $bundleOptionProduct) { - $optionPrices[$option->id][] = $bundleOptionProduct->qty * $bundleOptionProduct->product->getTypeInstance()->getMinimalPrice(); + if (count($optionProductsPrices)) { + $selectionMinPrice = min($optionProductsPrices); + + if($option->is_required) { + $minPrice += $selectionMinPrice; + } elseif (! $haveRequiredOptions) { + $minPrices[] = $selectionMinPrice; + } } } - $minPrice = 0; - - foreach ($optionPrices as $key => $optionPrice) { - $minPrice += min($optionPrice); - } + if (! $haveRequiredOptions) + $minPrice = min($minPrices); return $minPrice; } @@ -160,26 +193,68 @@ class Bundle extends AbstractType */ public function getRegularMinimalPrice() { - $optionPrices = []; + $minPrice = 0; + + $haveRequiredOptions = $this->haveRequiredOptions(); + + $minPrices = []; foreach ($this->product->bundle_options as $option) { - if(! $option->is_required) - continue; + $optionProductsPrices = $this->getOptionProductsPrices($option, false); - foreach ($option->bundle_option_products as $index => $bundleOptionProduct) { - $optionPrices[$option->id][] = $bundleOptionProduct->qty * $bundleOptionProduct->product->price; + if (count($optionProductsPrices)) { + $selectionMinPrice = min($optionProductsPrices); + + if($option->is_required) { + $minPrice += $selectionMinPrice; + } elseif (! $haveRequiredOptions) { + $minPrices[] = $selectionMinPrice; + } } } - $minPrice = 0; - - foreach ($optionPrices as $key => $optionPrice) { - $minPrice += min($optionPrice); - } + if (! $haveRequiredOptions) + $minPrice = min($minPrices); return $minPrice; } + /** + * Get product regular minimal price + * + * @param ProductBundleOption $option + * @param boolean $minPrice + * @return float + */ + public function getOptionProductsPrices($option, $minPrice = true) + { + $optionPrices = []; + + foreach ($option->bundle_option_products as $index => $bundleOptionProduct) { + $optionPrices[] = $bundleOptionProduct->qty + * ($minPrice + ? $bundleOptionProduct->product->getTypeInstance()->getMinimalPrice() + : $bundleOptionProduct->product->price); + } + + return $optionPrices; + } + + /** + * Check if product has required options or not + * + * @return boolean + */ + protected function haveRequiredOptions() + { + foreach ($this->product->bundle_options as $option) { + if ($option->is_required) + return true; + } + + return false; + } + /** * Get product maximam price * @@ -293,7 +368,7 @@ class Bundle extends AbstractType public function getPriceHtml() { $prices = $this->getProductPrices(); - + $priceHtml = '
'; if ($prices['from']['regular_price']['price'] != $prices['from']['final_price']['price']) { diff --git a/packages/Webkul/Product/src/Type/Configurable.php b/packages/Webkul/Product/src/Type/Configurable.php index e0f1c3eea..db2890f1d 100644 --- a/packages/Webkul/Product/src/Type/Configurable.php +++ b/packages/Webkul/Product/src/Type/Configurable.php @@ -286,6 +286,16 @@ class Configurable extends AbstractType return false; } + /** + * Returns children ids + * + * @return array + */ + public function getChildrenIds() + { + return $this->product->variants()->pluck('id')->toArray(); + } + /** * @param CartItem $cartItem * @return bool diff --git a/packages/Webkul/Product/src/Type/Grouped.php b/packages/Webkul/Product/src/Type/Grouped.php index 2af33ccb6..0d1559f43 100644 --- a/packages/Webkul/Product/src/Type/Grouped.php +++ b/packages/Webkul/Product/src/Type/Grouped.php @@ -104,6 +104,26 @@ class Grouped extends AbstractType return $product; } + /** + * Returns children ids + * + * @return array + */ + public function getChildrenIds() + { + return array_unique($this->product->grouped_products()->pluck('product_id')->toArray()); + } + + /** + * Check if catalog rule can be applied + * + * @return bool + */ + public function priceRuleCanBeApplied() + { + return false; + } + /** * Get product minimal price * @@ -113,17 +133,8 @@ class Grouped extends AbstractType { $minPrices = []; - $result = $this->product->grouped_products() - ->join('product_flat', 'product_grouped_products.associated_product_id', '=', 'product_flat.product_id') - ->selectRaw('IF( product_flat.special_price_from IS NOT NULL - AND product_flat.special_price_to IS NOT NULL , IF( NOW( ) >= product_flat.special_price_from - AND NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , IF( product_flat.special_price_from IS NULL , IF( product_flat.special_price_to IS NULL , IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , IF( NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) ) , IF( product_flat.special_price_to IS NULL , IF( NOW( ) >= product_flat.special_price_from, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , product_flat.price ) ) ) AS min_price') - ->where('product_flat.channel', core()->getCurrentChannelCode()) - ->where('product_flat.locale', app()->getLocale()) - ->get(); - - foreach ($result as $price) { - $minPrices[] = $price->min_price; + foreach ($this->product->grouped_products as $groupOptionProduct) { + $minPrices[] = $groupOptionProduct->associated_product->getTypeInstance()->getMinimalPrice(); } if (empty($minPrices)) diff --git a/packages/Webkul/Rule/src/Helpers/Validator.php b/packages/Webkul/Rule/src/Helpers/Validator.php new file mode 100644 index 000000000..ac510f314 --- /dev/null +++ b/packages/Webkul/Rule/src/Helpers/Validator.php @@ -0,0 +1,240 @@ +conditions) + return true; + + $validConditionCount = $totalConditionCount = 0; + + foreach ($rule->conditions as $condition) { + if (! $condition['attribute'] || ! isset($condition['value']) || is_null($condition['value']) || $condition['value'] == '') + continue; + + if ($entity instanceof \Webkul\Checkout\Contracts\Cart && strpos($condition['attribute'], 'cart|') === false) + continue; + + $totalConditionCount++; + + if ($rule->condition_type == 1) { + if (! $this->validateObject($condition, $entity)) { + return false; + } else { + $validConditionCount++; + } + } else { + if ($this->validateObject($condition, $entity)) + return true; + } + } + + return $validConditionCount == $totalConditionCount ? true : false; + } + + /** + * Return value for the attribute + * + * @param array $condition + * @param CartItem|Product $entity + * @return boolean + */ + public function getAttributeValue($condition, $entity) + { + $chunks = explode('|', $condition['attribute']); + + $attributeNameChunks = explode('::', $chunks[1]); + + $attributeCode = $attributeNameChunks[count($attributeNameChunks) - 1]; + + switch (current($chunks)) { + case 'cart': + $cart = $entity instanceof \Webkul\Checkout\Contracts\Cart ? $entity : $entity->cart; + + if (in_array($attributeCode, ['postcode', 'state', 'country'])) { + if (! $cart->shipping_address) + return; + + return $cart->shipping_address->{$attributeCode}; + } else if ($attributeCode == 'shipping_method') { + if (! $cart->shipping_method) + return; + + $shippingChunks = explode('_', $cart->shipping_method); + + return current($shippingChunks); + } else if ($attributeCode == 'payment_method') { + if (! $cart->payment) + return; + + return $cart->payment->method; + } else { + return $cart->{$attributeCode}; + } + + case 'cart_item': + return $entity->{$attributeCode}; + + case 'product': + if ($attributeCode == 'category_ids') { + $value = $entity->product + ? $entity->product->categories()->pluck('id')->toArray() + : $entity->categories()->pluck('id')->toArray(); + + return $value; + } else { + $value = $entity->product + ? $entity->product->{$attributeCode} + : $entity->{$attributeCode}; + + if (! in_array($condition['attribute_type'], ['multiselect', 'checkbox'])) + return $value; + + return $value ? explode(',', $value) : []; + } + } + } + + /** + * Validate object + * + * @param array $condition + * @param CartItem $entity + * @return bool + */ + private function validateObject($condition, $entity) + { + $validated = false; + + foreach ($this->getAllItems($this->getAttributeScope($condition), $entity) as $item) { + $attributeValue = $this->getAttributeValue($condition, $item); + + if ($validated = $this->validateAttribute($condition, $attributeValue)) + break; + } + + return $validated; + } + + /** + * Return all cart items + * + * @param string $attributeScope + * @param Cart|CartItem|Product $item + * @return array + */ + private function getAllItems($attributeScope, $item) + { + if ($attributeScope === 'parent') { + return [$item]; + } elseif ($attributeScope === 'children') { + return $item->children ?: [$item]; + } else { + $items = $item->children ?: []; + + $items[] = $item; + } + + return $items; + } + + /** + * Validate object + * + * @param array $condition + * @return string + */ + private function getAttributeScope($condition) + { + $chunks = explode('|', $condition['attribute']); + + $attributeNameChunks = explode('::', $chunks[1]); + + return count($attributeNameChunks) == 2 ? $attributeNameChunks[0] : null; + } + + /** + * Validate attribute value for condition + * + * @param array $condition + * @param mixed $attributeValue + * @return boolean + */ + public function validateAttribute($condition, $attributeValue) + { + switch ($condition['operator']) { + case '==': case '!=': + if (is_array($condition['value'])) { + if (! is_array($attributeValue)) + return false; + + $result = ! empty(array_intersect($condition['value'], $attributeValue)); + } else { + if (is_array($attributeValue)) { + $result = count($attributeValue) == 1 && array_shift($attributeValue) == $condition['value']; + } else { + $result = $attributeValue == $condition['value']; + } + } + + break; + + case '<=': case '>': + if (! is_scalar($attributeValue)) + return false; + + $result = $attributeValue <= $condition['value']; + + break; + + case '>=': case '<': + if (! is_scalar($attributeValue)) + return false; + + $result = $attributeValue >= $condition['value']; + + break; + + case '{}': case '!{}': + if (is_scalar($attributeValue) && is_array($condition['value'])) { + foreach ($condition['value'] as $item) { + if (stripos($attributeValue, $item) !== false) { + $result = true; + + break; + } + } + } else if (is_array($condition['value'])) { + if (! is_array($attributeValue)) + return false; + + $result = ! empty(array_intersect($condition['value'], $attributeValue)); + } else { + if (is_array($attributeValue)) { + $result = in_array($condition['value'], $attributeValue); + } else { + $result = (strpos($attributeValue, $condition['value']) !== false) ? true : false; + } + } + + break; + } + + if (in_array($condition['operator'], ['!=', '>', '<', '!{}'])) + $result = ! $result; + + return $result; + } +} \ No newline at end of file diff --git a/packages/Webkul/Rule/src/Providers/RuleServiceProvider.php b/packages/Webkul/Rule/src/Providers/RuleServiceProvider.php new file mode 100644 index 000000000..2a48f4d5d --- /dev/null +++ b/packages/Webkul/Rule/src/Providers/RuleServiceProvider.php @@ -0,0 +1,26 @@ +string('applied_cart_rule_ids')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('orders', function (Blueprint $table) { + // + }); + } +} diff --git a/packages/Webkul/Sales/src/Database/Migrations/2020_01_09_154851_add_shipping_discount_columns_in_orders_table.php b/packages/Webkul/Sales/src/Database/Migrations/2020_01_09_154851_add_shipping_discount_columns_in_orders_table.php new file mode 100644 index 000000000..2d5f69876 --- /dev/null +++ b/packages/Webkul/Sales/src/Database/Migrations/2020_01_09_154851_add_shipping_discount_columns_in_orders_table.php @@ -0,0 +1,33 @@ +decimal('shipping_discount_amount', 12, 4)->default(0)->nullable(); + $table->decimal('base_shipping_discount_amount', 12, 4)->default(0)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('orders', function (Blueprint $table) { + // + }); + } +} diff --git a/packages/Webkul/Sales/src/Database/Migrations/2020_01_09_202815_add_inventory_source_name_column_in_shipments_table.php b/packages/Webkul/Sales/src/Database/Migrations/2020_01_09_202815_add_inventory_source_name_column_in_shipments_table.php new file mode 100644 index 000000000..07fd44fa6 --- /dev/null +++ b/packages/Webkul/Sales/src/Database/Migrations/2020_01_09_202815_add_inventory_source_name_column_in_shipments_table.php @@ -0,0 +1,32 @@ +string('inventory_source_name')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('shipments', function (Blueprint $table) { + // + }); + } +} diff --git a/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php b/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php index 9e2d21de0..2187b1e69 100755 --- a/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php +++ b/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php @@ -230,10 +230,18 @@ class InvoiceRepository extends Repository $invoice->shipping_amount = $invoice->order->shipping_amount; $invoice->base_shipping_amount = $invoice->order->base_shipping_amount; + $invoice->discount_amount += $invoice->order->shipping_discount_amount; + $invoice->base_discount_amount += $invoice->order->base_shipping_discount_amount; + if ($invoice->order->shipping_amount) { foreach ($invoice->order->invoices as $prevInvoice) { if ((float) $prevInvoice->shipping_amount) $invoice->shipping_amount = $invoice->base_shipping_amount = 0; + + if ($prevInvoice->id != $invoice->id) { + $invoice->discount_amount -= $invoice->order->shipping_discount_amount; + $invoice->base_discount_amount -= $invoice->order->base_shipping_discount_amount; + } } } diff --git a/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php b/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php index 99bf2a1eb..83076718d 100755 --- a/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php +++ b/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php @@ -157,7 +157,8 @@ class ShipmentRepository extends Repository } $shipment->update([ - 'total_qty' => $totalQty + 'total_qty' => $totalQty, + 'inventory_source_name' => $shipment->inventory_source->name ]); $this->orderRepository->updateOrderStatus($order); diff --git a/packages/Webkul/Shipping/src/Config/system.php b/packages/Webkul/Shipping/src/Config/system.php index 916d61b99..ad446e5d4 100755 --- a/packages/Webkul/Shipping/src/Config/system.php +++ b/packages/Webkul/Shipping/src/Config/system.php @@ -67,6 +67,7 @@ return [ 'name' => 'default_rate', 'title' => 'admin::app.admin.system.rate', 'type' => 'text', + 'validation' => 'required', 'channel_based' => true, 'locale_based' => false ], [ diff --git a/packages/Webkul/Shop/package.json b/packages/Webkul/Shop/package.json index 9f3d3d1df..281904967 100755 --- a/packages/Webkul/Shop/package.json +++ b/packages/Webkul/Shop/package.json @@ -10,18 +10,21 @@ "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { - "axios": "^0.18", - "cross-env": "^5.1.4", - "laravel-mix": "^2.1", - "laravel-mix-merge-manifest": "^0.1.1", - "jquery": "^3.2", - "vue": "^2.1.10" + "axios": "^0.19.0", + "cross-env": "^6.0.3", + "jquery": "^3.4.1", + "laravel-mix": "^5.0.0", + "laravel-mix-merge-manifest": "^0.1.2", + "sass": "^1.24.4", + "sass-loader": "^8.0.0", + "vue": "^2.6.10", + "vue-template-compiler": "^2.6.11" }, "dependencies": { "accounting": "^0.4.1", "ez-plus": "^1.2.1", - "vee-validate": "2.0.0-rc.26", + "vee-validate": "^2.2.15", "vue-flatpickr": "^2.3.0", - "vue-slider-component": "^2.7.5" + "vue-slider-component": "^3.0.44" } } diff --git a/packages/Webkul/Shop/publishable/assets/css/shop.css b/packages/Webkul/Shop/publishable/assets/css/shop.css index 4abd3698d..0dfaeaf43 100755 --- a/packages/Webkul/Shop/publishable/assets/css/shop.css +++ b/packages/Webkul/Shop/publishable/assets/css/shop.css @@ -1 +1 @@ -@import url(https://fonts.googleapis.com/css?family=Montserrat:400,500);.icon{display:inline-block;background-size:cover}.dropdown-right-icon{background-image:URL("../images/icon-dropdown-left.svg");width:8px;height:8px;margin-left:auto;margin-bottom:2px}.icon-menu-close{background-image:URL("../images/icon-menu-close.svg");width:24px;height:24px;margin-left:auto}.icon-menu-close-adj{background-image:URL("../images/cross-icon-adj.svg");margin-left:auto}.grid-view-icon{background-image:URL("../images/icon-grid-view.svg");width:24px;height:24px}.list-view-icon{background-image:URL("../images/icon-list-view.svg");width:24px;height:24px}.sort-icon{background-image:URL("../images/icon-sort.svg");width:32px;height:32px}.filter-icon{background-image:URL("../images/icon-filter.svg");width:32px;height:32px}.whishlist-icon{background-image:URL("../images/wishlist.svg");width:24px;height:24px}.share-icon{background-image:URL("../images/icon-share.svg");width:24px;height:24px}.icon-menu{background-image:URL("../images/icon-menu.svg");width:24px;height:24px}.icon-search{background-image:URL("../images/icon-search.svg");width:24px;height:24px}.icon-menu-back{background-image:URL("../images/icon-menu-back.svg");width:24px;height:24px}.shipping-icon{background-image:url("../images/shipping.svg");width:32px;height:32px}.payment-icon{background-image:url("../images/payment.svg");width:32px;height:32px}.cart-icon{background-image:url("../images/icon-cart.svg");width:24px;height:24px}.wishlist-icon{background-image:url("../images/wishlist.svg");width:32px;height:32px}.icon-arrow-up{background-image:url("../images/arrow-up.svg");width:16px;height:16px}.icon-arrow-down{background-image:url("../images/arrow-down.svg");width:16px;height:16px}.expand-icon{background-image:url("../images/Expand-Light.svg");width:18px;height:18px}.expand-on-icon{background-image:url("../images/Expand-Light-On.svg");width:18px;height:18px}.icon-menu-close-adj{background-image:url("../images/cross-icon-adj.svg");width:32px;height:32px}.icon-facebook{background-image:url("../images/facebook.svg")}.icon-twitter{background-image:url("../images/twitter.svg")}.icon-google-plus{background-image:url("../images/google-plus.svg")}.icon-instagram{background-image:url("../images/instagram.svg")}.icon-linkedin{background-image:url("../images/linkedin.svg")}.icon-dropdown{background-image:url("../images/icon-dropdown.svg")}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}body{margin:0;padding:0;font-weight:500;max-width:100%;width:auto;color:#242424;font-size:16px}*{font-family:Montserrat,sans-serif}::-webkit-input-placeholder{font-family:Montserrat,sans-serif}::-moz-input-placeholder{font-family:Montserrat,sans-serif}textarea{resize:none}input{font-family:Montserrat,sans-serif}.btn{border-radius:0!important}.pagination.shop{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}@media only screen and (max-width:770px){.pagination.shop{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.pagination.shop .page-item{display:none}.pagination.shop .page-item.next,.pagination.shop .page-item.previous{display:block}}.bold{font-weight:700;color:#3a3a3a}.radio-container{display:block;position:relative;padding-left:35px;margin-bottom:12px;cursor:pointer;font-size:16px;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.radio-container input{position:absolute;opacity:0;cursor:pointer;top:0;left:0}.radio-container .checkmark{position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border:2px solid #ff6472;border-radius:50%}.radio-container .checkmark:after{content:"";position:absolute;display:none;top:2px;left:2px;width:8px;height:8px;border-radius:50%;background:#ff6472}.radio-container input:checked~.checkmark:after{display:block}.radio-container input:disabled~.checkmark{display:block;border:2px solid rgba(255,100,113,.4)}.cp-spinner{width:48px;height:48px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}.cp-round:before{border-radius:50%;border:6px solid #bababa}.cp-round:after,.cp-round:before{content:" ";width:48px;height:48px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;top:0;left:0}.cp-round:after{border-radius:50%;border-top:6px solid #0031f0;border-right:6px solid transparent;border-bottom:6px solid transparent;border-left:6px solid transparent;-webkit-animation:spin 1s ease-in-out infinite;animation:spin 1s ease-in-out infinite}.radio{margin:10px 0 0!important}.checkbox{margin:10px 0 0}.checkbox .checkbox-view{height:16px!important;width:16px!important;background-image:url("../images/checkbox.svg")!important}.checkbox input:checked+.checkbox-view{background-image:url("../images/checkbox-checked.svg")!important}.pull-right{float:right}.add-to-wishlist .wishlist-icon:hover{background-image:url("../images/wishlist-added.svg")}.add-to-wishlist.already{pointer-events:none}.add-to-wishlist.already .wishlist-icon{background-image:url("../images/wishlist-added.svg")!important}.product-price{margin-bottom:14px;width:100%;font-weight:600}.product-price .price-label{font-size:14px;font-weight:400;margin-right:5px}.product-price .regular-price{color:#a5a5a5;text-decoration:line-through;margin-right:10px}.product-price .special-price{color:#ff6472}.horizontal-rule{display:block;width:100%;height:1px;background:#c7c7c7}.account-head .account-heading{font-size:28px;color:#242424;text-transform:capitalize;text-align:left}.account-head .account-action{font-size:17px;margin-top:1%;color:#0031f0;float:right}.account-head .horizontal-rule{margin-top:1.1%;width:100%;height:1px;vertical-align:middle;background:#c7c7c7}.account-item-card{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;height:125px}.account-item-card,.account-item-card .media-info{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.account-item-card .media-info .media{height:125px;width:110px}.account-item-card .media-info .info{margin-left:20px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:space-evenly;-ms-flex-pack:space-evenly;justify-content:space-evenly}.account-item-card .media-info .info .stars .icon{height:16px;width:16px}.account-item-card .operations{height:120px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.account-item-card .operations a{width:100%}.account-item-card .operations a span{float:right}.account-items-list{display:block;width:100%}.account-items-list .grid-container{margin-top:40px}.search-result-status{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.grid-container{margin-top:20px}.main-container-wrapper{max-width:1300px;width:auto;padding-left:15px;padding-right:15px;margin-left:auto;margin-right:auto}.main-container-wrapper .content-container{display:block;margin-bottom:40px}.main-container-wrapper .product-grid-4{grid-auto-rows:auto;grid-column-gap:30px;grid-row-gap:15px}.main-container-wrapper .product-grid-3,.main-container-wrapper .product-grid-4{display:grid;grid-template-columns:repeat(auto-fill,minmax(235px,1fr));justify-items:center}.main-container-wrapper .product-grid-3{grid-gap:27px;grid-auto-rows:auto}.main-container-wrapper .product-card{position:relative;padding:15px}.main-container-wrapper .product-card .product-image{max-height:350px;max-width:280px;margin-bottom:10px;background:#f2f2f2}.main-container-wrapper .product-card .product-image img{display:block;height:100%}.main-container-wrapper .product-card .product-name{margin-bottom:14px;width:100%;color:#242424}.main-container-wrapper .product-card .product-name a{color:#242424}.main-container-wrapper .product-card .product-description{display:none}.main-container-wrapper .product-card .product-ratings{width:100%}.main-container-wrapper .product-card .product-ratings .icon{width:16px;height:16px}.main-container-wrapper .product-card .cart-wish-wrap{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:40px}.main-container-wrapper .product-card .cart-wish-wrap .addtocart{margin-right:10px;text-transform:uppercase;text-align:left;-webkit-box-shadow:1px 1px 0 #ccc;box-shadow:1px 1px 0 #ccc}.main-container-wrapper .product-card .cart-wish-wrap .add-to-wishlist{margin-top:5px;background:transparent;border:0;cursor:pointer;padding:0}.main-container-wrapper .product-card .sticker{border-bottom-right-radius:15px;position:absolute;top:15px;left:15px;text-transform:uppercase;padding:4px 13px;font-size:14px;color:#fff;-webkit-box-shadow:1px 1px 1px #ccc;box-shadow:1px 1px 1px #ccc;font-weight:500}.main-container-wrapper .product-card .sticker.sale{background:#ff6472}.main-container-wrapper .product-card .sticker.new{background:#2ed04c}.main-container-wrapper .product-card:hover{box-shadow:0 1px 2px rgba(0,0,0,.05);-webkit-box-shadow:0 2px 16px 4px rgba(40,44,63,.07);box-shadow:0 2px 16px 4px rgba(40,44,63,.07);-webkit-transition:.3s;transition:.3s}@media only screen and (max-width:580px){.main-container-wrapper .main-container-wrapper{padding:0}}@media only screen and (max-width:551px){.main-container-wrapper .product-grid-3{grid-template-columns:48.5% 48.5%;grid-column-gap:20px}}@media only screen and (max-width:854px){.main-container-wrapper .product-image img{display:block;width:100%}.main-container-wrapper .product-grid-4{grid-template-columns:29.5% 29.5% 29.5%;grid-column-gap:35px}.main-container-wrapper .product-card:hover{padding:5px}}@media only screen and (max-width:653px){.main-container-wrapper .product-image img{display:block;width:100%}.main-container-wrapper .product-grid-4{grid-template-columns:48.5% 48.5%;grid-column-gap:17px}}@media only screen and (max-width:425px){.main-container-wrapper .product-card{font-size:90%}.main-container-wrapper .product-card .product-image img{display:block;width:100%}.main-container-wrapper .product-card .btn.btn-md{padding:5px}.main-container-wrapper .product-grid-4{grid-template-columns:48.5% 48.5%;grid-column-gap:10px}}.main-container-wrapper .product-list{min-height:200px}.main-container-wrapper .product-list .product-card{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:20px}.main-container-wrapper .product-list .product-card .product-image{float:left;width:30%;height:350px}.main-container-wrapper .product-list .product-card .product-image img{height:100%;width:100%}.main-container-wrapper .product-list .product-card .product-information{float:right;width:70%;padding-left:30px}.main-container-wrapper .product-list .product-card:last-child{margin-bottom:0}.main-container-wrapper .product-list.empty h2{font-size:20px}.main-container-wrapper section.featured-products{display:block;margin-bottom:5%}.main-container-wrapper section.featured-products .featured-heading{width:100%;text-align:center;text-transform:uppercase;font-size:18px;margin-bottom:20px}.main-container-wrapper section.featured-products .featured-heading .featured-separator{color:#d3d3d3}.main-container-wrapper section.news-update{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;margin-bottom:5%}.main-container-wrapper section.news-update .news-update-grid{display:grid;grid-template-columns:58.5% 40%;grid-gap:20px}.main-container-wrapper section.news-update .news-update-grid .block1{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}.main-container-wrapper section.news-update .news-update-grid .block1 img{display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;width:100%}.main-container-wrapper section.news-update .news-update-grid .block2{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;display:grid;grid-template-rows:repeat(2,minmax(50%,1fr));grid-row-gap:20px}.main-container-wrapper section.news-update .news-update-grid .block2 .sub-block1{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}.main-container-wrapper section.news-update .news-update-grid .block2 .sub-block1 img{width:100%}.main-container-wrapper section.news-update .news-update-grid .block2 .sub-block2{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}.main-container-wrapper section.news-update .news-update-grid .block2 .sub-block2 img{width:100%}section.slider-block{display:block;margin-left:auto;margin-right:auto;margin-bottom:5%}section.slider-block div.slider-content{position:relative;height:500px;margin-left:auto;margin-right:auto}section.slider-block div.slider-content ul.slider-images .show-content{display:none}section.slider-block div.slider-content ul.slider-images li{position:absolute;visibility:hidden}section.slider-block div.slider-content ul.slider-images li.show{display:block;position:relative;visibility:visible;width:100%;-webkit-animation-name:example;animation-name:example;-webkit-animation-duration:4s;animation-duration:4s}section.slider-block div.slider-content ul.slider-images li.show .show-content{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#242424;height:100%;width:100%;top:0}@-webkit-keyframes example{0%{opacity:.1}to{opacity:1}}@keyframes example{0%{opacity:.1}to{opacity:1}}section.slider-block div.slider-content ul.slider-images li img{max-height:500px;max-width:100%}section.slider-block div.slider-content div.slider-control{display:block;cursor:pointer;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;bottom:2%;right:2%}section.slider-block div.slider-content div.slider-control .dark-left-icon{background-color:#f2f2f2;height:48px;width:48px;max-height:100%;max-width:100%}section.slider-block div.slider-content div.slider-control .light-right-icon{background-color:#242424;height:48px;width:48px;max-height:100%;max-width:100%}@media only screen and (max-width:770px){section.slider-block div.slider-content div.slider-control{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;bottom:46%;right:0;width:100%}}.header{margin-top:16px;margin-bottom:21px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.header .header-top{margin-bottom:16px;max-width:100%;width:auto;margin-left:auto;margin-right:auto;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.header .header-top,.header .header-top div.left-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.header .header-top div.left-content{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.header .header-top div.left-content ul.logo-container{margin-right:12px}.header .header-top div.left-content ul.logo-container li{display:-webkit-box;display:-ms-flexbox;display:flex}.header .header-top div.left-content ul.logo-container li img{max-width:120px;max-height:40px}.header .header-top div.left-content ul.search-container li.search-group{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.header .header-top div.left-content ul.search-container li.search-group .search-field{height:38px;border:2px solid #c7c7c7;border-radius:3px;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;padding-left:12px;font-size:14px}.header .header-top div.left-content ul.search-container li.search-group .search-icon-wrapper{-webkit-box-sizing:border-box;box-sizing:border-box;height:38px;width:38px;border:2px solid #c7c7c7;border-top-right-radius:3px;border-bottom-right-radius:3px}.header .header-top div.left-content ul.search-container li.search-group .search-icon-wrapper button{background:#fff;border:0;padding:3px 5px}.header .header-top div.right-content .right-content-menu>li{display:inline-block;border-right:2px solid #c7c7c7;padding:0 15px;min-height:15px;padding-top:3px}.header .header-top div.right-content .right-content-menu>li:first-child{padding-left:0}.header .header-top div.right-content .right-content-menu>li:last-child{border-right:0;padding-right:0}.header .header-top div.right-content .right-content-menu>li .icon{vertical-align:middle}.header .header-top div.right-content .right-content-menu>li .icon:not(.arrow-down-icon){margin-right:5px}.header .header-top div.right-content .right-content-menu>li .arrow-down-icon{width:12px;height:6px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container{border-right:0;padding-right:0}.header .header-top div.right-content .right-content-menu .cart-link{pointer-events:none}.header .header-top div.right-content .right-content-menu ul.dropdown-list{display:none;margin-top:14px}.header .header-top div.right-content .right-content-menu ul.dropdown-list li{border-right:none;padding:5px 10px;display:block}.header .header-top div.right-content .right-content-menu ul.dropdown-list li a{color:#333}.header .header-top div.right-content .right-content-menu .currency{position:absolute;right:0;width:100px}.header .header-top div.right-content .right-content-menu .account{position:absolute;right:0}.header .header-top div.right-content .right-content-menu .account li{padding:20px!important}.header .header-top div.right-content .right-content-menu .account li ul{margin-top:5px}.header .header-top div.right-content .right-content-menu .account li ul>li{padding:5px 10px 5px 0!important}.header .header-top div.right-content .right-content-menu .guest{width:300px}.header .header-top div.right-content .right-content-menu .guest .btn.btn-sm{padding:9px 25px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list{width:387px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container{padding:0}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-cart{color:#242424}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-cart>.dropdown-header{width:100%;padding:8px 16px;border-bottom:1px solid #c7c7c7}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-cart>.dropdown-header p{display:inline;line-height:25px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-cart>.dropdown-header i{float:right;height:22px;width:22px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-cart>.dropdown-header p.heading{font-weight:lighter}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-content{padding-top:8px;margin-bottom:55px;width:100%;max-height:329px;overflow-y:auto}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-content .item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;border-bottom:1px solid #c7c7c7;padding:8px 16px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-content .item img{height:75px;width:75px;margin-right:8px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-content .item-details{height:auto}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .item-details .item-name{font-size:16px;font-weight:700;margin-bottom:8px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .item-details .item-options,.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .item-details .item-price{margin-bottom:8px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .item-details .item-qty{font-weight:lighter;margin-bottom:8px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:8px 16px;position:absolute;bottom:0;width:100%;background:#fff;border-top:1px solid #c7c7c7}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-footer .btn{margin:0;max-width:170px;text-align:center}.header .header-top div.right-content .menu-box,.header .header-top div.right-content .search-box{display:none}.header .header-bottom{height:47px;margin-left:auto;margin-right:auto;border-top:1px solid #c7c7c7;border-bottom:1px solid #c7c7c7;display:block}.header .header-bottom ul.nav{display:block;font-size:16px;max-width:100%;width:auto;margin-left:auto;margin-right:auto}.header .header-bottom .nav ul{margin:0;padding:0;-webkit-box-shadow:1px 1px 1px 0 rgba(0,0,0,.4);box-shadow:1px 1px 1px 0 rgba(0,0,0,.4)}.header .header-bottom .nav a{display:block;color:#242424;text-decoration:none;padding:.8em .3em .8em .5em;text-transform:capitalize;letter-spacing:-.38px;position:relative}.header .header-bottom .nav li>.icon{display:none}.header .header-bottom .nav{vertical-align:top;display:inline-block}.header .header-bottom .nav li{position:relative}.header .header-bottom .nav>li{float:left;margin-right:1px;height:45px}.header .header-bottom .nav>li>a{margin-bottom:1px}.header .header-bottom .nav>li>a .icon{display:none}.header .header-bottom .nav li li a{margin-top:1px;white-space:normal;word-break:break-word;width:200px}.header .header-bottom .nav li a:first-child:nth-last-child(2):before{content:"";position:absolute;height:0;width:0;border:5px solid transparent;top:50%;right:5px}.header .header-bottom .nav ul{position:absolute;white-space:nowrap;border:1px solid #c7c7c7;background-color:#fff;z-index:10000;left:-99999em}.header .header-bottom .nav>li:hover{background-color:#f2f2f2}.header .header-bottom .nav>li:hover>ul{left:auto;min-width:100%}.header .header-bottom .nav>li li:hover{background-color:#f2f2f2}.header .header-bottom .nav>li li:hover>ul{left:100%;margin-left:1px;top:-2px}.header .header-bottom .nav>li:hover>a:first-child:nth-last-child(2):before,.header .header-bottom .nav li li>a:first-child:nth-last-child(2):before{margin-top:-5px}.header .header-bottom .nav li li:hover>a:first-child:nth-last-child(2):before{right:10px}.header .search-responsive{display:none}.header .search-responsive .search-content{border-bottom:1px solid #c7c7c7;border-top:1px solid #c7c7c7;height:50px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.header .search-responsive .search-content .search{width:80%;border:none;font-size:16px}.header .search-responsive .search-content .right{float:right}@media (max-width:720px){.header .currency-switcher{display:none!important}.header .header-top div.right-content{display:inherit}.header .header-top div.right-content .menu-box{display:inline-block;margin-left:10px}.header .header-top div.right-content .search-box{display:inline-block;margin-right:10px;cursor:pointer}.header .header-top div.right-content .right-content-menu>li{border-right:none;padding:0 2px}.header .header-top div.right-content .right-content-menu>li .icon:not(.arrow-down-icon){margin-right:0}.header .header-top div.right-content .right-content-menu .cart-link{pointer-events:all}.header .header-top div.right-content .right-content-menu .arrow-down-icon,.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-container,.header .header-top div.right-content .right-content-menu .name{display:none}.header .header-bottom{height:auto;display:none}.header .header-bottom .nav a{display:inline-block}.header .header-bottom .nav li,.header .header-bottom ul.nav{height:auto}.header .header-bottom .nav>li{float:none}.header .header-bottom .nav li>.icon{float:right;display:block}.header .header-bottom .icon.icon-arrow-down{margin-right:5px}.header .header-bottom .nav li .left{height:16px;width:16px}.header .header-bottom .nav li a>.icon{display:none}.header .header-bottom .nav ul{position:unset;border:none;-webkit-box-shadow:none;box-shadow:none}.header .header-bottom .nav>li li:hover>ul{margin-left:0;top:0}ul.account-dropdown-container,ul.cart-dropdown-container,ul.search-container{display:none!important}}@media (max-width:400px){.header .header-top div.right-content .right-content-menu .guest{width:240px}.header .header-top div.right-content .right-content-menu .guest .btn.btn-sm{padding:7px 14px}}.footer{background-color:#f2f2f2;padding-left:10%;padding-right:10%;width:100%;display:inline-block}.footer .footer-content .footer-list-container{display:grid;padding:40px 10px;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));grid-auto-rows:auto;grid-row-gap:1vh}.footer .footer-content .footer-list-container .list-container .list-heading{text-transform:uppercase;color:#a5a5a5}.footer .footer-content .footer-list-container .list-container .list-group{padding-top:25px}.footer .footer-content .footer-list-container .list-container .list-group a{color:#242424}.footer .footer-content .footer-list-container .list-container .list-group li{margin-bottom:12px;list-style-type:none;text-transform:uppercase}.footer .footer-content .footer-list-container .list-container .list-group li span.icon{display:inline-block;vertical-align:middle;margin-right:5px;height:24px;width:24px}.footer .footer-content .footer-list-container .list-container .form-container{padding-top:5px}.footer .footer-content .footer-list-container .list-container .form-container .control-group .subscribe-field{width:100%}.footer .footer-content .footer-list-container .list-container .form-container .control-group .btn-primary{background-color:#242424;margin-top:8px;border-radius:0;text-align:center}.footer .footer-content .footer-list-container .list-container .form-container .control-group .locale-switcher{width:100%}.footer .footer-content .footer-list-container .list-container .currency{display:none}@media (max-width:720px){.footer{padding-left:15px}.footer .footer-list-container{padding-left:0!important}.footer .currency{display:block!important}}.footer-bottom{width:100%;height:70px;font-size:16px;color:#a5a5a5;letter-spacing:-.26px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.footer-bottom p{padding:0 15px}.main .category-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;width:100%}.main .category-container .layered-filter-wrapper,.main .category-container .responsive-layred-filter{width:25%;float:left;padding-right:20px;min-height:1px}.main .category-container .layered-filter-wrapper .filter-title,.main .category-container .responsive-layred-filter .filter-title{border-bottom:1px solid #c7c7c7;color:#242424;padding:10px 0}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item{border-bottom:1px solid #c7c7c7;padding-bottom:10px}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-title,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-title{padding:10px 40px 0 10px;color:#5e5e5e;cursor:pointer;position:relative}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-title .remove-filter-link,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-title .remove-filter-link{font-weight:400;color:#0031f0;margin-right:10px}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-title .icon,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-title .icon{background-image:url("../images/icon-dropdown.svg")!important;width:10px;height:10px;position:absolute;right:15px;top:14px}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content{padding:10px;display:none}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content ol.items,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content ol.items{padding:0;margin:0;list-style:none none}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item{padding:8px 0;color:#5e5e5e}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item .checkbox,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item .checkbox{margin:0}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item .color-swatch,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item .color-swatch{display:inline-block;margin-right:5px;min-width:20px;height:20px;border:1px solid #c7c7c7;border-radius:3px;float:right}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content .price-range-wrapper,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content .price-range-wrapper{margin-top:21px}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item.active .filter-attributes-content,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item.active .filter-attributes-content{display:block}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item.active .filter-attributes-title .icon,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item.active .filter-attributes-title .icon{background-image:url("../images//arrow-up.svg")!important}.main .category-container .responsive-layred-filter{display:none;width:100%;float:none;padding-right:0;margin-top:-25px!important}.main .category-container .category-block{width:80%;display:block}.main .category-container .category-block .hero-image{display:inline-block;visibility:visible;width:100%}.main .category-container .category-block .hero-image img{max-height:400px;max-width:100%}.main .top-toolbar{width:100%;display:inline-block}.main .top-toolbar .page-info{float:left;color:#242424;line-height:45px}.main .top-toolbar .page-info span{display:none}.main .top-toolbar .page-info span:first-child{display:inline}.main .top-toolbar .pager{float:right}.main .top-toolbar .pager label{margin-right:5px}.main .top-toolbar .pager select{background:#f2f2f2;border:1px solid #c7c7c7;border-radius:3px;color:#242424;padding:10px}.main .top-toolbar .pager .view-mode{display:inline-block;margin-right:20px}.main .top-toolbar .pager .view-mode a,.main .top-toolbar .pager .view-mode span{display:inline-block;vertical-align:middle}.main .top-toolbar .pager .view-mode a.grid-view,.main .top-toolbar .pager .view-mode span.grid-view{margin-right:10px}.main .top-toolbar .pager .view-mode .sort-filter{display:none}.main .top-toolbar .pager .sorter{display:inline-block;margin-right:10px}.main .top-toolbar .pager .limiter{display:inline-block}.main .bottom-toolbar{display:block;margin-top:40px;margin-bottom:40px;text-align:center}@media only screen and (max-width:840px){.main .category-container .responsive-layred-filter,.main .layered-filter-wrapper{display:none}.main .category-block{width:100%!important}.main .category-block .top-toolbar{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.main .category-block .top-toolbar .page-info{border-bottom:1px solid #c7c7c7;line-height:15px;margin-top:10px}.main .category-block .top-toolbar .page-info span{display:inline}.main .category-block .top-toolbar .page-info span:first-child{display:none}.main .category-block .top-toolbar .page-info .sort-filter{float:right;cursor:pointer}.main .category-block .top-toolbar .pager{margin-top:20px;display:none}.main .category-block .top-toolbar .pager .view-mode{display:none}.main .category-block .responsive-layred-filter{display:block}}section.product-detail{color:#242424}section.product-detail div.category-breadcrumbs{display:inline}section.product-detail div.layouter{display:block;margin-top:20px;margin-bottom:20px}section.product-detail div.layouter .form-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;width:100%}section.product-detail div.layouter .form-container div.product-image-group{margin-right:30px;width:604px;height:650px;max-width:604px;position:-webkit-sticky;position:sticky;top:10px}section.product-detail div.layouter .form-container div.product-image-group div{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;cursor:pointer}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin-right:4px;min-width:120px;overflow:hidden;position:relative;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;max-height:480px}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .thumb-frame{border:2px solid transparent;background:#f2f2f2;width:120px;max-height:120px}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .thumb-frame.active{border-color:#0031f0}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .thumb-frame img{height:100%;width:100%}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control{width:100%;position:absolute;text-align:center;cursor:pointer;z-index:1}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control .overlay{opacity:.3;background:#242424;width:100%;height:18px;position:absolute;left:0;z-index:-1}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control .icon{z-index:2}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control.top{top:0}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control.bottom{bottom:0}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image{display:block;position:relative;background:#f2f2f2;width:100%;max-height:480px;height:100%}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image img{width:100%;height:auto;max-height:480px}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image .add-to-wishlist{background-image:url("../images/wishlist.svg");position:absolute;top:10px;right:12px;background-color:transparent;border:0;cursor:pointer;padding:0;width:32px;height:32px}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image .add-to-wishlist:hover{background-image:url("../images/wishlist-added.svg")}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image .add-to-wishlist.already{background-image:url("../images/wishlist-added.svg")!important}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image .share{position:absolute;top:10px;right:45px}section.product-detail div.layouter .form-container div.product-image-group .add-to-buttons{display:none;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;margin-top:10px;width:79.5%;float:right;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}section.product-detail div.layouter .form-container div.product-image-group .add-to-buttons .addtocart{width:49%;background:#000;white-space:normal;text-transform:uppercase}section.product-detail div.layouter .form-container div.product-image-group .add-to-buttons .buynow{width:49%;white-space:nowrap;text-transform:uppercase}section.product-detail div.layouter .form-container .details{width:50%;overflow-wrap:break-word}section.product-detail div.layouter .form-container .details .product-price{margin-bottom:14px}section.product-detail div.layouter .form-container .details .product-price .sticker{display:none}section.product-detail div.layouter .form-container .details .product-ratings{margin-bottom:20px}section.product-detail div.layouter .form-container .details .product-ratings .icon{width:16px;height:16px}section.product-detail div.layouter .form-container .details .product-ratings .total-reviews{display:inline-block;margin-left:15px}section.product-detail div.layouter .form-container .details .product-heading{font-size:24px;color:#242424;margin-bottom:15px}section.product-detail div.layouter .form-container .details .product-price{margin-bottom:15px}section.product-detail div.layouter .form-container .details .product-price .special-price{font-size:24px}section.product-detail div.layouter .form-container .details .stock-status{margin-bottom:15px;font-weight:600;color:#fc6868}section.product-detail div.layouter .form-container .details .stock-status.active{color:#4caf50}section.product-detail div.layouter .form-container .details .description{margin-bottom:15px}section.product-detail div.layouter .form-container .details .description ul{padding-left:40px;list-style:disc}section.product-detail div.layouter .form-container .details .quantity{padding-top:15px;border-top:1px solid hsla(0,0%,64%,.2)}section.product-detail div.layouter .form-container .details .downloadable-container .sample-list{padding:15px 0;border-top:1px solid hsla(0,0%,64%,.2)}section.product-detail div.layouter .form-container .details .downloadable-container .sample-list h3{font-size:16px;margin-top:0}section.product-detail div.layouter .form-container .details .downloadable-container .sample-list ul li{margin-bottom:5px}section.product-detail div.layouter .form-container .details .downloadable-container .sample-list ul li:last-child{margin-bottom:0}section.product-detail div.layouter .form-container .details .downloadable-container .link-list{padding:15px 0;border-top:1px solid hsla(0,0%,64%,.2)}section.product-detail div.layouter .form-container .details .downloadable-container .link-list h3{font-size:16px;margin-top:0}section.product-detail div.layouter .form-container .details .downloadable-container .link-list ul li{margin-bottom:15px}section.product-detail div.layouter .form-container .details .downloadable-container .link-list ul li:last-child{margin-bottom:0}section.product-detail div.layouter .form-container .details .downloadable-container .link-list ul li .checkbox{display:inline-block;margin:0}section.product-detail div.layouter .form-container .details .downloadable-container .link-list ul li a{float:right;margin-top:3px}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list{padding:15px 0;border-top:1px solid hsla(0,0%,64%,.2)}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li{margin-bottom:15px;width:100%;display:inline-block}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li:last-child{margin-bottom:0}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li:first-child span{font-weight:600}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li:first-child span:last-child{float:right;width:50px;text-align:left}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .name{vertical-align:middle;display:inline-block}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .name .product-price{margin-top:5px;margin-bottom:0;font-size:14px}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .name .product-price .special-price{font-size:16px}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .qty{float:right}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .qty .control-group{max-width:none;width:auto;text-align:center;margin-bottom:0;border-top:0;padding-top:0}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .qty .control-group label{display:none}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .qty .control-group .control{height:38px;width:60px;text-align:center;line-height:38px}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list{padding:15px 0;border-top:1px solid hsla(0,0%,64%,.2)}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list h3{font-size:16px;margin:0;color:#242424}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item{border-bottom:1px solid hsla(0,0%,64%,.2);padding:15px 0;width:100%;display:inline-block}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item:last-child{border-bottom:0;padding-bottom:0}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .control-group{margin-bottom:0;color:#5e5e5e}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .control-group label{color:#242424}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .control-group .control{color:#5e5e5e}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .control-group .price{margin-left:15px}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .quantity{border-top:0;padding-bottom:0}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .quantity.has-error button{border-color:#fc6868;color:#fc6868}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .control-error{float:left;width:100%}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item.has-error button{border-color:#fc6868;color:#fc6868}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary{padding:15px 0;border-top:1px solid hsla(0,0%,64%,.2)}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary h3{font-size:16px;margin:0;color:#242424}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary .quantity{border-top:0}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary .bundle-price{font-weight:600;font-size:24px;color:#ff6472;margin-top:10px}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary ul.bundle-items li{margin-bottom:20px}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary ul.bundle-items li:last-child{margin-bottom:0}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary ul.bundle-items li .selected-products{color:#5e5e5e}section.product-detail div.layouter .form-container .details .full-description *{max-width:100%}section.product-detail div.layouter .form-container .details .full-description ul{padding-left:40px;list-style:disc}section.product-detail div.layouter .form-container .details .full-specifications td{padding:10px 0;color:#5e5e5e}section.product-detail div.layouter .form-container .details .full-specifications td:first-child{padding-right:40px}section.product-detail div.layouter .form-container .details .accordian .accordian-header{padding-left:0;font-weight:600}section.product-detail div.layouter .form-container .details .accordian .accordian-content{padding:20px 0}section.product-detail div.layouter .form-container .details .attributes{display:block;width:100%;border-bottom:1px solid hsla(0,0%,64%,.2)}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group{margin-bottom:20px}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container{margin-top:10px;display:inline-block}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch{display:inline-block;margin-right:5px;min-width:40px;height:40px}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch span{min-width:38px;height:38px;float:left;border:1px solid #c7c7c7;border-radius:3px;line-height:36px;text-align:center;cursor:pointer;padding:0 10px}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch img{width:38px;height:38px;border:1px solid #c7c7c7;border-radius:3px;cursor:pointer;background:#f2f2f2}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch input:checked+img,section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch input:checked+span{border:1px solid #242424}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch input{display:none}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .no-options{color:#fb3949}.accordian .accordian-header,.accordian div[slot*=header],accordian .accordian-header,accordian div[slot*=header]{font-size:16px!important}@media only screen and (max-width:720px){section.product-detail div.layouter .form-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}section.product-detail div.layouter .form-container div.product-image-group{margin-right:0;max-width:none;width:auto;min-height:400px;height:auto;position:unset}section.product-detail div.layouter .form-container div.product-image-group .loader{margin-left:47%}section.product-detail div.layouter .form-container div.product-image-group div{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list{margin-top:5px;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;overflow-x:scroll;margin-right:0}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .thumb-frame img{height:100%;width:auto}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control{display:none}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image{display:-webkit-box;display:-ms-flexbox;display:flex}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image img{margin-left:auto;margin-right:auto;width:480px}section.product-detail div.layouter .form-container div.product-image-group div .wrap{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;width:100%!important}section.product-detail div.layouter .form-container div.product-image-group .add-to-buttons{width:100%}section.product-detail div.layouter .form-container .details{width:100%;margin-top:20px}}@media only screen and (max-width:510px){section.product-detail div.layouter .form-container div.product-image-group .product-hero-image img{width:100%!important}}.rating-reviews .rating-header{padding:20px 0}.rating-reviews .stars .icon{width:16px;height:16px}.rating-reviews .overall{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.rating-reviews .overall .review-info .number{font-size:34px}.rating-reviews .overall .review-info .total-reviews{margin-top:10px}.rating-reviews .reviews{margin-top:40px;margin-bottom:40px}.rating-reviews .reviews .review{margin-bottom:25px}.rating-reviews .reviews .review .title{margin-bottom:5px}.rating-reviews .reviews .review .stars{margin-bottom:15px;display:inline-block}.rating-reviews .reviews .review .message{margin-bottom:10px}.rating-reviews .reviews .review .reviewer-details{color:#5e5e5e}.rating-reviews .reviews .view-all{margin-top:15px;color:#0031f0;margin-bottom:15px}section.cart{width:100%;color:#242424;margin-bottom:80px;margin-top:20px}section.cart .title{font-size:24px}section.cart .cart-content{margin-top:20px;width:100%;display:inline-block}section.cart .cart-content .left-side{width:70%;float:left}section.cart .cart-content .left-side .misc-controls{width:100%;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:20px}section.cart .cart-content .left-side .misc-controls a.link,section.cart .cart-content .left-side .misc-controls div button{margin-right:15px}section.cart .cart-content .right-side{width:30%;display:inline-block;padding-left:40px}.cart-item-list .item{padding:10px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;border:1px solid #c7c7c7;border-radius:2px}.cart-item-list .item .item-image{margin-right:15px}.cart-item-list .item .item-image img{height:160px;width:160px}.cart-item-list .item .item-details{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;width:100%}.cart-item-list .item .item-details .item-title{font-size:18px;margin-bottom:10px;font-weight:600}.cart-item-list .item .item-details .item-title a{color:#242424}.cart-item-list .item .item-details .price{margin-bottom:10px;font-size:18px;font-weight:600}.cart-item-list .item .item-details .summary{margin-bottom:17px}.cart-item-list .item .item-details .misc{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;margin-top:10px}.cart-item-list .item .item-details .misc .control-group{font-size:16px!important;margin:0;width:auto}.cart-item-list .item .item-details .misc .control-group .wrap{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.cart-item-list .item .item-details .misc .control-group label{margin-right:15px}.cart-item-list .item .item-details .misc .control-group .control{height:38px;width:60px;text-align:center;line-height:38px}.cart-item-list .item .item-details .misc .remove,.cart-item-list .item .item-details .misc .towishlist{line-height:35px;margin-left:15px}.cart-item-list .item .error-message{color:#ff6472}.quantity{display:inline-block!important}.quantity label{margin-bottom:10px}.quantity button{width:40px;height:38px;font-size:16px;background:#fff;border:1px solid #c7c7c7;float:left;cursor:pointer}.quantity button.decrease{border-radius:3px 0 0 3px}.quantity button.increase{border-radius:0 3px 3px 0}.quantity.control-group .control{text-align:center;float:left;width:60px;height:38px;margin:0;border:1px solid #c7c7c7;border-right:none;border-left:none;border-radius:0}.quantity.control-group .control:focus{border-color:#c7c7c7}.order-summary h3{font-size:16px;margin-top:0}.order-summary .item-detail{margin-top:12px}.order-summary .item-detail label.right{float:right}.order-summary .payable-amount{margin-top:17px;border-top:1px solid #c7c7c7;padding-top:12px}.order-summary .payable-amount label{font-weight:700}.order-summary .payable-amount label.right{float:right}@media only screen and (max-width:815px){section.cart .cart-content{display:block}section.cart .cart-content .left-side{width:100%;float:none}section.cart .cart-content .left-side .misc-controls{position:relative;top:180px;margin-top:0}section.cart .cart-content .right-side{width:100%;padding-left:0;position:relative;top:-20px}}@media only screen and (max-width:600px){section.cart .cart-content .left-side .cart-item-list .item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}section.cart .cart-content .left-side .cart-item-list .item .item-details{margin-top:10px}section.cart .cart-content .left-side .cart-item-list .item .item-details .misc{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;line-height:40px}}@media only screen and (max-width:574px){section.cart .cart-content .left-side .misc-controls{display:block;top:160px}section.cart .cart-content .left-side .misc-controls div button{width:100%;margin-top:10px}section.cart .cart-content .left-side .misc-controls div a{margin-top:10px;width:100%;text-align:center}section.cart .cart-content .right-side{top:-100px}}.checkout-method-group .line-one{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.checkout-method-group .line-one .radio-container{padding-left:28px}.checkout-method-group .line-one .method-label{margin-top:4px}.checkout-method-group .line-two{margin-left:30px}.checkout-process{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;width:100%;margin-top:20px;margin-bottom:20px;font-size:16px;color:#242424}.checkout-process .col-main{width:70%;margin-right:5%}.checkout-process .col-main ul.checkout-steps{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;width:100%;padding-bottom:15px;border-bottom:1px solid #c7c7c7}.checkout-process .col-main ul.checkout-steps li{height:48px;display:-webkit-box;display:-ms-flexbox;display:flex}.checkout-process .col-main ul.checkout-steps li .decorator{height:48px;width:48px;border:1px solid #000;border-radius:50%;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;border:1px solid #c7c7c7;background-repeat:no-repeat;background-position:50%}.checkout-process .col-main ul.checkout-steps li .decorator.address-info{background-image:url("../images/address.svg")}.checkout-process .col-main ul.checkout-steps li .decorator.shipping{background-image:url("../images/shipping.svg")}.checkout-process .col-main ul.checkout-steps li .decorator.payment{background-image:url("../images/payment.svg")}.checkout-process .col-main ul.checkout-steps li .decorator.review{background-image:url("../images/finish.svg")}.checkout-process .col-main ul.checkout-steps li.completed{cursor:pointer}.checkout-process .col-main ul.checkout-steps li.completed .decorator{background-image:url("../images/complete.svg")}.checkout-process .col-main ul.checkout-steps li span{margin-left:7px;margin-top:auto;margin-bottom:auto}.checkout-process .col-main ul.checkout-steps li.active{color:#2650ef}.checkout-process .col-main ul.checkout-steps li.active .decorator{border:1px solid #2650ef}.checkout-process .col-main .step-content{padding-top:20px}.checkout-process .col-main .step-content .form-header{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;width:100%;height:30px}.checkout-process .col-main .step-content .form-header .checkout-step-heading{font-size:24px;font-weight:700;float:left}.checkout-process .col-main .step-content .form-header .btn{float:right;font-size:14px}.checkout-process .col-main .step-content .form-container{border-bottom:1px solid #c7c7c7;padding-top:20px;padding-bottom:20px}.checkout-process .col-main .step-content .shipping-methods{font-size:16px}.checkout-process .col-main .step-content .shipping-methods .ship-method-carrier{margin-bottom:15px;font-weight:700}.checkout-process .col-main .step-content .payment-methods .radio-container{padding-left:28px}.checkout-process .col-main .step-content .payment-methods .control-info{margin-left:28px}.checkout-process .col-main .step-content .address-summary{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%}.checkout-process .col-main .step-content .address-summary div.billing-address{margin-right:25%}.checkout-process .col-main .step-content .address-summary div.billing-address .horizontal-rule,.checkout-process .col-main .step-content .address-summary div.shipping-address .horizontal-rule{width:40px;background:#242424}.checkout-process .col-main .step-content .address-summary .label{width:10%}.checkout-process .col-main .step-content .address-summary .address-card-list{width:85%}.checkout-process .col-main .step-content .cart-item-list .item .row .title{width:100px;display:inline-block;color:#a5a5a5;font-weight:500;margin-bottom:10px}.checkout-process .col-main .step-content .cart-item-list .item .row .value{font-size:18px;font-weight:600}.checkout-process .col-main .step-content .order-description{display:inline-block;width:100%}.checkout-process .col-main .step-content .order-description .shipping{margin-bottom:25px}.checkout-process .col-main .step-content .order-description .decorator{height:48px;width:48px;border-radius:50%;border:1px solid #c7c7c7;vertical-align:middle;display:inline-block;text-align:center}.checkout-process .col-main .step-content .order-description .decorator .icon{margin-top:7px}.checkout-process .col-main .step-content .order-description .text{font-weight:600;vertical-align:middle;display:inline-block}.checkout-process .col-main .step-content .order-description .text .info{font-weight:500;margin-top:2px}.checkout-process .col-right{width:25%;padding-left:40px}@media only screen and (max-width:770px){.checkout-process .col-main{width:100%;padding-right:0}.checkout-process .col-main ul.checkout-steps{border-bottom:none;padding-bottom:0}.checkout-process .col-main ul.checkout-steps span{display:none}.checkout-process .col-main ul.checkout-steps .line{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;border-bottom:1px solid #c7c7c7;margin-left:5px;margin-right:5px}.checkout-process .step-content{padding-top:0}.checkout-process .step-content .control-group .control{width:100%}.checkout-process .col-right{display:none}}@media only screen and (max-width:480px){.checkout-process .col-main .step-content .address,.checkout-process .col-main .step-content .order-description{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.checkout-process .col-main .step-content .address .billing-address,.checkout-process .col-main .step-content .address .pull-left,.checkout-process .col-main .step-content .order-description .billing-address,.checkout-process .col-main .step-content .order-description .pull-left{width:100%!important}.checkout-process .col-main .step-content .address .pull-right,.checkout-process .col-main .step-content .address .shipping-address,.checkout-process .col-main .step-content .order-description .pull-right,.checkout-process .col-main .step-content .order-description .shipping-address{width:100%!important;margin-top:20px}}.attached-products-wrapper{margin-bottom:80px}.attached-products-wrapper .title{margin-bottom:40px;font-size:18px;color:#242424;text-align:center;position:relative}.attached-products-wrapper .title .border-bottom{border-bottom:1px solid hsla(0,0%,64%,.2);display:inline-block;width:100px;position:absolute;top:40px;left:50%;margin-left:-50px}.attached-products-wrapper .horizontal-rule{height:1px;background:#c7c7c7;width:148px;margin-bottom:24px;margin-left:auto;margin-right:auto}section.review .category-breadcrumbs{display:inline}section.review .review-layouter{display:-webkit-box;display:-ms-flexbox;display:flex}section.review .review-layouter .product-info{font-size:24px;max-width:25%}section.review .review-layouter .product-info .product-image img{height:280px;width:280px}section.review .review-layouter .product-info .product-name a{color:#242424}section.review .review-layouter .product-info .product-price{margin-top:10px}section.review .review-layouter .product-info .product-price .pro-price{color:#ff6472}section.review .review-layouter .product-info .product-price .pro-price-not{margin-left:10px;font-size:16px;color:#a5a5a5}section.review .review-layouter .product-info .product-price .offer{margin-left:10px;font-size:16px}section.review .review-layouter .review-form{margin-left:20px;width:55%}section.review .review-layouter .review-form .heading{color:#242424;font-weight:600}section.review .review-layouter .review-form .heading .right{float:right;margin-top:-10px}section.review .review-layouter .review-form .star{font-size:23px;color:#d4d4d4;-webkit-transition:all .2s;transition:all .2s}section.review .review-layouter .review-form .star:before{content:"\2605"}section.review .review-layouter .review-form .control-group .control{width:100%}section.review .review-layouter .review-form .review-detail{height:150px;border:1px solid #b22222;margin-top:30px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}section.review .review-layouter .review-form .review-detail .rating-review{margin-top:40px;margin-left:20px;width:48%}section.review .review-layouter .review-form .review-detail .rating-review .avg-rating-count span{font-size:34px;text-align:center}section.review .review-layouter .review-form .review-detail .rating-calculate .progress-only{width:20px;border:1px solid blue}section.review .review-layouter .ratings-reviews{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}section.review .review-layouter .ratings-reviews .left-side{padding:40px 20px;width:50%}section.review .review-layouter .ratings-reviews .left-side .rate{font-size:34px}section.review .review-layouter .ratings-reviews .left-side .stars .icon{height:16px;width:16px}section.review .review-layouter .ratings-reviews .right-side{width:50%}section.review .review-layouter .ratings-reviews .right-side .rater{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-top:5px;width:100%}section.review .review-layouter .ratings-reviews .right-side .rater .star-name{margin-right:5px;width:35px}section.review .review-layouter .ratings-reviews .right-side .rater .rate-number{width:15px}section.review .review-layouter .ratings-reviews .right-side .rater .percentage{width:50px;margin-right:10px}section.review .review-layouter .ratings-reviews .right-side .rater .percentage span{float:right;white-space:nowrap}section.review .review-layouter .ratings-reviews .right-side .rater .line-bar{height:4px;width:calc(100% - 100px);margin-right:5px;margin-left:5px;background:#d8d8d8}section.review .review-layouter .ratings-reviews .right-side .rater .line-bar .line-value{background-color:#0031f0}@media only screen and (max-width:770px){section.review .category-breadcrumbs{display:none}section.review .review-layouter{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}section.review .review-layouter .product-info{max-width:100%}section.review .review-layouter .product-info .product-image,section.review .review-layouter .product-info .product-name,section.review .review-layouter .product-info .product-price{max-width:280px;margin-left:auto;margin-right:auto}section.review .review-layouter .review-form{width:100%;margin-left:0}section.review .review-layouter .review-form .heading .right{margin-top:50px}section.review .review-layouter .review-form .ratings-reviews{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:100%}section.review .review-layouter .review-form .ratings-reviews .left-side{width:100%;padding:0 0 40px;margin-top:-30px}section.review .review-layouter .review-form .ratings-reviews .right-side{width:100%}section.review .review-layouter .review-form .ratings-reviews .right-side .rater .percentage{margin-right:0}}.auth-content{padding-top:5%;padding-bottom:5%}.auth-content .sign-up-text{margin-bottom:2%;margin-left:auto;margin-right:auto;font-size:18px;color:#a5a5a5;text-align:center}.auth-content .login-form{margin-left:auto;margin-right:auto;display:-webkit-box;display:-ms-flexbox;display:flex;border:1px solid #c7c7c7;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;max-width:500px;min-width:320px;padding:25px}.auth-content .login-form .login-text{font-size:24px;font-weight:600;margin-bottom:30px}.auth-content .login-form .control-group{margin-bottom:15px!important}.auth-content .login-form .control-group .control{width:100%!important}.auth-content .login-form .forgot-password-link{font-size:17px;color:#0031f0;margin-bottom:5%}.auth-content .login-form .signup-confirm{margin-bottom:5%}.auth-content .login-form .btn-primary{width:100%;text-transform:uppercase}.account-content{width:100%;-webkit-box-orient:horizontal;-ms-flex-direction:row;flex-direction:row;margin-top:5.5%;margin-bottom:5.5%}.account-content,.account-content .sidebar{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-direction:normal}.account-content .sidebar{-webkit-box-orient:vertical;-ms-flex-direction:column;flex-direction:column;-ms-flex-line-pack:center;align-content:center;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;width:20%;height:100%}.account-content .menu-block{margin-bottom:30px}.account-content .menu-block:last-child{margin-bottom:0}.account-content .menu-block .menu-block-title{padding-bottom:10px;font-size:18px}.account-content .menu-block .menu-block-title .right{display:none}.account-content .menu-block .menubar{border:1px solid #c7c7c7;color:#a5a5a5;position:relative}.account-content .menu-block .menubar li{width:95%;height:50px;margin-left:5%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #c7c7c7;text-align:center}.account-content .menu-block .menubar li a{color:#5e5e5e;width:100%;text-align:left}.account-content .menu-block .menubar li .icon{display:none;position:absolute;right:12px}.account-content .menu-block .menubar li:first-child{border-top:none}.account-content .menu-block .menubar li:last-child{border-bottom:none}.account-content .menu-block .menubar li.active a{color:#0031f0}.account-content .menu-block .menubar li.active .icon{display:inline-block}.account-content .account-layout{margin-left:40px;width:80%}.account-content .account-layout .account-head .back-icon,.account-content .account-layout .responsive-empty{display:none}.account-table-content{color:#242424;margin-top:1.4%}.account-table-content table{width:100%}.account-table-content table tbody tr{height:45px}.account-table-content table tbody tr td{width:250px}.address-holder{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-ms-flex-wrap:wrap;flex-wrap:wrap;width:100%}.address-card{width:260px;border:1px solid #c7c7c7;padding:15px;margin-right:15px;margin-bottom:15px}.address-card .control-group{width:15px;height:15px;margin-top:10px}.address-card .details{font-weight:lighter}.address-card .details span{display:block}.address-card .details .control-links{width:90%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.address-card .details .control-links .btn{height:30px}.edit-form{display:-webkit-box;display:-ms-flexbox;display:flex;border:1px solid #c7c7c7;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;min-height:345px;padding:25px}@media only screen and (max-width:770px){.account-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.account-content .sidebar{width:100%}.account-content .sidebar .menu-block .menu-block-title{height:50px;padding-top:13px;border-bottom:1px solid #c7c7c7;border-top:1px solid #c7c7c7}.account-content .sidebar .menu-block .menu-block-title .right{display:block;float:right;-ms-flex-item-align:center;align-self:center}.account-content .sidebar .menu-block .menubar{border:0;display:none}.account-content .sidebar .menu-block .menubar>li{margin-left:0;width:100%}.account-content .sidebar .menu-block .menubar>li .icon{right:0}.account-content .sidebar .menu-block .menubar>li:last-child{border-bottom:1px solid #c7c7c7}.account-content .account-layout{margin-left:0;margin-top:20px;width:100%}.account-content .account-layout .account-head{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;border-bottom:1px solid #c7c7c7;border-top:1px solid #c7c7c7;height:50px;margin-top:10px}.account-content .account-layout .account-head .account-action{margin-top:12px;margin-left:15px}.account-content .account-layout .account-head .back-icon{display:block}.account-content .account-layout .account-head span{margin-top:13px;font-size:18px}.account-content .account-layout .account-head .horizontal-rule{display:none}.account-content .account-layout .account-table-content{margin-top:2%}.account-content .account-layout .account-table-content table tbody tr{height:70px}.account-content .account-layout .account-table-content table tbody tr td{display:block}.account-content .account-layout .account-table-content .address-holder{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.account-content .account-items-list,.account-content .edit-form{margin-top:20px}.account-content .account-items-list .responsive-empty,.account-content .edit-form .responsive-empty{display:block}.account-content .control-group .control{width:100%}}.sale-container{color:#5e5e5e}.sale-container .sale-section .secton-title{font-size:18px;color:#8e8e8e;padding:15px 0;border-bottom:1px solid #c7c7c7}.sale-container .sale-section .section-content{display:block;padding:20px 0;border-bottom:1px solid #e8e8e8}.sale-container .sale-section .section-content .row{display:block;padding:7px 0}.sale-container .sale-section .section-content .row .title{width:200px;letter-spacing:-.26px;display:inline-block}.sale-container .sale-section .section-content .row .value{letter-spacing:-.26px;display:inline-block}.sale-container .sale-section .section-content .order-box-container{display:inline-block;width:100%}.sale-container .sale-section .section-content .order-box-container .box{float:left;width:25%}.sale-container .sale-section .section-content .order-box-container .box .box-title{padding:10px 0;font-size:18px;color:#8e8e8e}.sale-container .sale-section .section-content .order-box-container .box .box-content{color:#3a3a3a;padding-right:10px}.sale-container .sale-section .section-content .qty-row{display:block}.sale-container .totals{padding-top:20px;display:inline-block;width:100%;border-top:1px solid #e8e8e8}.sale-container .totals .sale-summary{height:130px;float:right;border-collapse:collapse}.sale-container .totals .sale-summary tr td{padding:5px 8px;width:auto;color:#3a3a3a}.sale-container .totals .sale-summary tr.bold{font-weight:600;font-size:15px}.sale-container .totals .sale-summary tr.border td{border-bottom:1px solid #c7c7c7}@media only screen and (max-width:770px){.sale-container .sale-section .section-content{border-bottom:none;padding:10px 0}.sale-container .sale-section .section-content .row{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.sale-container .sale-section .section-content .row .title{line-height:20px}.sale-container .sale-section .section-content .totals{border-top:none}.sale-container .sale-section .section-content .totals .sale-summary{width:100%}.sale-container .sale-section .section-content .totals .sale-summary tr td:nth-child(2){display:none}.sale-container .sale-section .section-content .order-box-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.sale-container .sale-section .section-content .order-box-container .box{width:100%;margin:10px auto}.sale-container .sale-section .section-content .qty-row{display:inline}}.verify-account{text-align:center;background:#204d74;width:200px;margin-right:auto;margin-left:auto;border-radius:4px}.verify-account a{color:#fff!important}.cp-spinner{position:absolute;left:calc(50% - 24px);margin-top:calc(40% - 24px)}@media only screen and (max-width:720px){.cp-spinner{left:50%;margin-left:-24px;top:50%;margin-top:-24px}}@media only screen and (max-width:720px){.error-container .wrapper{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important;margin:10px 0 20px!important;-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:start!important;height:100%!important}}@media only screen and (max-width:770px){.table table{width:100%}.table table thead{display:none}.table table tbody tr td:before{content:attr(data-value);font-size:15px;font-weight:600;display:inline-block;width:120px}.table table tbody td{border-bottom:none!important;display:block;width:100%!important}.table table tbody td div{position:relative;left:100px;top:-20px}.table table tbody tr{border:1px solid #c7c7c7}}.show-wishlist{z-index:-1!important}.filter-row-one .dropdown-filters{position:relative!important;right:1px!important}@media only screen and (max-width:770px){.table .grid-container{margin-top:10px;overflow-x:hidden}.table .grid-container .filter-row-one{display:block}.table .grid-container .filter-row-one .dropdown-filters{margin-top:10px}}.rtl{direction:rtl}.rtl .header .header-top div.left-content ul.logo-container{margin-right:0;margin-left:12px}.rtl .header .header-top div.left-content ul.search-container li.search-group .search-field{border:2px solid #c7c7c7;padding-right:12px;padding-left:0;border-radius:2px;border-top-left-radius:0;border-bottom-left-radius:0}.rtl .header .header-top div.left-content ul.search-container li.search-group .search-icon-wrapper{border:2px solid #c7c7c7;border-right:none;border-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0}.rtl .header .header-top div.right-content .right-content-menu>li{border-right:2px solid #c7c7c7;padding:0 15px}.rtl .header .header-top div.right-content .right-content-menu>li:last-child{padding-left:0}.rtl .header .header-top div.right-content .right-content-menu>li:first-child{border-right:0;padding-right:0}.rtl .header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list{left:0;right:unset!important}.rtl .header .header-top div.right-content .right-content-menu .cart-dropdown-container .count{display:inline-block}.rtl .header .header-top div.right-content .right-content-menu .account,.rtl .header .header-top div.right-content .right-content-menu .currency{right:unset;left:0}.rtl .header .header-top div.right-content .right-content-menu .guest div{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.rtl .header .header-bottom .nav>li{float:right;margin-right:0;margin-left:1px}.rtl .header .header-bottom .nav a{padding:.8em .5em .8em .3em!important}.rtl .header .header-bottom .nav li a>.icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rtl .header .header-bottom .nav>li li:hover>ul{left:unset!important;right:100%!important}.rtl .header .header-bottom .nav ul{left:99999em}.rtl .header .search-responsive .search-content .right{float:left}.rtl .dropdown-list{text-align:right}.rtl .dropdown-list.bottom-right{left:0;right:auto}@media only screen and (max-width:720px){.rtl .header .header-top div.right-content .menu-box{margin-left:0;margin-right:5px}.rtl .header .header-top div.right-content .right-content-menu .account{position:absolute;left:0;right:auto}.rtl .header .header-top div.right-content .right-content-menu>li{padding:0;border:0}.rtl .header .header-top div.right-content .search-box{margin-left:5px}.rtl .header .header-bottom .nav>li{float:none}.rtl .header .header-bottom .nav li>.icon{float:left;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rtl .header .header-bottom .icon.icon-arrow-down{margin-left:5px}}.rtl section.slider-block div.slider-content div.slider-control{left:2%;right:auto}.rtl section.slider-block div.slider-content div.slider-control .slider-left{float:left}.rtl section.slider-block div.slider-content div.slider-control .slider-right{margin-left:5px}@media only screen and (max-width:720px){.rtl section.slider-block div.slider-content div.slider-control{left:0}}.rtl .main-container-wrapper .product-card .sticker{left:auto;right:20px}.rtl .main-container-wrapper .product-card .cart-wish-wrap .addtocart{margin-right:0;margin-left:10px}.rtl section.product-detail div.layouter .form-container div.product-image-group{margin-right:0;margin-left:30px}.rtl section.product-detail div.layouter .form-container div.product-image-group .add-to-buttons{float:left!important}.rtl section.product-detail div.layouter .form-container div .thumb-list{margin-left:4px;margin-right:0}.rtl section.product-detail div.layouter .form-container .details .accordian .accordian-header{padding:20px 0 20px 15px}.rtl section.product-detail div.layouter .form-container .details .accordian .accordian-header .icon{float:left}.rtl section.product-detail div.layouter .form-container .details .accordian .accordian-header .expand-icon{margin-left:10px}.rtl section.product-detail div.layouter .form-container .details .full-specifications td:first-child{padding-right:0;padding-left:40px}.rtl section.product-detail div.layouter .form-container .details .product-ratings .total-reviews{margin-left:0;margin-right:15px}@media only screen and (max-width:720px){.rtl section.product-detail div.layouter .form-container div.product-image-group{margin-right:0;margin-left:0}}.rtl .main .category-container .layered-filter-wrapper,.rtl .main .category-container .responsive-layred-filter{padding-right:0;padding-left:20px}.rtl .main .top-toolbar .pager{float:left}.rtl .main .top-toolbar .pager .view-mode{margin-right:0;margin-left:20px}.rtl .main .top-toolbar .pager .sorter{margin-right:0;margin-left:10px}.rtl .main .top-toolbar .pager label{margin-right:0;margin-left:5px}.rtl .main .top-toolbar .page-info{float:right}.rtl section.review .review-layouter .review-form{margin-left:0;margin-right:20px}.rtl section.review .review-layouter .review-form .heading .right{float:left}.rtl section.review .review-layouter .review-form .ratings-reviews .right-side .rater .star-name{margin-right:0;margin-left:5px}@media only screen and (max-width:770px){.rtl section.review .review-layouter .review-form{margin-right:0}}.rtl section.cart .cart-content .left-side{width:70%;float:right}.rtl section.cart .cart-content .left-side .misc-controls a.link{margin-left:15px;margin-right:0}.rtl section.cart .cart-content .right-side{width:30%;padding-right:40px;padding-left:0}.rtl .order-summary .item-detail label.right,.rtl .payable-amount label.right{float:left}.rtl .item div{margin-left:15px;margin-right:0!important}.rtl .cart-item-list .item .item-details .misc div.qty-text{margin-right:0;margin-left:10px}.rtl .cart-item-list .item .item-details .misc .remove,.rtl .cart-item-list .item .item-details .misc input.box{margin-right:0;margin-left:30px}.rtl .cart-item-list .item .item-details .misc .control-group label{margin-left:15px;margin-right:0}@media only screen and (max-width:770px){.rtl section.cart .cart-content .left-side{width:100%;float:none}.rtl section.cart .cart-content .left-side .misc-controls div button{margin-right:0}.rtl section.cart .cart-content .right-side{width:100%;padding-right:0}}.rtl .checkout-process .col-right{padding-left:0;padding-right:40px}.rtl .checkout-process .col-main{padding-left:40px;padding-right:0}.rtl .checkout-process .col-main ul.checkout-steps li span{margin-right:7px;margin-left:0}.rtl .checkout-process .col-main .step-content .form-header h1{float:right}.rtl .checkout-process .col-main .step-content .form-header .btn{float:left}.rtl .checkout-process .col-main .step-content .payment-methods .control-info{margin-right:28px;margin-left:0}.rtl .checkout-process .col-main .step-content .address .billing-address,.rtl .checkout-process .col-main .step-content .address .pull-left,.rtl .checkout-process .col-main .step-content .order-description .billing-address,.rtl .checkout-process .col-main .step-content .order-description .pull-left{float:right!important}.rtl .checkout-process .col-main .step-content .address .pull-right,.rtl .checkout-process .col-main .step-content .address .shipping-address,.rtl .checkout-process .col-main .step-content .order-description .pull-right,.rtl .checkout-process .col-main .step-content .order-description .shipping-address{float:left!important}.rtl .checkbox,.rtl .radio{margin:10px 0 5px 5px}.rtl .radio .radio-view{margin-left:5px;margin-right:0}.rtl .radio input{right:0;left:auto}@media only screen and (max-width:770px){.rtl .checkout-process .col-main{padding-left:0}}.rtl .account-content .account-layout{margin-left:0;margin-right:40px}.rtl .account-content .menu-block .menubar li{margin-left:0;margin-right:5%}.rtl .account-content .menu-block .menubar li a{text-align:right}.rtl .account-content .menu-block .menubar li .icon{right:unset;left:12px;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rtl .account-head .account-action{float:left}.rtl .account-item-card .media-info .info{margin-right:20px;margin-left:0}.rtl .account-item-card .operations a span{float:left}.rtl .table table{text-align:right}.rtl .sale-container .totals .sale-summary{float:left}.rtl .sale-container .sale-section .section-content .order-box-container{display:-webkit-box;display:-ms-flexbox;display:flex}@media (max-width:770px){.rtl .account-content .account-layout{margin-right:0}.rtl .account-content .account-layout .account-head .account-action{margin-left:0}.rtl .account-content .sidebar .menu-block .menu-block-title .right{float:left}.rtl .account-content .sidebar .menu-block .menubar>li{margin-right:0}}.rtl .footer .footer-content .footer-list-container .list-container .list-group li span.icon{margin-left:5px;margin-right:0}@media (max-width:720px){.rtl .footer{padding-right:15px;padding-left:10%}.rtl .footer .footer-list-container{padding-right:0!important}}.rtl .cp-spinner{position:absolute;right:calc(50% - 24px);margin-top:calc(40% - 24px)}@media only screen and (max-width:720px){.rtl .cp-spinner{right:50%;margin-right:-24px;left:auto}}.rtl .product-list .product-card .product-information{padding-left:0;padding-right:30px;float:left}.rtl .zoom-image-direction{left:0;right:476px!important}.banner-container{width:100%;float:left;padding:0 18px;margin-bottom:40px}.banner-container .left-banner{padding-right:20px;width:60%;float:left}.banner-container .left-banner img{width:100%}.banner-container .right-banner{padding-left:20px;width:40%;float:left}.banner-container .right-banner img{max-width:100%}.banner-container .right-banner img:first-child{padding-bottom:20px;display:block}.banner-container .right-banner img:last-child{padding-top:20px;display:block}@media (max-width:720px){.banner-container .left-banner{padding-right:0;width:100%}.banner-container .right-banner{padding-left:0;width:100%}.banner-container .right-banner img:first-child{padding-bottom:0;padding-top:25px}.banner-container .right-banner img:last-child{padding-top:25px}}.static-container{display:block;width:100%;padding:10px;margin-left:auto;margin-right:auto}.static-container.one-column{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.static-container.two-column{display:grid;grid-template-columns:48% 48%;grid-column-gap:4%}.static-container.three-column{display:grid;grid-template-columns:30% 30% 30%;grid-column-gap:4%}.item-options{font-size:14px;font-weight:200}.item-options b{font-weight:500} \ No newline at end of file +@import url(https://fonts.googleapis.com/css?family=Montserrat:400,500);.icon{display:inline-block;background-size:cover}.dropdown-right-icon{background-image:URL(../images/icon-dropdown-left.svg);width:8px;height:8px;margin-left:auto;margin-bottom:2px}.icon-menu-close{background-image:URL(../images/icon-menu-close.svg);width:24px;height:24px;margin-left:auto}.icon-menu-close-adj{background-image:URL(../images/cross-icon-adj.svg);margin-left:auto}.grid-view-icon{background-image:URL(../images/icon-grid-view.svg);width:24px;height:24px}.list-view-icon{background-image:URL(../images/icon-list-view.svg);width:24px;height:24px}.sort-icon{background-image:URL(../images/icon-sort.svg);width:32px;height:32px}.filter-icon{background-image:URL(../images/icon-filter.svg);width:32px;height:32px}.whishlist-icon{background-image:URL(../images/wishlist.svg);width:24px;height:24px}.share-icon{background-image:URL(../images/icon-share.svg);width:24px;height:24px}.icon-menu{background-image:URL(../images/icon-menu.svg);width:24px;height:24px}.icon-search{background-image:URL(../images/icon-search.svg);width:24px;height:24px}.icon-menu-back{background-image:URL(../images/icon-menu-back.svg);width:24px;height:24px}.shipping-icon{background-image:url(../images/shipping.svg);width:32px;height:32px}.payment-icon{background-image:url(../images/payment.svg);width:32px;height:32px}.cart-icon{background-image:url(../images/icon-cart.svg);width:24px;height:24px}.wishlist-icon{background-image:url(../images/wishlist.svg);width:32px;height:32px}.icon-arrow-up{background-image:url(../images/arrow-up.svg);width:16px;height:16px}.icon-arrow-down{background-image:url(../images/arrow-down.svg);width:16px;height:16px}.expand-icon{background-image:url(../images/Expand-Light.svg);width:18px;height:18px}.expand-on-icon{background-image:url(../images/Expand-Light-On.svg);width:18px;height:18px}.icon-menu-close-adj{background-image:url(../images/cross-icon-adj.svg);width:32px;height:32px}.icon-facebook{background-image:url(../images/facebook.svg)}.icon-twitter{background-image:url(../images/twitter.svg)}.icon-google-plus{background-image:url(../images/google-plus.svg)}.icon-instagram{background-image:url(../images/instagram.svg)}.icon-linkedin{background-image:url(../images/linkedin.svg)}.icon-dropdown{background-image:url(../images/icon-dropdown.svg)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}body{margin:0;padding:0;font-weight:500;max-width:100%;width:auto;color:#242424;font-size:16px}*{font-family:Montserrat,sans-serif}::-webkit-input-placeholder{font-family:Montserrat,sans-serif}::-moz-input-placeholder{font-family:Montserrat,sans-serif}textarea{resize:none}input{font-family:Montserrat,sans-serif}.btn{border-radius:0!important}.pagination.shop{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}@media only screen and (max-width:770px){.pagination.shop{-webkit-box-pack:justify;justify-content:space-between}.pagination.shop .page-item{display:none}.pagination.shop .page-item.next,.pagination.shop .page-item.previous{display:block}}.bold{font-weight:700;color:#3a3a3a}.radio-container{display:block;position:relative;padding-left:35px;margin-bottom:12px;cursor:pointer;font-size:16px;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.radio-container input{position:absolute;opacity:0;cursor:pointer;top:0;left:0}.radio-container .checkmark{position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border:2px solid #ff6472;border-radius:50%}.radio-container .checkmark:after{content:"";position:absolute;display:none;top:2px;left:2px;width:8px;height:8px;border-radius:50%;background:#ff6472}.radio-container input:checked~.checkmark:after{display:block}.radio-container input:disabled~.checkmark{display:block;border:2px solid rgba(255,100,113,.4)}.cp-spinner{width:48px;height:48px;display:inline-block;box-sizing:border-box}.cp-round:before{border-radius:50%;border:6px solid #bababa}.cp-round:after,.cp-round:before{content:" ";width:48px;height:48px;display:inline-block;box-sizing:border-box;position:absolute;top:0;left:0}.cp-round:after{border-radius:50%;border:6px solid transparent;border-top-color:#0031f0;-webkit-animation:spin 1s ease-in-out infinite;animation:spin 1s ease-in-out infinite}.radio{margin:10px 0 0!important}.checkbox{margin:10px 0 0}.checkbox .checkbox-view{height:16px!important;width:16px!important;background-image:url(../images/checkbox.svg)!important}.checkbox input:checked+.checkbox-view{background-image:url(../images/checkbox-checked.svg)!important}.pull-right{float:right}.add-to-wishlist .wishlist-icon:hover{background-image:url(../images/wishlist-added.svg)}.add-to-wishlist.already{pointer-events:none}.add-to-wishlist.already .wishlist-icon{background-image:url(../images/wishlist-added.svg)!important}.product-price{margin-bottom:14px;width:100%;font-weight:600;word-break:break-all}.product-price .price-label{font-size:14px;font-weight:400;margin-right:5px}.product-price .regular-price{color:#a5a5a5;text-decoration:line-through;margin-right:10px}.product-price .special-price{color:#ff6472}.horizontal-rule{display:block;width:100%;height:1px;background:#c7c7c7}.account-head .account-heading{font-size:28px;color:#242424;text-transform:capitalize;text-align:left}.account-head .account-action{font-size:17px;margin-top:1%;color:#0031f0;float:right}.account-head .horizontal-rule{margin-top:1.1%;width:100%;height:1px;vertical-align:middle;background:#c7c7c7}.account-item-card{-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center;width:100%;height:125px}.account-item-card,.account-item-card .media-info{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.account-item-card .media-info .media{height:125px;width:110px}.account-item-card .media-info .info{margin-left:20px;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:space-evenly;justify-content:space-evenly}.account-item-card .media-info .info .stars .icon{height:16px;width:16px}.account-item-card .operations{height:120px;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center}.account-item-card .operations a{width:100%}.account-item-card .operations a span{float:right}.account-items-list{display:block;width:100%}.account-items-list .grid-container{margin-top:40px}.search-result-status{width:100%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.grid-container{margin-top:20px}.main-container-wrapper{max-width:1300px;width:auto;padding-left:15px;padding-right:15px;margin-left:auto;margin-right:auto}.main-container-wrapper .content-container{display:block;margin-bottom:40px}.main-container-wrapper .product-grid-4{grid-auto-rows:auto;grid-column-gap:30px;grid-row-gap:15px}.main-container-wrapper .product-grid-3,.main-container-wrapper .product-grid-4{display:grid;grid-template-columns:repeat(auto-fill,minmax(235px,1fr));justify-items:center}.main-container-wrapper .product-grid-3{grid-gap:27px;grid-auto-rows:auto}.main-container-wrapper .product-card{position:relative;padding:15px}.main-container-wrapper .product-card .product-image{max-height:350px;max-width:280px;margin-bottom:10px;background:#f2f2f2}.main-container-wrapper .product-card .product-image img{display:block;height:100%}.main-container-wrapper .product-card .product-name{margin-bottom:14px;width:100%;color:#242424}.main-container-wrapper .product-card .product-name a{color:#242424}.main-container-wrapper .product-card .product-description{display:none}.main-container-wrapper .product-card .product-ratings{width:100%}.main-container-wrapper .product-card .product-ratings .icon{width:16px;height:16px}.main-container-wrapper .product-card .cart-wish-wrap{display:-webkit-inline-box;display:inline-flex;-webkit-box-pack:start;justify-content:flex-start;-webkit-box-align:center;align-items:center;height:40px}.main-container-wrapper .product-card .cart-wish-wrap .addtocart{margin-right:10px;text-transform:uppercase;text-align:left;box-shadow:1px 1px 0 #ccc}.main-container-wrapper .product-card .cart-wish-wrap .add-to-wishlist{margin-top:5px;background:transparent;border:0;cursor:pointer;padding:0}.main-container-wrapper .product-card .sticker{border-bottom-right-radius:15px;position:absolute;top:15px;left:15px;text-transform:uppercase;padding:4px 13px;font-size:14px;color:#fff;box-shadow:1px 1px 1px #ccc;font-weight:500}.main-container-wrapper .product-card .sticker.sale{background:#ff6472}.main-container-wrapper .product-card .sticker.new{background:#2ed04c}.main-container-wrapper .product-card:hover{box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 2px 16px 4px rgba(40,44,63,.07);-webkit-transition:.3s;transition:.3s}@media only screen and (max-width:580px){.main-container-wrapper .main-container-wrapper{padding:0}}@media only screen and (max-width:551px){.main-container-wrapper .product-grid-3{grid-template-columns:48.5% 48.5%;grid-column-gap:20px}}@media only screen and (max-width:854px){.main-container-wrapper .product-image img{display:block;width:100%}.main-container-wrapper .product-grid-4{grid-template-columns:29.5% 29.5% 29.5%;grid-column-gap:35px}.main-container-wrapper .product-card:hover{padding:5px}}@media only screen and (max-width:653px){.main-container-wrapper .product-image img{display:block;width:100%}.main-container-wrapper .product-grid-4{grid-template-columns:48.5% 48.5%;grid-column-gap:17px}}@media only screen and (max-width:425px){.main-container-wrapper .product-card{font-size:90%}.main-container-wrapper .product-card .product-image img{display:block;width:100%}.main-container-wrapper .product-card .btn.btn-md{padding:5px}.main-container-wrapper .product-grid-4{grid-template-columns:48.5% 48.5%;grid-column-gap:10px}}.main-container-wrapper .product-list{min-height:200px}.main-container-wrapper .product-list .product-card{width:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;margin-bottom:20px}.main-container-wrapper .product-list .product-card .product-image{float:left;width:30%;height:350px}.main-container-wrapper .product-list .product-card .product-image img{height:100%;width:100%}.main-container-wrapper .product-list .product-card .product-information{float:right;width:70%;padding-left:30px}.main-container-wrapper .product-list .product-card:last-child{margin-bottom:0}.main-container-wrapper .product-list.empty h2{font-size:20px}.main-container-wrapper section.featured-products{display:block;margin-bottom:5%}.main-container-wrapper section.featured-products .featured-heading{width:100%;text-align:center;text-transform:uppercase;font-size:18px;margin-bottom:20px}.main-container-wrapper section.featured-products .featured-heading .featured-separator{color:#d3d3d3}.main-container-wrapper section.news-update{display:block;box-sizing:border-box;width:100%;margin-bottom:5%}.main-container-wrapper section.news-update .news-update-grid{display:grid;grid-template-columns:58.5% 40%;grid-gap:20px}.main-container-wrapper section.news-update .news-update-grid .block1{display:block;box-sizing:border-box}.main-container-wrapper section.news-update .news-update-grid .block1 img{display:-webkit-box;display:flex;height:100%;width:100%}.main-container-wrapper section.news-update .news-update-grid .block2{display:block;box-sizing:border-box;display:grid;grid-template-rows:repeat(2,minmax(50%,1fr));grid-row-gap:20px}.main-container-wrapper section.news-update .news-update-grid .block2 .sub-block1{display:block;box-sizing:border-box}.main-container-wrapper section.news-update .news-update-grid .block2 .sub-block1 img{width:100%}.main-container-wrapper section.news-update .news-update-grid .block2 .sub-block2{display:block;box-sizing:border-box}.main-container-wrapper section.news-update .news-update-grid .block2 .sub-block2 img{width:100%}section.slider-block{display:block;margin-left:auto;margin-right:auto;margin-bottom:5%}section.slider-block div.slider-content{position:relative;height:500px;margin-left:auto;margin-right:auto}section.slider-block div.slider-content ul.slider-images .show-content{display:none}section.slider-block div.slider-content ul.slider-images li{position:absolute;visibility:hidden}section.slider-block div.slider-content ul.slider-images li.show{display:block;position:relative;visibility:visible;width:100%;-webkit-animation-name:example;animation-name:example;-webkit-animation-duration:4s;animation-duration:4s}section.slider-block div.slider-content ul.slider-images li.show .show-content{display:-webkit-box;display:flex;position:absolute;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;color:#242424;height:100%;width:100%;top:0}@-webkit-keyframes example{0%{opacity:.1}to{opacity:1}}@keyframes example{0%{opacity:.1}to{opacity:1}}section.slider-block div.slider-content ul.slider-images li img{max-height:500px;width:100%}section.slider-block div.slider-content div.slider-control{display:block;cursor:pointer;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;bottom:2%;right:2%}section.slider-block div.slider-content div.slider-control .dark-left-icon{background-color:#f2f2f2;height:48px;width:48px;max-height:100%;max-width:100%}section.slider-block div.slider-content div.slider-control .light-right-icon{background-color:#242424;height:48px;width:48px;max-height:100%;max-width:100%}@media only screen and (max-width:770px){section.slider-block div.slider-content div.slider-control{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;bottom:46%;right:0;width:100%}}.header{margin-top:16px;margin-bottom:21px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.header .header-top{margin-bottom:16px;max-width:100%;width:auto;margin-left:auto;margin-right:auto;-webkit-box-pack:justify;justify-content:space-between}.header .header-top,.header .header-top div.left-content{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.header .header-top div.left-content{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:start;justify-content:flex-start}.header .header-top div.left-content ul.logo-container{margin-right:12px}.header .header-top div.left-content ul.logo-container li{display:-webkit-box;display:flex}.header .header-top div.left-content ul.logo-container li img{max-width:120px;max-height:40px}.header .header-top div.left-content ul.search-container li.search-group{display:-webkit-inline-box;display:inline-flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center}.header .header-top div.left-content ul.search-container li.search-group .search-field{height:38px;border-radius:3px;border:2px solid #c7c7c7;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;padding-left:12px;font-size:14px}.header .header-top div.left-content ul.search-container li.search-group .search-icon-wrapper{box-sizing:border-box;height:38px;width:38px;border:2px solid #c7c7c7;border-top-right-radius:3px;border-bottom-right-radius:3px}.header .header-top div.left-content ul.search-container li.search-group .search-icon-wrapper button{background:#fff;border:0;padding:3px 5px}.header .header-top div.right-content .right-content-menu>li{display:inline-block;border-right:2px solid #c7c7c7;min-height:15px;padding:3px 15px 0}.header .header-top div.right-content .right-content-menu>li:first-child{padding-left:0}.header .header-top div.right-content .right-content-menu>li:last-child{border-right:0;padding-right:0}.header .header-top div.right-content .right-content-menu>li .icon{vertical-align:middle}.header .header-top div.right-content .right-content-menu>li .icon:not(.arrow-down-icon){margin-right:5px}.header .header-top div.right-content .right-content-menu>li .arrow-down-icon{width:12px;height:6px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container{border-right:0;padding-right:0}.header .header-top div.right-content .right-content-menu .cart-link{pointer-events:none}.header .header-top div.right-content .right-content-menu ul.dropdown-list{display:none;margin-top:14px}.header .header-top div.right-content .right-content-menu ul.dropdown-list li{border-right:none;padding:5px 10px;display:block}.header .header-top div.right-content .right-content-menu ul.dropdown-list li a{color:#333}.header .header-top div.right-content .right-content-menu .currency{position:absolute;right:0;width:100px}.header .header-top div.right-content .right-content-menu .account{position:absolute;right:0}.header .header-top div.right-content .right-content-menu .account li{padding:20px!important}.header .header-top div.right-content .right-content-menu .account li ul{margin-top:5px}.header .header-top div.right-content .right-content-menu .account li ul>li{padding:5px 10px 5px 0!important}.header .header-top div.right-content .right-content-menu .guest{width:300px}.header .header-top div.right-content .right-content-menu .guest .btn.btn-sm{padding:9px 25px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list{width:387px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container{padding:0}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-cart{color:#242424}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-cart>.dropdown-header{width:100%;padding:8px 16px;border-bottom:1px solid #c7c7c7}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-cart>.dropdown-header p{display:inline;line-height:25px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-cart>.dropdown-header i{float:right;height:22px;width:22px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-cart>.dropdown-header p.heading{font-weight:lighter}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-content{padding-top:8px;margin-bottom:55px;width:100%;max-height:329px;overflow-y:auto}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-content .item{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;border-bottom:1px solid #c7c7c7;padding:8px 16px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-content .item img{height:75px;width:75px;margin-right:8px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-content .item-details{height:auto}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .item-details .item-name{font-size:16px;font-weight:700;margin-bottom:8px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .item-details .item-options,.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .item-details .item-price{margin-bottom:8px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .item-details .item-qty{font-weight:lighter;margin-bottom:8px}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-footer{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center;padding:8px 16px;position:absolute;bottom:0;width:100%;background:#fff;border-top:1px solid #c7c7c7}.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list .dropdown-container .dropdown-footer .btn{margin:0;max-width:170px;text-align:center}.header .header-top div.right-content .menu-box,.header .header-top div.right-content .search-box{display:none}.header .header-bottom{height:47px;margin-left:auto;margin-right:auto;border-top:1px solid #c7c7c7;border-bottom:1px solid #c7c7c7;display:block}.header .header-bottom ul.nav{display:block;font-size:16px;max-width:100%;width:auto;margin-left:auto;margin-right:auto}.header .header-bottom .nav ul{margin:0;padding:0;box-shadow:1px 1px 1px 0 rgba(0,0,0,.4)}.header .header-bottom .nav a{display:block;color:#242424;text-decoration:none;padding:.8em .3em .8em .5em;text-transform:capitalize;letter-spacing:-.38px;position:relative}.header .header-bottom .nav li>.icon{display:none}.header .header-bottom .nav{vertical-align:top;display:inline-block}.header .header-bottom .nav li{position:relative}.header .header-bottom .nav>li{float:left;margin-right:1px;height:45px}.header .header-bottom .nav>li>a{margin-bottom:1px}.header .header-bottom .nav>li>a .icon{display:none}.header .header-bottom .nav li li a{margin-top:1px;white-space:normal;word-break:break-word;width:200px}.header .header-bottom .nav li a:first-child:nth-last-child(2):before{content:"";position:absolute;height:0;width:0;border:5px solid transparent;top:50%;right:5px}.header .header-bottom .nav ul{position:absolute;white-space:nowrap;border:1px solid #c7c7c7;background-color:#fff;z-index:10000;left:-99999em}.header .header-bottom .nav>li:hover{background-color:#f2f2f2}.header .header-bottom .nav>li:hover>ul{left:auto;min-width:100%}.header .header-bottom .nav>li li:hover{background-color:#f2f2f2}.header .header-bottom .nav>li li:hover>ul{left:100%;margin-left:1px;top:-2px}.header .header-bottom .nav>li:hover>a:first-child:nth-last-child(2):before,.header .header-bottom .nav li li>a:first-child:nth-last-child(2):before{margin-top:-5px}.header .header-bottom .nav li li:hover>a:first-child:nth-last-child(2):before{right:10px}.header .search-responsive{display:none}.header .search-responsive .search-content{border-bottom:1px solid #c7c7c7;border-top:1px solid #c7c7c7;height:50px;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between}.header .search-responsive .search-content .search{width:80%;border:none;font-size:16px}.header .search-responsive .search-content .right{float:right}@media (max-width:720px){.header .currency-switcher{display:none!important}.header .header-top div.right-content{display:inherit}.header .header-top div.right-content .menu-box{display:inline-block;margin-left:10px}.header .header-top div.right-content .search-box{display:inline-block;margin-right:10px;cursor:pointer}.header .header-top div.right-content .right-content-menu>li{border-right:none;padding:0 2px}.header .header-top div.right-content .right-content-menu>li .icon:not(.arrow-down-icon){margin-right:0}.header .header-top div.right-content .right-content-menu .cart-link{pointer-events:all}.header .header-top div.right-content .right-content-menu .arrow-down-icon,.header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-container,.header .header-top div.right-content .right-content-menu .name{display:none}.header .header-bottom{height:auto;display:none}.header .header-bottom .nav a{display:inline-block}.header .header-bottom .nav li,.header .header-bottom ul.nav{height:auto}.header .header-bottom .nav>li{float:none}.header .header-bottom .nav li>.icon{float:right;display:block}.header .header-bottom .icon.icon-arrow-down{margin-right:5px}.header .header-bottom .nav li .left{height:16px;width:16px}.header .header-bottom .nav li a>.icon{display:none}.header .header-bottom .nav ul{position:unset;border:none;box-shadow:none}.header .header-bottom .nav>li li:hover>ul{margin-left:0;top:0}ul.account-dropdown-container,ul.cart-dropdown-container,ul.search-container{display:none!important}}@media (max-width:400px){.header .header-top div.right-content .right-content-menu .guest{width:240px}.header .header-top div.right-content .right-content-menu .guest .btn.btn-sm{padding:7px 14px}}.footer{background-color:#f2f2f2;padding-left:10%;padding-right:10%;width:100%;display:inline-block}.footer .footer-content .footer-list-container{display:grid;padding:40px 10px;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));grid-auto-rows:auto;grid-row-gap:1vh}.footer .footer-content .footer-list-container .list-container .list-heading{text-transform:uppercase;color:#a5a5a5}.footer .footer-content .footer-list-container .list-container .list-group{padding-top:25px}.footer .footer-content .footer-list-container .list-container .list-group a{color:#242424}.footer .footer-content .footer-list-container .list-container .list-group li{margin-bottom:12px;list-style-type:none;text-transform:uppercase}.footer .footer-content .footer-list-container .list-container .list-group li span.icon{display:inline-block;vertical-align:middle;margin-right:5px;height:24px;width:24px}.footer .footer-content .footer-list-container .list-container .form-container{padding-top:5px}.footer .footer-content .footer-list-container .list-container .form-container .control-group .subscribe-field{width:100%}.footer .footer-content .footer-list-container .list-container .form-container .control-group .btn-primary{background-color:#242424;margin-top:8px;border-radius:0;text-align:center}.footer .footer-content .footer-list-container .list-container .form-container .control-group .locale-switcher{width:100%}.footer .footer-content .footer-list-container .list-container .currency{display:none}@media (max-width:720px){.footer{padding-left:15px}.footer .footer-list-container{padding-left:0!important}.footer .currency{display:block!important}}.footer-bottom{width:100%;height:70px;font-size:16px;color:#a5a5a5;letter-spacing:-.26px;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center}.footer-bottom p{padding:0 15px}.main .category-container{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;width:100%}.main .category-container .layered-filter-wrapper,.main .category-container .responsive-layred-filter{width:25%;float:left;padding-right:20px;min-height:1px}.main .category-container .layered-filter-wrapper .filter-title,.main .category-container .responsive-layred-filter .filter-title{border-bottom:1px solid #c7c7c7;color:#242424;padding:10px 0}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item{border-bottom:1px solid #c7c7c7;padding-bottom:10px}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-title,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-title{padding:10px 40px 0 10px;color:#5e5e5e;cursor:pointer;position:relative}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-title .remove-filter-link,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-title .remove-filter-link{font-weight:400;color:#0031f0;margin-right:10px}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-title .icon,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-title .icon{background-image:url(../images/icon-dropdown.svg)!important;width:10px;height:10px;position:absolute;right:15px;top:14px}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content{padding:10px;display:none}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content ol.items,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content ol.items{padding:0;margin:0;list-style:none none}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item{padding:8px 0;color:#5e5e5e}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item .checkbox,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item .checkbox{margin:0}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item .color-swatch,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content ol.items li.item .color-swatch{display:inline-block;margin-right:5px;min-width:20px;height:20px;border:1px solid #c7c7c7;border-radius:3px;float:right}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item .filter-attributes-content .price-range-wrapper,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item .filter-attributes-content .price-range-wrapper{margin-top:21px}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item.active .filter-attributes-content,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item.active .filter-attributes-content{display:block}.main .category-container .layered-filter-wrapper .filter-attributes .filter-attributes-item.active .filter-attributes-title .icon,.main .category-container .responsive-layred-filter .filter-attributes .filter-attributes-item.active .filter-attributes-title .icon{background-image:url(../images/arrow-up.svg)!important}.main .category-container .responsive-layred-filter{display:none;width:100%;float:none;padding-right:0;margin-top:-25px!important}.main .category-container .category-block{width:80%;display:block}.main .category-container .category-block .hero-image{display:inline-block;visibility:visible;width:100%}.main .category-container .category-block .hero-image img{max-height:400px;max-width:100%}.main .top-toolbar{width:100%;display:inline-block}.main .top-toolbar .page-info{float:left;color:#242424;line-height:45px}.main .top-toolbar .page-info span{display:none}.main .top-toolbar .page-info span:first-child{display:inline}.main .top-toolbar .pager{float:right}.main .top-toolbar .pager label{margin-right:5px}.main .top-toolbar .pager select{background:#f2f2f2;border:1px solid #c7c7c7;border-radius:3px;color:#242424;padding:10px}.main .top-toolbar .pager .view-mode{display:inline-block;margin-right:20px}.main .top-toolbar .pager .view-mode a,.main .top-toolbar .pager .view-mode span{display:inline-block;vertical-align:middle}.main .top-toolbar .pager .view-mode a.grid-view,.main .top-toolbar .pager .view-mode span.grid-view{margin-right:10px}.main .top-toolbar .pager .view-mode .sort-filter{display:none}.main .top-toolbar .pager .sorter{display:inline-block;margin-right:10px}.main .top-toolbar .pager .limiter{display:inline-block}.main .bottom-toolbar{display:block;margin-top:40px;margin-bottom:40px;text-align:center}@media only screen and (max-width:840px){.main .category-container .responsive-layred-filter,.main .layered-filter-wrapper{display:none}.main .category-block{width:100%!important}.main .category-block .top-toolbar{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.main .category-block .top-toolbar .page-info{border-bottom:1px solid #c7c7c7;line-height:15px;margin-top:10px}.main .category-block .top-toolbar .page-info span{display:inline}.main .category-block .top-toolbar .page-info span:first-child{display:none}.main .category-block .top-toolbar .page-info .sort-filter{float:right;cursor:pointer}.main .category-block .top-toolbar .pager{margin-top:20px;display:none}.main .category-block .top-toolbar .pager .view-mode{display:none}.main .category-block .responsive-layred-filter{display:block}}section.product-detail{color:#242424}section.product-detail div.category-breadcrumbs{display:inline}section.product-detail div.layouter{display:block;margin-top:20px;margin-bottom:20px}section.product-detail div.layouter .form-container{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;width:100%}section.product-detail div.layouter .form-container div.product-image-group{margin-right:30px;width:604px;height:650px;max-width:604px;position:-webkit-sticky;position:sticky;top:10px}section.product-detail div.layouter .form-container div.product-image-group div{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;cursor:pointer}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;margin-right:4px;min-width:120px;overflow:hidden;position:relative;-webkit-box-pack:start;justify-content:flex-start;max-height:480px}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .thumb-frame{border:2px solid transparent;background:#f2f2f2;width:120px;max-height:120px}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .thumb-frame.active{border-color:#0031f0}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .thumb-frame img{height:100%;width:100%}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control{width:100%;position:absolute;text-align:center;cursor:pointer;z-index:1}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control .overlay{opacity:.3;background:#242424;width:100%;height:18px;position:absolute;left:0;z-index:-1}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control .icon{z-index:2}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control.top{top:0}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control.bottom{bottom:0}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image{display:block;position:relative;background:#f2f2f2;width:100%;max-height:480px;height:100%}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image img{width:100%;height:auto;max-height:480px}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image .add-to-wishlist{background-image:url(../images/wishlist.svg);position:absolute;top:10px;right:12px;background-color:transparent;border:0;cursor:pointer;padding:0;width:32px;height:32px}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image .add-to-wishlist:hover{background-image:url(../images/wishlist-added.svg)}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image .add-to-wishlist.already{background-image:url(../images/wishlist-added.svg)!important}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image .share{position:absolute;top:10px;right:45px}section.product-detail div.layouter .form-container div.product-image-group .add-to-buttons{display:none;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;margin-top:10px;width:79.5%;float:right;-webkit-box-pack:justify;justify-content:space-between}section.product-detail div.layouter .form-container div.product-image-group .add-to-buttons .addtocart{width:49%;background:#000;white-space:normal;text-transform:uppercase}section.product-detail div.layouter .form-container div.product-image-group .add-to-buttons .buynow{width:49%;white-space:nowrap;text-transform:uppercase}section.product-detail div.layouter .form-container .details{width:50%;overflow-wrap:break-word}section.product-detail div.layouter .form-container .details .product-price{margin-bottom:14px}section.product-detail div.layouter .form-container .details .product-price .sticker{display:none}section.product-detail div.layouter .form-container .details .product-ratings{margin-bottom:20px}section.product-detail div.layouter .form-container .details .product-ratings .icon{width:16px;height:16px}section.product-detail div.layouter .form-container .details .product-ratings .total-reviews{display:inline-block;margin-left:15px}section.product-detail div.layouter .form-container .details .product-heading{font-size:24px;color:#242424;margin-bottom:15px}section.product-detail div.layouter .form-container .details .product-price{margin-bottom:15px;word-break:break-all}section.product-detail div.layouter .form-container .details .product-price .special-price{font-size:24px}section.product-detail div.layouter .form-container .details .stock-status{margin-bottom:15px;font-weight:600;color:#fc6868}section.product-detail div.layouter .form-container .details .stock-status.active{color:#4caf50}section.product-detail div.layouter .form-container .details .description{margin-bottom:15px}section.product-detail div.layouter .form-container .details .description ul{padding-left:40px;list-style:disc}section.product-detail div.layouter .form-container .details .quantity{padding-top:15px;border-top:1px solid hsla(0,0%,63.5%,.2)}section.product-detail div.layouter .form-container .details .downloadable-container .sample-list{padding:15px 0;border-top:1px solid hsla(0,0%,63.5%,.2)}section.product-detail div.layouter .form-container .details .downloadable-container .sample-list h3{font-size:16px;margin-top:0}section.product-detail div.layouter .form-container .details .downloadable-container .sample-list ul li{margin-bottom:5px}section.product-detail div.layouter .form-container .details .downloadable-container .sample-list ul li:last-child{margin-bottom:0}section.product-detail div.layouter .form-container .details .downloadable-container .link-list{padding:15px 0;border-top:1px solid hsla(0,0%,63.5%,.2)}section.product-detail div.layouter .form-container .details .downloadable-container .link-list h3{font-size:16px;margin-top:0}section.product-detail div.layouter .form-container .details .downloadable-container .link-list ul li{margin-bottom:15px}section.product-detail div.layouter .form-container .details .downloadable-container .link-list ul li:last-child{margin-bottom:0}section.product-detail div.layouter .form-container .details .downloadable-container .link-list ul li .checkbox{display:inline-block;margin:0}section.product-detail div.layouter .form-container .details .downloadable-container .link-list ul li a{float:right;margin-top:3px}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list{padding:15px 0;border-top:1px solid hsla(0,0%,63.5%,.2)}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li{margin-bottom:15px;width:100%;display:inline-block}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li:last-child{margin-bottom:0}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li:first-child span{font-weight:600}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li:first-child span:last-child{float:right;width:50px;text-align:left}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .name{vertical-align:middle;display:inline-block}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .name .product-price{margin-top:5px;margin-bottom:0;font-size:14px;word-break:break-all}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .name .product-price .special-price{font-size:16px}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .qty{float:right}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .qty .control-group{max-width:none;width:auto;text-align:center;margin-bottom:0;border-top:0;padding-top:0}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .qty .control-group label{display:none}section.product-detail div.layouter .form-container .details .grouped-product-container .grouped-product-list ul li .qty .control-group .control{height:38px;width:60px;text-align:center;line-height:38px}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list{padding:15px 0;border-top:1px solid hsla(0,0%,63.5%,.2)}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list h3{font-size:16px;margin:0;color:#242424}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item{border-bottom:1px solid hsla(0,0%,63.5%,.2);padding:15px 0;width:100%;display:inline-block}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item:last-child{border-bottom:0;padding-bottom:0}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .control-group{margin-bottom:0;color:#5e5e5e}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .control-group label{color:#242424}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .control-group .control{color:#5e5e5e}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .control-group .price{margin-left:15px}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .quantity{border-top:0;padding-bottom:0}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .quantity.has-error button{border-color:#fc6868;color:#fc6868}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item .control-error{float:left;width:100%}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-option-list .bundle-option-item.has-error button{border-color:#fc6868;color:#fc6868}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary{padding:15px 0;border-top:1px solid hsla(0,0%,63.5%,.2)}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary h3{font-size:16px;margin:0;color:#242424}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary .quantity{border-top:0}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary .bundle-price{font-weight:600;font-size:24px;color:#ff6472;margin-top:10px}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary ul.bundle-items li{margin-bottom:20px}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary ul.bundle-items li:last-child{margin-bottom:0}section.product-detail div.layouter .form-container .details .bundle-options-wrapper .bundle-summary ul.bundle-items li .selected-products{color:#5e5e5e}section.product-detail div.layouter .form-container .details .full-description *{max-width:100%}section.product-detail div.layouter .form-container .details .full-description ul{padding-left:40px;list-style:disc}section.product-detail div.layouter .form-container .details .full-specifications td{padding:10px 0;color:#5e5e5e}section.product-detail div.layouter .form-container .details .full-specifications td:first-child{padding-right:40px}section.product-detail div.layouter .form-container .details .accordian .accordian-header{padding-left:0;font-weight:600}section.product-detail div.layouter .form-container .details .accordian .accordian-content{padding:20px 0}section.product-detail div.layouter .form-container .details .attributes{display:block;width:100%;border-bottom:1px solid hsla(0,0%,63.5%,.2)}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group{margin-bottom:20px}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container{margin-top:10px;display:inline-block}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch{display:inline-block;margin-right:5px;min-width:40px;height:40px}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch span{min-width:38px;height:38px;float:left;border:1px solid #c7c7c7;border-radius:3px;line-height:36px;text-align:center;cursor:pointer;padding:0 10px}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch img{width:38px;height:38px;border:1px solid #c7c7c7;border-radius:3px;cursor:pointer;background:#f2f2f2}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch input:checked+img,section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch input:checked+span{border:1px solid #242424}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .swatch input{display:none}section.product-detail div.layouter .form-container .details .attributes .attribute.control-group .swatch-container .no-options{color:#fb3949}.accordian .accordian-header,.accordian div[slot*=header],accordian .accordian-header,accordian div[slot*=header]{font-size:16px!important}@media only screen and (max-width:720px){section.product-detail div.layouter .form-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}section.product-detail div.layouter .form-container div.product-image-group{margin-right:0;max-width:none;width:auto;min-height:400px;height:auto;position:unset}section.product-detail div.layouter .form-container div.product-image-group .loader{margin-left:47%}section.product-detail div.layouter .form-container div.product-image-group div{-webkit-box-orient:vertical;-webkit-box-direction:reverse;flex-direction:column-reverse}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list{margin-top:5px;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;overflow-x:scroll;margin-right:0}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .thumb-frame img{height:100%;width:auto}section.product-detail div.layouter .form-container div.product-image-group div .thumb-list .gallery-control{display:none}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image{display:-webkit-box;display:flex}section.product-detail div.layouter .form-container div.product-image-group div .product-hero-image img{margin-left:auto;margin-right:auto;width:480px}section.product-detail div.layouter .form-container div.product-image-group div .wrap{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;width:100%!important}section.product-detail div.layouter .form-container div.product-image-group .add-to-buttons{width:100%}section.product-detail div.layouter .form-container .details{width:100%;margin-top:20px}}@media only screen and (max-width:510px){section.product-detail div.layouter .form-container div.product-image-group .product-hero-image img{width:100%!important}}.rating-reviews .rating-header{padding:20px 0}.rating-reviews .stars .icon{width:16px;height:16px}.rating-reviews .overall{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between}.rating-reviews .overall .review-info .number{font-size:34px}.rating-reviews .overall .review-info .total-reviews{margin-top:10px}.rating-reviews .reviews{margin-top:40px;margin-bottom:40px}.rating-reviews .reviews .review{margin-bottom:25px}.rating-reviews .reviews .review .title{margin-bottom:5px}.rating-reviews .reviews .review .stars{margin-bottom:15px;display:inline-block}.rating-reviews .reviews .review .message{margin-bottom:10px}.rating-reviews .reviews .review .reviewer-details{color:#5e5e5e}.rating-reviews .reviews .view-all{margin-top:15px;color:#0031f0;margin-bottom:15px}section.cart{width:100%;color:#242424;margin-bottom:80px;margin-top:20px}section.cart .title{font-size:24px}section.cart .cart-content{margin-top:20px;width:100%;display:inline-block}section.cart .cart-content .left-side{width:70%;float:left}section.cart .cart-content .left-side .misc-controls{width:100%;display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between;margin-top:20px}section.cart .cart-content .left-side .misc-controls a.link,section.cart .cart-content .left-side .misc-controls div button{margin-right:15px}section.cart .cart-content .right-side{width:30%;display:inline-block;padding-left:40px}.cart-item-list .item{padding:10px;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;border:1px solid #c7c7c7;border-radius:2px}.cart-item-list .item .item-image{margin-right:15px}.cart-item-list .item .item-image img{height:160px;width:160px}.cart-item-list .item .item-details{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:start;justify-content:flex-start;width:100%}.cart-item-list .item .item-details .item-title{font-size:18px;margin-bottom:10px;font-weight:600}.cart-item-list .item .item-details .item-title a{color:#242424}.cart-item-list .item .item-details .price{margin-bottom:10px;font-size:18px;font-weight:600}.cart-item-list .item .item-details .summary{margin-bottom:17px}.cart-item-list .item .item-details .misc{display:-webkit-box;display:flex;width:100%;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:start;justify-content:flex-start;-webkit-box-align:start;align-items:flex-start;margin-top:10px}.cart-item-list .item .item-details .misc .control-group{font-size:16px!important;margin:0;width:auto}.cart-item-list .item .item-details .misc .control-group .wrap{display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center}.cart-item-list .item .item-details .misc .control-group label{margin-right:15px}.cart-item-list .item .item-details .misc .control-group .control{height:38px;width:60px;text-align:center;line-height:38px}.cart-item-list .item .item-details .misc .remove,.cart-item-list .item .item-details .misc .towishlist{line-height:35px;margin-left:15px}.cart-item-list .item .error-message{color:#ff6472}.quantity{display:inline-block!important}.quantity label{margin-bottom:10px}.quantity button{width:40px;height:38px;font-size:16px;background:#fff;border:1px solid #c7c7c7;float:left;cursor:pointer}.quantity button.decrease{border-radius:3px 0 0 3px}.quantity button.increase{border-radius:0 3px 3px 0}.quantity.control-group .control{text-align:center;float:left;width:60px;height:38px;margin:0;border:1px solid #c7c7c7;border-right:none;border-left:none;border-radius:0}.quantity.control-group .control:focus{border-color:#c7c7c7}.coupon-container .discount-control .control-group{margin-top:20px}.coupon-container .discount-control .control-group .control{width:100%}.coupon-container .applied-coupon-details{margin-top:30px}.coupon-container .applied-coupon-details .right{float:right}.coupon-container .applied-coupon-details .right .icon{vertical-align:text-bottom;margin-bottom:1px;cursor:pointer}.order-summary h3{font-size:16px;margin-top:0}.order-summary .item-detail{margin-top:12px}.order-summary .item-detail label.right{float:right}.order-summary .payable-amount{margin-top:17px;border-top:1px solid #c7c7c7;padding-top:12px}.order-summary .payable-amount label{font-weight:700}.order-summary .payable-amount label.right{float:right}@media only screen and (max-width:815px){section.cart .cart-content{display:block}section.cart .cart-content .left-side{width:100%;float:none}section.cart .cart-content .left-side .misc-controls{position:relative;top:180px;margin-top:0}section.cart .cart-content .right-side{width:100%;padding-left:0;position:relative;top:-20px}}@media only screen and (max-width:600px){section.cart .cart-content .left-side .cart-item-list .item{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}section.cart .cart-content .left-side .cart-item-list .item .item-details{margin-top:10px}section.cart .cart-content .left-side .cart-item-list .item .item-details .misc{display:-webkit-box;display:flex;flex-wrap:wrap;line-height:40px}}@media only screen and (max-width:574px){section.cart .cart-content .left-side .misc-controls{display:block;top:160px}section.cart .cart-content .left-side .misc-controls div button{width:100%;margin-top:10px}section.cart .cart-content .left-side .misc-controls div a{margin-top:10px;width:100%;text-align:center}section.cart .cart-content .right-side{top:-100px}}.checkout-method-group .line-one{display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center}.checkout-method-group .line-one .radio-container{padding-left:28px}.checkout-method-group .line-one .method-label{margin-top:4px}.checkout-method-group .line-two{margin-left:30px}.checkout-process{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;width:100%;margin-top:20px;margin-bottom:20px;font-size:16px;color:#242424}.checkout-process .col-main{width:70%;margin-right:5%}.checkout-process .col-main ul.checkout-steps{display:-webkit-inline-box;display:inline-flex;-webkit-box-pack:justify;justify-content:space-between;width:100%;padding-bottom:15px;border-bottom:1px solid #c7c7c7}.checkout-process .col-main ul.checkout-steps li{height:48px;display:-webkit-box;display:flex}.checkout-process .col-main ul.checkout-steps li .decorator{height:48px;width:48px;border-radius:50%;display:-webkit-inline-box;display:inline-flex;border:1px solid #c7c7c7;background-repeat:no-repeat;background-position:50%}.checkout-process .col-main ul.checkout-steps li .decorator.address-info{background-image:url(../images/address.svg)}.checkout-process .col-main ul.checkout-steps li .decorator.shipping{background-image:url(../images/shipping.svg)}.checkout-process .col-main ul.checkout-steps li .decorator.payment{background-image:url(../images/payment.svg)}.checkout-process .col-main ul.checkout-steps li .decorator.review{background-image:url(../images/finish.svg)}.checkout-process .col-main ul.checkout-steps li.completed{cursor:pointer}.checkout-process .col-main ul.checkout-steps li.completed .decorator{background-image:url(../images/complete.svg)}.checkout-process .col-main ul.checkout-steps li span{margin-left:7px;margin-top:auto;margin-bottom:auto}.checkout-process .col-main ul.checkout-steps li.active{color:#2650ef}.checkout-process .col-main ul.checkout-steps li.active .decorator{border:1px solid #2650ef}.checkout-process .col-main .step-content{padding-top:20px}.checkout-process .col-main .step-content .form-header{display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between;width:100%;height:30px}.checkout-process .col-main .step-content .form-header .checkout-step-heading{font-size:24px;font-weight:700;float:left}.checkout-process .col-main .step-content .form-header .btn{float:right;font-size:14px}.checkout-process .col-main .step-content .form-container{border-bottom:1px solid #c7c7c7;padding-top:20px;padding-bottom:20px}.checkout-process .col-main .step-content .shipping-methods{font-size:16px}.checkout-process .col-main .step-content .shipping-methods .ship-method-carrier{margin-bottom:15px;font-weight:700}.checkout-process .col-main .step-content .payment-methods .radio-container{padding-left:28px}.checkout-process .col-main .step-content .payment-methods .control-info{margin-left:28px}.checkout-process .col-main .step-content .address-summary{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:start;justify-content:flex-start;-webkit-box-align:center;align-items:center;width:100%}.checkout-process .col-main .step-content .address-summary div.billing-address{margin-right:25%}.checkout-process .col-main .step-content .address-summary div.billing-address .horizontal-rule,.checkout-process .col-main .step-content .address-summary div.shipping-address .horizontal-rule{width:40px;background:#242424}.checkout-process .col-main .step-content .address-summary .label{width:10%}.checkout-process .col-main .step-content .address-summary .address-card-list{width:85%}.checkout-process .col-main .step-content .cart-item-list .item .row .title{width:100px;display:inline-block;color:#a5a5a5;font-weight:500;margin-bottom:10px}.checkout-process .col-main .step-content .cart-item-list .item .row .value{font-size:18px;font-weight:600}.checkout-process .col-main .step-content .order-description{display:inline-block;width:100%}.checkout-process .col-main .step-content .order-description .shipping{margin-bottom:25px}.checkout-process .col-main .step-content .order-description .decorator{height:48px;width:48px;border-radius:50%;border:1px solid #c7c7c7;vertical-align:middle;display:inline-block;text-align:center}.checkout-process .col-main .step-content .order-description .decorator .icon{margin-top:7px}.checkout-process .col-main .step-content .order-description .text{font-weight:600;vertical-align:middle;display:inline-block}.checkout-process .col-main .step-content .order-description .text .info{font-weight:500;margin-top:2px}.checkout-process .col-right{width:25%;padding-left:40px}@media only screen and (max-width:770px){.checkout-process .col-main{width:100%;padding-right:0}.checkout-process .col-main ul.checkout-steps{border-bottom:none;padding-bottom:0}.checkout-process .col-main ul.checkout-steps span{display:none}.checkout-process .col-main ul.checkout-steps .line{-webkit-box-flex:1;flex-grow:1;border-bottom:1px solid #c7c7c7;margin-left:5px;margin-right:5px}.checkout-process .step-content{padding-top:0}.checkout-process .step-content .control-group .control{width:100%}.checkout-process .col-right{display:none}}@media only screen and (max-width:480px){.checkout-process .col-main .step-content .address,.checkout-process .col-main .step-content .order-description{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.checkout-process .col-main .step-content .address .billing-address,.checkout-process .col-main .step-content .address .pull-left,.checkout-process .col-main .step-content .order-description .billing-address,.checkout-process .col-main .step-content .order-description .pull-left{width:100%!important}.checkout-process .col-main .step-content .address .pull-right,.checkout-process .col-main .step-content .address .shipping-address,.checkout-process .col-main .step-content .order-description .pull-right,.checkout-process .col-main .step-content .order-description .shipping-address{width:100%!important;margin-top:20px}}.attached-products-wrapper{margin-bottom:80px}.attached-products-wrapper .title{margin-bottom:40px;font-size:18px;color:#242424;text-align:center;position:relative}.attached-products-wrapper .title .border-bottom{border-bottom:1px solid hsla(0,0%,63.5%,.2);display:inline-block;width:100px;position:absolute;top:40px;left:50%;margin-left:-50px}.attached-products-wrapper .horizontal-rule{height:1px;background:#c7c7c7;width:148px;margin-bottom:24px;margin-left:auto;margin-right:auto}section.review .category-breadcrumbs{display:inline}section.review .review-layouter{display:-webkit-box;display:flex}section.review .review-layouter .product-info{max-width:25%}section.review .review-layouter .product-info .product-name{font-size:24px}section.review .review-layouter .product-info .product-image img{height:280px;width:280px}section.review .review-layouter .product-info .product-name a{color:#242424}section.review .review-layouter .product-info .product-price{margin-top:10px;word-break:break-all}section.review .review-layouter .product-info .product-price .pro-price{color:#ff6472}section.review .review-layouter .product-info .product-price .pro-price-not{margin-left:10px;font-size:16px;color:#a5a5a5}section.review .review-layouter .product-info .product-price .offer{margin-left:10px;font-size:16px}section.review .review-layouter .review-form{margin-left:20px;width:55%}section.review .review-layouter .review-form .heading{color:#242424;font-weight:600}section.review .review-layouter .review-form .heading .right{float:right;margin-top:-10px}section.review .review-layouter .review-form .star{font-size:23px;color:#d4d4d4;-webkit-transition:all .2s;transition:all .2s}section.review .review-layouter .review-form .star:before{content:"\2605"}section.review .review-layouter .review-form .control-group .control{width:100%}section.review .review-layouter .review-form .review-detail{height:150px;border:1px solid #b22222;margin-top:30px;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}section.review .review-layouter .review-form .review-detail .rating-review{margin-top:40px;margin-left:20px;width:48%}section.review .review-layouter .review-form .review-detail .rating-review .avg-rating-count span{font-size:34px;text-align:center}section.review .review-layouter .review-form .review-detail .rating-calculate .progress-only{width:20px;border:1px solid #00f}section.review .review-layouter .ratings-reviews{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between}section.review .review-layouter .ratings-reviews .left-side{padding:40px 20px;width:50%}section.review .review-layouter .ratings-reviews .left-side .rate{font-size:34px}section.review .review-layouter .ratings-reviews .left-side .stars .icon{height:16px;width:16px}section.review .review-layouter .ratings-reviews .right-side{width:50%}section.review .review-layouter .ratings-reviews .right-side .rater{display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center;padding-top:5px;width:100%}section.review .review-layouter .ratings-reviews .right-side .rater .star-name{margin-right:5px;width:35px}section.review .review-layouter .ratings-reviews .right-side .rater .rate-number{width:15px}section.review .review-layouter .ratings-reviews .right-side .rater .percentage{width:50px;margin-right:10px}section.review .review-layouter .ratings-reviews .right-side .rater .percentage span{float:right;white-space:nowrap}section.review .review-layouter .ratings-reviews .right-side .rater .line-bar{height:4px;width:calc(100% - 100px);margin-right:5px;margin-left:5px;background:#d8d8d8}section.review .review-layouter .ratings-reviews .right-side .rater .line-bar .line-value{background-color:#0031f0}@media only screen and (max-width:770px){section.review .category-breadcrumbs{display:none}section.review .review-layouter{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}section.review .review-layouter .product-info{max-width:100%}section.review .review-layouter .product-info .product-image,section.review .review-layouter .product-info .product-name,section.review .review-layouter .product-info .product-price{max-width:280px;margin-left:auto;margin-right:auto;word-break:break-all}section.review .review-layouter .review-form{width:100%;margin-left:0}section.review .review-layouter .review-form .heading .right{margin-top:50px}section.review .review-layouter .review-form .ratings-reviews{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;width:100%}section.review .review-layouter .review-form .ratings-reviews .left-side{width:100%;padding:0 0 40px;margin-top:-30px}section.review .review-layouter .review-form .ratings-reviews .right-side{width:100%}section.review .review-layouter .review-form .ratings-reviews .right-side .rater .percentage{margin-right:0}}.auth-content{padding-top:5%;padding-bottom:5%}.auth-content .sign-up-text{margin-bottom:2%;margin-left:auto;margin-right:auto;font-size:18px;color:#a5a5a5;text-align:center}.auth-content .login-form{margin-left:auto;margin-right:auto;display:-webkit-box;display:flex;border:1px solid #c7c7c7;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;max-width:500px;min-width:320px;padding:25px}.auth-content .login-form .login-text{font-size:24px;font-weight:600;margin-bottom:30px}.auth-content .login-form .control-group{margin-bottom:15px!important}.auth-content .login-form .control-group .control{width:100%!important}.auth-content .login-form .forgot-password-link{font-size:17px;color:#0031f0;margin-bottom:5%}.auth-content .login-form .signup-confirm{margin-bottom:5%}.auth-content .login-form .btn-primary{width:100%;text-transform:uppercase}.account-content{width:100%;-webkit-box-orient:horizontal;flex-direction:row;margin-top:5.5%;margin-bottom:5.5%}.account-content,.account-content .sidebar{display:-webkit-box;display:flex;-webkit-box-direction:normal}.account-content .sidebar{-webkit-box-orient:vertical;flex-direction:column;align-content:center;-webkit-box-pack:start;justify-content:flex-start;width:20%;height:100%}.account-content .menu-block{margin-bottom:30px}.account-content .menu-block:last-child{margin-bottom:0}.account-content .menu-block .menu-block-title{padding-bottom:10px;font-size:18px}.account-content .menu-block .menu-block-title .right{display:none}.account-content .menu-block .menubar{border:1px solid #c7c7c7;color:#a5a5a5;position:relative}.account-content .menu-block .menubar li{width:95%;height:50px;margin-left:5%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:start;justify-content:flex-start;-webkit-box-align:center;align-items:center;border-bottom:1px solid #c7c7c7;text-align:center}.account-content .menu-block .menubar li a{color:#5e5e5e;width:100%;text-align:left}.account-content .menu-block .menubar li .icon{display:none;position:absolute;right:12px}.account-content .menu-block .menubar li:first-child{border-top:none}.account-content .menu-block .menubar li:last-child{border-bottom:none}.account-content .menu-block .menubar li.active a{color:#0031f0}.account-content .menu-block .menubar li.active .icon{display:inline-block}.account-content .account-layout{margin-left:40px;width:80%}.account-content .account-layout .account-head .back-icon,.account-content .account-layout .responsive-empty{display:none}.account-table-content{color:#242424;margin-top:1.4%}.account-table-content table{width:100%}.account-table-content table tbody tr{height:45px}.account-table-content table tbody tr td{width:250px}.address-holder{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:start;justify-content:flex-start;-webkit-box-align:start;align-items:flex-start;flex-wrap:wrap;width:100%}.address-card{width:260px;border:1px solid #c7c7c7;padding:15px;margin-right:15px;margin-bottom:15px}.address-card .control-group{width:15px;height:15px;margin-top:10px}.address-card .details{font-weight:lighter}.address-card .details span{display:block}.address-card .details .control-links{width:90%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;flex-wrap:wrap;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center}.address-card .details .control-links .btn{height:30px}.edit-form{display:-webkit-box;display:flex;border:1px solid #c7c7c7;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;min-height:345px;padding:25px}@media only screen and (max-width:770px){.account-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.account-content .sidebar{width:100%}.account-content .sidebar .menu-block .menu-block-title{height:50px;padding-top:13px;border-bottom:1px solid #c7c7c7;border-top:1px solid #c7c7c7}.account-content .sidebar .menu-block .menu-block-title .right{display:block;float:right;align-self:center}.account-content .sidebar .menu-block .menubar{border:0;display:none}.account-content .sidebar .menu-block .menubar>li{margin-left:0;width:100%}.account-content .sidebar .menu-block .menubar>li .icon{right:0}.account-content .sidebar .menu-block .menubar>li:last-child{border-bottom:1px solid #c7c7c7}.account-content .account-layout{margin-left:0;margin-top:20px;width:100%}.account-content .account-layout .account-head{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;border-bottom:1px solid #c7c7c7;border-top:1px solid #c7c7c7;height:50px;margin-top:10px}.account-content .account-layout .account-head .account-action{margin-top:12px;margin-left:15px}.account-content .account-layout .account-head .back-icon{display:block}.account-content .account-layout .account-head span{margin-top:13px;font-size:18px}.account-content .account-layout .account-head .horizontal-rule{display:none}.account-content .account-layout .account-table-content{margin-top:2%}.account-content .account-layout .account-table-content table tbody tr{height:70px}.account-content .account-layout .account-table-content table tbody tr td{display:block}.account-content .account-layout .account-table-content .address-holder{-webkit-box-pack:center;justify-content:center}.account-content .account-items-list,.account-content .edit-form{margin-top:20px}.account-content .account-items-list .responsive-empty,.account-content .edit-form .responsive-empty{display:block}.account-content .control-group .control{width:100%}}.sale-container{color:#5e5e5e}.sale-container .sale-section .secton-title{font-size:18px;color:#8e8e8e;padding:15px 0;border-bottom:1px solid #c7c7c7}.sale-container .sale-section .section-content{display:block;padding:20px 0;border-bottom:1px solid #e8e8e8}.sale-container .sale-section .section-content .row{display:block;padding:7px 0}.sale-container .sale-section .section-content .row .title{width:200px;letter-spacing:-.26px;display:inline-block}.sale-container .sale-section .section-content .row .value{letter-spacing:-.26px;display:inline-block}.sale-container .sale-section .section-content .order-box-container{display:inline-block;width:100%}.sale-container .sale-section .section-content .order-box-container .box{float:left;width:25%}.sale-container .sale-section .section-content .order-box-container .box .box-title{padding:10px 0;font-size:18px;color:#8e8e8e}.sale-container .sale-section .section-content .order-box-container .box .box-content{color:#3a3a3a;padding-right:10px}.sale-container .sale-section .section-content .qty-row{display:block}.sale-container .totals{padding-top:20px;display:inline-block;width:100%;border-top:1px solid #e8e8e8}.sale-container .totals .sale-summary{height:130px;float:right;border-collapse:collapse}.sale-container .totals .sale-summary tr td{padding:5px 8px;width:auto;color:#3a3a3a}.sale-container .totals .sale-summary tr.bold{font-weight:600;font-size:15px}.sale-container .totals .sale-summary tr.border td{border-bottom:1px solid #c7c7c7}@media only screen and (max-width:770px){.sale-container .sale-section .section-content{border-bottom:none;padding:10px 0}.sale-container .sale-section .section-content .row{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.sale-container .sale-section .section-content .row .title{line-height:20px}.sale-container .sale-section .section-content .totals{border-top:none}.sale-container .sale-section .section-content .totals .sale-summary{width:100%}.sale-container .sale-section .section-content .totals .sale-summary tr td:nth-child(2){display:none}.sale-container .sale-section .section-content .order-box-container{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.sale-container .sale-section .section-content .order-box-container .box{width:100%;margin:10px auto}.sale-container .sale-section .section-content .qty-row{display:inline}}.verify-account{text-align:center;background:#204d74;width:200px;margin-right:auto;margin-left:auto;border-radius:4px}.verify-account a{color:#fff!important}.cp-spinner{position:absolute;left:calc(50% - 24px);margin-top:calc(40% - 24px)}@media only screen and (max-width:720px){.cp-spinner{left:50%;margin-left:-24px;top:50%;margin-top:-24px}}@media only screen and (max-width:720px){.error-container .wrapper{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;flex-direction:column-reverse!important;margin:10px 0 20px!important;-webkit-box-align:start!important;align-items:start!important;height:100%!important}}@media only screen and (max-width:770px){.table table{width:100%}.table table thead{display:none}.table table tbody tr td:before{content:attr(data-value);font-size:15px;font-weight:600;display:inline-block;width:120px}.table table tbody td{border-bottom:none!important;display:block;width:100%!important}.table table tbody td div{position:relative;left:100px;top:-20px}.table table tbody tr{border:1px solid #c7c7c7}}.show-wishlist{z-index:-1!important}.filter-row-one .dropdown-filters{position:relative!important;right:1px!important}@media only screen and (max-width:770px){.table .grid-container{margin-top:10px;overflow-x:hidden}.table .grid-container .filter-row-one{display:block}.table .grid-container .filter-row-one .dropdown-filters{margin-top:10px}}.rtl{direction:rtl}.rtl .header .header-top div.left-content ul.logo-container{margin-right:0;margin-left:12px}.rtl .header .header-top div.left-content ul.search-container li.search-group .search-field{border:2px solid #c7c7c7;padding-right:12px;padding-left:0;border-radius:2px;border-top-left-radius:0;border-bottom-left-radius:0}.rtl .header .header-top div.left-content ul.search-container li.search-group .search-icon-wrapper{border:2px solid #c7c7c7;border-right:none;border-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0}.rtl .header .header-top div.right-content .right-content-menu>li{border-right:2px solid #c7c7c7;padding:0 15px}.rtl .header .header-top div.right-content .right-content-menu>li:last-child{padding-left:0}.rtl .header .header-top div.right-content .right-content-menu>li:first-child{border-right:0;padding-right:0}.rtl .header .header-top div.right-content .right-content-menu .cart-dropdown-container .dropdown-list{left:0;right:unset!important}.rtl .header .header-top div.right-content .right-content-menu .cart-dropdown-container .count{display:inline-block}.rtl .header .header-top div.right-content .right-content-menu .account,.rtl .header .header-top div.right-content .right-content-menu .currency{right:unset;left:0}.rtl .header .header-top div.right-content .right-content-menu .guest div{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between}.rtl .header .header-bottom .nav>li{float:right;margin-right:0;margin-left:1px}.rtl .header .header-bottom .nav a{padding:.8em .5em .8em .3em!important}.rtl .header .header-bottom .nav li a>.icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rtl .header .header-bottom .nav>li li:hover>ul{left:unset!important;right:100%!important}.rtl .header .header-bottom .nav ul{left:99999em}.rtl .header .search-responsive .search-content .right{float:left}.rtl .dropdown-list{text-align:right}.rtl .dropdown-list.bottom-right{left:0;right:auto}@media only screen and (max-width:720px){.rtl .header .header-top div.right-content .menu-box{margin-left:0;margin-right:5px}.rtl .header .header-top div.right-content .right-content-menu .account{position:absolute;left:0;right:auto}.rtl .header .header-top div.right-content .right-content-menu>li{padding:0;border:0}.rtl .header .header-top div.right-content .search-box{margin-left:5px}.rtl .header .header-bottom .nav>li{float:none}.rtl .header .header-bottom .nav li>.icon{float:left;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rtl .header .header-bottom .icon.icon-arrow-down{margin-left:5px}}.rtl section.slider-block div.slider-content div.slider-control{left:2%;right:auto}.rtl section.slider-block div.slider-content div.slider-control .slider-left{float:left}.rtl section.slider-block div.slider-content div.slider-control .slider-right{margin-left:5px}@media only screen and (max-width:720px){.rtl section.slider-block div.slider-content div.slider-control{left:0}}.rtl .main-container-wrapper .product-card .sticker{left:auto;right:20px}.rtl .main-container-wrapper .product-card .cart-wish-wrap .addtocart{margin-right:0;margin-left:10px}.rtl section.product-detail div.layouter .form-container div.product-image-group{margin-right:0;margin-left:30px}.rtl section.product-detail div.layouter .form-container div.product-image-group .add-to-buttons{float:left!important}.rtl section.product-detail div.layouter .form-container div .thumb-list{margin-left:4px;margin-right:0}.rtl section.product-detail div.layouter .form-container .details .accordian .accordian-header{padding:20px 0 20px 15px}.rtl section.product-detail div.layouter .form-container .details .accordian .accordian-header .icon{float:left}.rtl section.product-detail div.layouter .form-container .details .accordian .accordian-header .expand-icon{margin-left:10px}.rtl section.product-detail div.layouter .form-container .details .full-specifications td:first-child{padding-right:0;padding-left:40px}.rtl section.product-detail div.layouter .form-container .details .product-ratings .total-reviews{margin-left:0;margin-right:15px}@media only screen and (max-width:720px){.rtl section.product-detail div.layouter .form-container div.product-image-group{margin-right:0;margin-left:0}}.rtl .main .category-container .layered-filter-wrapper,.rtl .main .category-container .responsive-layred-filter{padding-right:0;padding-left:20px}.rtl .main .top-toolbar .pager{float:left}.rtl .main .top-toolbar .pager .view-mode{margin-right:0;margin-left:20px}.rtl .main .top-toolbar .pager .sorter{margin-right:0;margin-left:10px}.rtl .main .top-toolbar .pager label{margin-right:0;margin-left:5px}.rtl .main .top-toolbar .page-info{float:right}.rtl section.review .review-layouter .review-form{margin-left:0;margin-right:20px}.rtl section.review .review-layouter .review-form .heading .right{float:left}.rtl section.review .review-layouter .review-form .ratings-reviews .right-side .rater .star-name{margin-right:0;margin-left:5px}@media only screen and (max-width:770px){.rtl section.review .review-layouter .review-form{margin-right:0}}.rtl section.cart .cart-content .left-side{width:70%;float:right}.rtl section.cart .cart-content .left-side .misc-controls a.link{margin-left:15px;margin-right:0}.rtl section.cart .cart-content .right-side{width:30%;padding-right:40px;padding-left:0}.rtl .order-summary .item-detail label.right,.rtl .payable-amount label.right{float:left}.rtl .item div{margin-left:15px;margin-right:0!important}.rtl .cart-item-list .item .item-details .misc div.qty-text{margin-right:0;margin-left:10px}.rtl .cart-item-list .item .item-details .misc .remove,.rtl .cart-item-list .item .item-details .misc input.box{margin-right:0;margin-left:30px}.rtl .cart-item-list .item .item-details .misc .control-group label{margin-left:15px;margin-right:0}@media only screen and (max-width:770px){.rtl section.cart .cart-content .left-side{width:100%;float:none}.rtl section.cart .cart-content .left-side .misc-controls div button{margin-right:0}.rtl section.cart .cart-content .right-side{width:100%;padding-right:0}}.rtl .checkout-process .col-right{padding-left:0;padding-right:40px}.rtl .checkout-process .col-main{padding-left:40px;padding-right:0}.rtl .checkout-process .col-main ul.checkout-steps li span{margin-right:7px;margin-left:0}.rtl .checkout-process .col-main .step-content .form-header h1{float:right}.rtl .checkout-process .col-main .step-content .form-header .btn{float:left}.rtl .checkout-process .col-main .step-content .payment-methods .control-info{margin-right:28px;margin-left:0}.rtl .checkout-process .col-main .step-content .address .billing-address,.rtl .checkout-process .col-main .step-content .address .pull-left,.rtl .checkout-process .col-main .step-content .order-description .billing-address,.rtl .checkout-process .col-main .step-content .order-description .pull-left{float:right!important}.rtl .checkout-process .col-main .step-content .address .pull-right,.rtl .checkout-process .col-main .step-content .address .shipping-address,.rtl .checkout-process .col-main .step-content .order-description .pull-right,.rtl .checkout-process .col-main .step-content .order-description .shipping-address{float:left!important}.rtl .checkbox,.rtl .radio{margin:10px 0 5px 5px}.rtl .radio .radio-view{margin-left:5px;margin-right:0}.rtl .radio input{right:0;left:auto}@media only screen and (max-width:770px){.rtl .checkout-process .col-main{padding-left:0}}.rtl .account-content .account-layout{margin-left:0;margin-right:40px}.rtl .account-content .menu-block .menubar li{margin-left:0;margin-right:5%}.rtl .account-content .menu-block .menubar li a{text-align:right}.rtl .account-content .menu-block .menubar li .icon{right:unset;left:12px;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rtl .account-head .account-action{float:left}.rtl .account-item-card .media-info .info{margin-right:20px;margin-left:0}.rtl .account-item-card .operations a span{float:left}.rtl .table table{text-align:right}.rtl .sale-container .totals .sale-summary{float:left}.rtl .sale-container .sale-section .section-content .order-box-container{display:-webkit-box;display:flex}@media (max-width:770px){.rtl .account-content .account-layout{margin-right:0}.rtl .account-content .account-layout .account-head .account-action{margin-left:0}.rtl .account-content .sidebar .menu-block .menu-block-title .right{float:left}.rtl .account-content .sidebar .menu-block .menubar>li{margin-right:0}}.rtl .footer .footer-content .footer-list-container .list-container .list-group li span.icon{margin-left:5px;margin-right:0}@media (max-width:720px){.rtl .footer{padding-right:15px;padding-left:10%}.rtl .footer .footer-list-container{padding-right:0!important}}.rtl .cp-spinner{position:absolute;right:calc(50% - 24px);margin-top:calc(40% - 24px)}@media only screen and (max-width:720px){.rtl .cp-spinner{right:50%;margin-right:-24px;left:auto}}.rtl .product-list .product-card .product-information{padding-left:0;padding-right:30px;float:left}.rtl .zoom-image-direction{left:0;right:476px!important}.banner-container{width:100%;float:left;padding:0 18px;margin-bottom:40px}.banner-container .left-banner{padding-right:20px;width:60%;float:left}.banner-container .left-banner img{width:100%}.banner-container .right-banner{padding-left:20px;width:40%;float:left}.banner-container .right-banner img{max-width:100%}.banner-container .right-banner img:first-child{padding-bottom:20px;display:block}.banner-container .right-banner img:last-child{padding-top:20px;display:block}@media (max-width:720px){.banner-container .left-banner{padding-right:0;width:100%}.banner-container .right-banner{padding-left:0;width:100%}.banner-container .right-banner img:first-child{padding-bottom:0;padding-top:25px}.banner-container .right-banner img:last-child{padding-top:25px}}.static-container{display:block;width:100%;padding:10px;margin-left:auto;margin-right:auto}.static-container.one-column{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:start;justify-content:flex-start;-webkit-box-align:start;align-items:flex-start}.static-container.two-column{display:grid;grid-template-columns:48% 48%;grid-column-gap:4%}.static-container.three-column{display:grid;grid-template-columns:30% 30% 30%;grid-column-gap:4%}.item-options{font-size:14px;font-weight:200}.item-options b{font-weight:500} \ No newline at end of file diff --git a/packages/Webkul/Shop/publishable/assets/js/shop.js b/packages/Webkul/Shop/publishable/assets/js/shop.js index 47d0572cf..c8e0ee7b6 100755 --- a/packages/Webkul/Shop/publishable/assets/js/shop.js +++ b/packages/Webkul/Shop/publishable/assets/js/shop.js @@ -1 +1,2 @@ -!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=0)}({0:function(e,t,n){n("J66Q"),e.exports=n("MT9B")},"162o":function(e,t,n){(function(e){var i=void 0!==e&&e||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(r.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new o(r.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n("mypn"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(t,n("DuR2"))},"21It":function(e,t,n){"use strict";var i=n("FtD3");e.exports=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(i("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},"4TI/":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{slides:{type:Array,required:!0,default:function(){return[]}},public_path:{type:String,required:!0}},data:function(){return{images:[],currentIndex:-1,content:[],current:!1,images_loaded:!1}},mounted:function(){this.getProps()},methods:{getProps:function(){this.setProps()},setProps:function(){var e=this;this.slides.forEach(function(t){e.images.push(e.public_path+"/storage/"+t.path),e.content.push(t.content)}),this.currentIndex=0,0==this.images.length?this.images.push="vendor/webkul/shop/assets/images/banner.png":this.images_loaded=!0},changeIndexLeft:function(){this.currentIndex>0?this.currentIndex--:0==this.currentIndex&&(this.currentIndex=this.images.length-1)},changeIndexRight:function(){this.currentIndex0&&t-1 in e)}_.fn=_.prototype={jquery:"3.4.1",constructor:_,length:0,toArray:function(){return u.call(this)},get:function(e){return null==e?u.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=_.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return _.each(this,e)},map:function(e){return this.pushStack(_.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+j+")"+j+"*"),V=new RegExp(j+"|>"),U=new RegExp(I),Y=new RegExp("^"+F+"$"),Z={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+I),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+N+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},G=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+j+"?|("+j+")|.)","ig"),ne=function(e,t,n){var i="0x"+t-65536;return i!=i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},ie=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){f()},se=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{E.apply(O=W.call(x.childNodes),x.childNodes),O[x.childNodes.length].nodeType}catch(e){E={apply:O.length?function(e,t){L.apply(e,W.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function ae(e,t,i,r){var o,a,l,c,d,p,g,y=t&&t.ownerDocument,T=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return i;if(!r&&((t?t.ownerDocument||t:x)!==h&&f(t),t=t||h,m)){if(11!==T&&(d=Q.exec(e)))if(o=d[1]){if(9===T){if(!(l=t.getElementById(o)))return i;if(l.id===o)return i.push(l),i}else if(y&&(l=y.getElementById(o))&&w(t,l)&&l.id===o)return i.push(l),i}else{if(d[2])return E.apply(i,t.getElementsByTagName(e)),i;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return E.apply(i,t.getElementsByClassName(o)),i}if(n.qsa&&!$[e+" "]&&(!v||!v.test(e))&&(1!==T||"object"!==t.nodeName.toLowerCase())){if(g=e,y=t,1===T&&V.test(e)){for((c=t.getAttribute("id"))?c=c.replace(ie,re):t.setAttribute("id",c=b),a=(p=s(e)).length;a--;)p[a]="#"+c+" "+we(p[a]);g=p.join(","),y=ee.test(e)&&ge(t.parentNode)||t}try{return E.apply(i,y.querySelectorAll(g)),i}catch(t){$(e,!0)}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(P,"$1"),t,i,r)}function ue(){var e=[];return function t(n,r){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function le(e){return e[b]=!0,e}function ce(e){var t=h.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=t}function fe(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function he(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&se(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ve(e){return le(function(t){return t=+t,le(function(n,i){for(var r,o=e([],n.length,t),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ae.support={},o=ae.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!G.test(t||n&&n.nodeName||"HTML")},f=ae.setDocument=function(e){var t,r,s=e?e.ownerDocument||e:x;return s!==h&&9===s.nodeType&&s.documentElement?(p=(h=s).documentElement,m=!o(h),x!==h&&(r=h.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",oe,!1):r.attachEvent&&r.attachEvent("onunload",oe)),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(h.getElementsByClassName),n.getById=ce(function(e){return p.appendChild(e).id=b,!h.getElementsByName||!h.getElementsByName(b).length}),n.getById?(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,i,r,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(r=t.getElementsByName(e),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},g=[],v=[],(n.qsa=J.test(h.querySelectorAll))&&(ce(function(e){p.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+j+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+j+"*(?:value|"+N+")"),e.querySelectorAll("[id~="+b+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+j+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=J.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",I)}),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),t=J.test(p.compareDocumentPosition),w=t||J.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return d=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e===h||e.ownerDocument===x&&w(x,e)?-1:t===h||t.ownerDocument===x&&w(x,t)?1:c?M(c,e)-M(c,t):0:4&i?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,i=0,r=e.parentNode,o=t.parentNode,s=[e],a=[t];if(!r||!o)return e===h?-1:t===h?1:r?-1:o?1:c?M(c,e)-M(c,t):0;if(r===o)return fe(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?fe(s[i],a[i]):s[i]===x?-1:a[i]===x?1:0},h):h},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if((e.ownerDocument||e)!==h&&f(e),n.matchesSelector&&m&&!$[t+" "]&&(!g||!g.test(t))&&(!v||!v.test(t)))try{var i=y.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){$(t,!0)}return ae(t,h,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!==h&&f(e),w(e,t)},ae.attr=function(e,t){(e.ownerDocument||e)!==h&&f(e);var r=i.attrHandle[t.toLowerCase()],o=r&&k.call(i.attrHandle,t.toLowerCase())?r(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},ae.escape=function(e){return(e+"").replace(ie,re)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ae.uniqueSort=function(e){var t,i=[],r=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(A),d){for(;t=e[o++];)t===e[o]&&(r=i.push(o));for(;r--;)e.splice(i[r],1)}return c=null,e},r=ae.getText=function(e){var t,n="",i=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=r(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[i++];)n+=r(t);return n},(i=ae.selectors={cacheLength:50,createPseudo:le,match:Z,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Z.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&U.test(n)&&(t=s(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=S[e+" "];return t||(t=new RegExp("(^|"+j+")"+e+"("+j+"|$)"))&&S(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(i){var r=ae.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(R," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,u){var l,c,d,f,h,p,m=o!==s?"nextSibling":"previousSibling",v=t.parentNode,g=a&&t.nodeName.toLowerCase(),y=!u&&!a,w=!1;if(v){if(o){for(;m;){for(f=t;f=f[m];)if(a?f.nodeName.toLowerCase()===g:1===f.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[s?v.firstChild:v.lastChild],s&&y){for(w=(h=(l=(c=(d=(f=v)[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],f=h&&v.childNodes[h];f=++h&&f&&f[m]||(w=h=0)||p.pop();)if(1===f.nodeType&&++w&&f===t){c[e]=[T,h,w];break}}else if(y&&(w=h=(l=(c=(d=(f=t)[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===w)for(;(f=++h&&f&&f[m]||(w=h=0)||p.pop())&&((a?f.nodeName.toLowerCase()!==g:1!==f.nodeType)||!++w||(y&&((c=(d=f[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]=[T,w]),f!==t)););return(w-=r)===i||w%i==0&&w/i>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ae.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,n){for(var i,o=r(e,t),s=o.length;s--;)e[i=M(e,o[s])]=!(n[i]=o[s])}):function(e){return r(e,0,n)}):r}},pseudos:{not:le(function(e){var t=[],n=[],i=a(e.replace(P,"$1"));return i[b]?le(function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:le(function(e){return function(t){return ae(e,t).length>0}}),contains:le(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||r(t)).indexOf(e)>-1}}),lang:le(function(e){return Y.test(e||"")||ae.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;nt?t:n;--i>=0;)e.push(i);return e}),gt:ve(function(e,t,n){for(var i=n<0?n+t:n;++i1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function Te(e,t,n,i,r){for(var o,s=[],a=0,u=e.length,l=null!=t;a-1&&(o[l]=!(s[l]=d))}}else g=Te(g===s?g.splice(p,g.length):g),r?r(null,s,g,u):E.apply(s,g)})}function Se(e){for(var t,n,r,o=e.length,s=i.relative[e[0].type],a=s||i.relative[" "],u=s?1:0,c=be(function(e){return e===t},a,!0),d=be(function(e){return M(t,e)>-1},a,!0),f=[function(e,n,i){var r=!s&&(i||n!==l)||((t=n).nodeType?c(e,n,i):d(e,n,i));return t=null,r}];u1&&xe(f),u>1&&we(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(P,"$1"),n,u0,r=e.length>0,o=function(o,s,a,u,c){var d,p,v,g=0,y="0",w=o&&[],b=[],x=l,_=o||r&&i.find.TAG("*",c),S=T+=null==x?1:Math.random()||.1,C=_.length;for(c&&(l=s===h||s||c);y!==C&&null!=(d=_[y]);y++){if(r&&d){for(p=0,s||d.ownerDocument===h||(f(d),a=!m);v=e[p++];)if(v(d,s||h,a)){u.push(d);break}c&&(T=S)}n&&((d=!v&&d)&&g--,o&&w.push(d))}if(g+=y,n&&y!==g){for(p=0;v=t[p++];)v(w,b,s,a);if(o){if(g>0)for(;y--;)w[y]||b[y]||(b[y]=D.call(u));b=Te(b)}E.apply(u,b),c&&!o&&b.length>0&&g+t.length>1&&ae.uniqueSort(u)}return c&&(T=S,l=x),w};return n?le(o):o}(o,r))).selector=e}return a},u=ae.select=function(e,t,n,r){var o,u,l,c,d,f="function"==typeof e&&e,h=!r&&s(e=f.selector||e);if(n=n||[],1===h.length){if((u=h[0]=h[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&m&&i.relative[u[1].type]){if(!(t=(i.find.ID(l.matches[0].replace(te,ne),t)||[])[0]))return n;f&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=Z.needsContext.test(e)?0:u.length;o--&&(l=u[o],!i.relative[c=l.type]);)if((d=i.find[c])&&(r=d(l.matches[0].replace(te,ne),ee.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=r.length&&we(u)))return E.apply(n,r),n;break}}return(f||a(e,h))(r,t,!m,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(A).join("")===b,n.detectDuplicates=!!d,f(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(h.createElement("fieldset"))}),ce(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(N,function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null}),ae}(n);_.find=z,_.expr=z.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=z.uniqueSort,_.text=z.getText,_.isXMLDoc=z.isXML,_.contains=z.contains,_.escapeSelector=z.escape;var $=function(e,t,n){for(var i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&_(e).is(n))break;i.push(e)}return i},A=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=_.expr.match.needsContext;function O(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(e,t,n){return y(t)?_.grep(e,function(e,i){return!!t.call(e,i,e)!==n}):t.nodeType?_.grep(e,function(e){return e===t!==n}):"string"!=typeof t?_.grep(e,function(e){return d.call(t,e)>-1!==n}):_.filter(t,e,n)}_.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?_.find.matchesSelector(i,e)?[i]:[]:_.find.matches(e,_.grep(t,function(e){return 1===e.nodeType}))},_.fn.extend({find:function(e){var t,n,i=this.length,r=this;if("string"!=typeof e)return this.pushStack(_(e).filter(function(){for(t=0;t1?_.uniqueSort(n):n},filter:function(e){return this.pushStack(L(this,e||[],!1))},not:function(e){return this.pushStack(L(this,e||[],!0))},is:function(e){return!!L(this,"string"==typeof e&&k.test(e)?_(e):e||[],!1).length}});var E,W=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||E,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:W.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof _?t[0]:t,_.merge(this,_.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:s,!0)),D.test(i[1])&&_.isPlainObject(t))for(i in t)y(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(r=s.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):y(e)?void 0!==n.ready?n.ready(e):e(_):_.makeArray(e,this)}).prototype=_.fn,E=_(s);var M=/^(?:parents|prev(?:Until|All))/,N={children:!0,contents:!0,next:!0,prev:!0};function j(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}_.fn.extend({has:function(e){var t=_(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&_.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?_.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?d.call(_(e),this[0]):d.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),_.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return $(e,"parentNode")},parentsUntil:function(e,t,n){return $(e,"parentNode",n)},next:function(e){return j(e,"nextSibling")},prev:function(e){return j(e,"previousSibling")},nextAll:function(e){return $(e,"nextSibling")},prevAll:function(e){return $(e,"previousSibling")},nextUntil:function(e,t,n){return $(e,"nextSibling",n)},prevUntil:function(e,t,n){return $(e,"previousSibling",n)},siblings:function(e){return A((e.parentNode||{}).firstChild,e)},children:function(e){return A(e.firstChild)},contents:function(e){return void 0!==e.contentDocument?e.contentDocument:(O(e,"template")&&(e=e.content||e),_.merge([],e.childNodes))}},function(e,t){_.fn[e]=function(n,i){var r=_.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=_.filter(i,r)),this.length>1&&(N[e]||_.uniqueSort(r),M.test(e)&&r.reverse()),this.pushStack(r)}});var F=/[^\x20\t\r\n\f]+/g;function H(e){return e}function I(e){throw e}function R(e,t,n,i){var r;try{e&&y(r=e.promise)?r.call(e).done(t).fail(n):e&&y(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(i))}catch(e){n.apply(void 0,[e])}}_.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return _.each(e.match(F)||[],function(e,n){t[n]=!0}),t}(e):_.extend({},e);var t,n,i,r,o=[],s=[],a=-1,u=function(){for(r=r||e.once,i=t=!0;s.length;a=-1)for(n=s.shift();++a-1;)o.splice(n,1),n<=a&&a--}),this},has:function(e){return e?_.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||t||(o=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!i}};return l},_.extend({Deferred:function(e){var t=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return _.Deferred(function(n){_.each(t,function(t,i){var r=y(e[i[4]])&&e[i[4]];o[i[1]](function(){var e=r&&r.apply(this,arguments);e&&y(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[e]:arguments)})}),e=null}).promise()},then:function(e,i,r){var o=0;function s(e,t,i,r){return function(){var a=this,u=arguments,l=function(){var n,l;if(!(e=o&&(i!==I&&(a=void 0,u=[n]),t.rejectWith(a,u))}};e?c():(_.Deferred.getStackHook&&(c.stackTrace=_.Deferred.getStackHook()),n.setTimeout(c))}}return _.Deferred(function(n){t[0][3].add(s(0,n,y(r)?r:H,n.notifyWith)),t[1][3].add(s(0,n,y(e)?e:H)),t[2][3].add(s(0,n,y(i)?i:I))}).promise()},promise:function(e){return null!=e?_.extend(e,r):r}},o={};return _.each(t,function(e,n){var s=n[2],a=n[5];r[n[1]]=s.add,a&&s.add(function(){i=a},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),s.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=s.fireWith}),r.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,i=Array(n),r=u.call(arguments),o=_.Deferred(),s=function(e){return function(n){i[e]=this,r[e]=arguments.length>1?u.call(arguments):n,--t||o.resolveWith(i,r)}};if(t<=1&&(R(e,o.done(s(n)).resolve,o.reject,!t),"pending"===o.state()||y(r[n]&&r[n].then)))return o.then();for(;n--;)R(r[n],s(n),o.reject);return o.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&P.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},_.readyException=function(e){n.setTimeout(function(){throw e})};var B=_.Deferred();function q(){s.removeEventListener("DOMContentLoaded",q),n.removeEventListener("load",q),_.ready()}_.fn.ready=function(e){return B.then(e).catch(function(e){_.readyException(e)}),this},_.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==e&&--_.readyWait>0||B.resolveWith(s,[_]))}}),_.ready.then=B.then,"complete"===s.readyState||"loading"!==s.readyState&&!s.documentElement.doScroll?n.setTimeout(_.ready):(s.addEventListener("DOMContentLoaded",q),n.addEventListener("load",q));var V=function(e,t,n,i,r,o,s){var a=0,u=e.length,l=null==n;if("object"===T(n))for(a in r=!0,n)V(e,t,a,n[a],!0,o,s);else if(void 0!==i&&(r=!0,y(i)||(s=!0),l&&(s?(t.call(e,i),t=null):(l=t,t=function(e,t,n){return l.call(_(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),_.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=J.get(e,t),n&&(!i||Array.isArray(n)?i=J.access(e,t,_.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=_.queue(e,t),i=n.length,r=n.shift(),o=_._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete o.stop,r.call(e,function(){_.dequeue(e,t)},o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:_.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),_.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ge=/^$|^module$|\/(?:java|ecma)script/i,ye={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function we(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&O(e,t)?_.merge([e],n):n}function be(e,t){for(var n=0,i=e.length;n-1)r&&r.push(o);else if(l=ae(o),s=we(d.appendChild(o),"script"),l&&be(s),n)for(c=0;o=s[c++];)ge.test(o.type||"")&&n.push(o);return d}xe=s.createDocumentFragment().appendChild(s.createElement("div")),(Te=s.createElement("input")).setAttribute("type","radio"),Te.setAttribute("checked","checked"),Te.setAttribute("name","t"),xe.appendChild(Te),g.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",g.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue;var Ce=/^key/,ze=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,$e=/^([^.]*)(?:\.(.+)|)/;function Ae(){return!0}function ke(){return!1}function Oe(e,t){return e===function(){try{return s.activeElement}catch(e){}}()==("focus"===t)}function De(e,t,n,i,r,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(i=i||n,n=void 0),t)De(e,a,n,i,t[a],o);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=ke;else if(!r)return e;return 1===o&&(s=r,(r=function(e){return _().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=_.guid++)),e.each(function(){_.event.add(this,t,r,i,n)})}function Le(e,t,n){n?(J.set(e,t,!1),_.event.add(e,t,{namespace:!1,handler:function(e){var i,r,o=J.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(_.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=u.call(arguments),J.set(this,t,o),i=n(this,t),this[t](),o!==(r=J.get(this,t))||i?J.set(this,t,!1):r={},o!==r)return e.stopImmediatePropagation(),e.preventDefault(),r.value}else o.length&&(J.set(this,t,{value:_.event.trigger(_.extend(o[0],_.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===J.get(e,t)&&_.event.add(e,t,Ae)}_.event={global:{},add:function(e,t,n,i,r){var o,s,a,u,l,c,d,f,h,p,m,v=J.get(e);if(v)for(n.handler&&(n=(o=n).handler,r=o.selector),r&&_.find.matchesSelector(se,r),n.guid||(n.guid=_.guid++),(u=v.events)||(u=v.events={}),(s=v.handle)||(s=v.handle=function(t){return void 0!==_&&_.event.triggered!==t.type?_.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(F)||[""]).length;l--;)h=m=(a=$e.exec(t[l])||[])[1],p=(a[2]||"").split(".").sort(),h&&(d=_.event.special[h]||{},h=(r?d.delegateType:d.bindType)||h,d=_.event.special[h]||{},c=_.extend({type:h,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&_.expr.match.needsContext.test(r),namespace:p.join(".")},o),(f=u[h])||((f=u[h]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,i,p,s)||e.addEventListener&&e.addEventListener(h,s)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),r?f.splice(f.delegateCount++,0,c):f.push(c),_.event.global[h]=!0)},remove:function(e,t,n,i,r){var o,s,a,u,l,c,d,f,h,p,m,v=J.hasData(e)&&J.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(F)||[""]).length;l--;)if(h=m=(a=$e.exec(t[l])||[])[1],p=(a[2]||"").split(".").sort(),h){for(d=_.event.special[h]||{},f=u[h=(i?d.delegateType:d.bindType)||h]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;o--;)c=f[o],!r&&m!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,d.remove&&d.remove.call(e,c));s&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,p,v.handle)||_.removeEvent(e,h,v.handle),delete u[h])}else for(h in u)_.event.remove(e,h+t[l],n,i,!0);_.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,o,s,a=_.event.fix(e),u=new Array(arguments.length),l=(J.get(this,"events")||{})[a.type]||[],c=_.event.special[a.type]||{};for(u[0]=a,t=1;t=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],s={},n=0;n-1:_.find(r,this,null,[l]).length),s[r]&&o.push(i);o.length&&a.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,We=/\s*$/g;function je(e,t){return O(e,"table")&&O(11!==t.nodeType?t:t.firstChild,"tr")&&_(e).children("tbody")[0]||e}function Fe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ie(e,t){var n,i,r,o,s,a,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),s=J.set(t,o),l=o.events))for(r in delete s.handle,s.events={},l)for(n=0,i=l[r].length;n1&&"string"==typeof p&&!g.checkClone&&Me.test(p))return e.each(function(r){var o=e.eq(r);m&&(t[0]=p.call(this,r,o.html())),Re(o,t,n,i)});if(f&&(o=(r=Se(t,e[0].ownerDocument,!1,e,i)).firstChild,1===r.childNodes.length&&(r=o),o||i)){for(a=(s=_.map(we(r,"script"),Fe)).length;d")},clone:function(e,t,n){var i,r,o,s,a,u,l,c=e.cloneNode(!0),d=ae(e);if(!(g.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||_.isXMLDoc(e)))for(s=we(c),i=0,r=(o=we(e)).length;i0&&be(s,!d&&we(e,"script")),c},cleanData:function(e){for(var t,n,i,r=_.event.special,o=0;void 0!==(n=e[o]);o++)if(X(n)){if(t=n[J.expando]){if(t.events)for(i in t.events)r[i]?_.event.remove(n,i):_.removeEvent(n,i,t.handle);n[J.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),_.fn.extend({detach:function(e){return Pe(this,e,!0)},remove:function(e){return Pe(this,e)},text:function(e){return V(this,function(e){return void 0===e?_.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(_.cleanData(we(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return _.clone(this,e,t)})},html:function(e){return V(this,function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!We.test(e)&&!ye[(ve.exec(e)||["",""])[1].toLowerCase()]){e=_.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-a-.5))||0),u}function rt(e,t,n){var i=qe(e),r=(!g.boxSizingReliable()||n)&&"border-box"===_.css(e,"boxSizing",!1,i),o=r,s=Ue(e,t,i),a="offset"+t[0].toUpperCase()+t.slice(1);if(Be.test(s)){if(!n)return s;s="auto"}return(!g.boxSizingReliable()&&r||"auto"===s||!parseFloat(s)&&"inline"===_.css(e,"display",!1,i))&&e.getClientRects().length&&(r="border-box"===_.css(e,"boxSizing",!1,i),(o=a in e)&&(s=e[a])),(s=parseFloat(s)||0)+it(e,t,n||(r?"border":"content"),o,i,s)+"px"}function ot(e,t,n,i,r){return new ot.prototype.init(e,t,n,i,r)}_.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ue(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,o,s,a=G(t),u=Qe.test(t),l=e.style;if(u||(t=Ke(a)),s=_.cssHooks[t]||_.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(e,!1,i))?r:l[t];"string"===(o=typeof n)&&(r=re.exec(n))&&r[1]&&(n=de(e,t,r),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=r&&r[3]||(_.cssNumber[a]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,i))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,i){var r,o,s,a=G(t);return Qe.test(t)||(t=Ke(a)),(s=_.cssHooks[t]||_.cssHooks[a])&&"get"in s&&(r=s.get(e,!0,n)),void 0===r&&(r=Ue(e,t,i)),"normal"===r&&t in tt&&(r=tt[t]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),_.each(["height","width"],function(e,t){_.cssHooks[t]={get:function(e,n,i){if(n)return!Je.test(_.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?rt(e,t,i):ce(e,et,function(){return rt(e,t,i)})},set:function(e,n,i){var r,o=qe(e),s=!g.scrollboxSize()&&"absolute"===o.position,a=(s||i)&&"border-box"===_.css(e,"boxSizing",!1,o),u=i?it(e,t,i,a,o):0;return a&&s&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-it(e,t,"border",!1,o)-.5)),u&&(r=re.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=_.css(e,t)),nt(0,n,u)}}}),_.cssHooks.marginLeft=Ye(g.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ue(e,"marginLeft"))||e.getBoundingClientRect().left-ce(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),_.each({margin:"",padding:"",border:"Width"},function(e,t){_.cssHooks[e+t]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[e+oe[i]+t]=o[i]||o[i-2]||o[0];return r}},"margin"!==e&&(_.cssHooks[e+t].set=nt)}),_.fn.extend({css:function(e,t){return V(this,function(e,t,n){var i,r,o={},s=0;if(Array.isArray(t)){for(i=qe(e),r=t.length;s1)}}),_.Tween=ot,ot.prototype={constructor:ot,init:function(e,t,n,i,r,o){this.elem=e,this.prop=n,this.easing=r||_.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(_.cssNumber[n]?"":"px")},cur:function(){var e=ot.propHooks[this.prop];return e&&e.get?e.get(this):ot.propHooks._default.get(this)},run:function(e){var t,n=ot.propHooks[this.prop];return this.options.duration?this.pos=t=_.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ot.propHooks._default.set(this),this}},ot.prototype.init.prototype=ot.prototype,ot.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=_.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){_.fx.step[e.prop]?_.fx.step[e.prop](e):1!==e.elem.nodeType||!_.cssHooks[e.prop]&&null==e.elem.style[Ke(e.prop)]?e.elem[e.prop]=e.now:_.style(e.elem,e.prop,e.now+e.unit)}}},ot.propHooks.scrollTop=ot.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},_.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},_.fx=ot.prototype.init,_.fx.step={};var st,at,ut=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function ct(){at&&(!1===s.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ct):n.setTimeout(ct,_.fx.interval),_.fx.tick())}function dt(){return n.setTimeout(function(){st=void 0}),st=Date.now()}function ft(e,t){var n,i=0,r={height:e};for(t=t?1:0;i<4;i+=2-t)r["margin"+(n=oe[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function ht(e,t,n){for(var i,r=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,s=r.length;o1)},removeAttr:function(e){return this.each(function(){_.removeAttr(this,e)})}}),_.extend({attr:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?_.prop(e,t,n):(1===o&&_.isXMLDoc(e)||(r=_.attrHooks[t.toLowerCase()]||(_.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void _.removeAttr(e,t):r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=_.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&O(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i=0,r=t&&t.match(F);if(r&&1===e.nodeType)for(;n=r[i++];)e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?_.removeAttr(e,n):e.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),function(e,t){var n=vt[t]||_.find.attr;vt[t]=function(e,t,i){var r,o,s=t.toLowerCase();return i||(o=vt[s],vt[s]=r,r=null!=n(e,t,i)?s:null,vt[s]=o),r}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;function wt(e){return(e.match(F)||[]).join(" ")}function bt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(F)||[]}_.fn.extend({prop:function(e,t){return V(this,_.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[_.propFix[e]||e]})}}),_.extend({prop:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&_.isXMLDoc(e)||(t=_.propFix[t]||t,r=_.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=_.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(_.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this}),_.fn.extend({addClass:function(e){var t,n,i,r,o,s,a,u=0;if(y(e))return this.each(function(t){_(this).addClass(e.call(this,t,bt(this)))});if((t=xt(e)).length)for(;n=this[u++];)if(r=bt(n),i=1===n.nodeType&&" "+wt(r)+" "){for(s=0;o=t[s++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");r!==(a=wt(i))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,i,r,o,s,a,u=0;if(y(e))return this.each(function(t){_(this).removeClass(e.call(this,t,bt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)for(;n=this[u++];)if(r=bt(n),i=1===n.nodeType&&" "+wt(r)+" "){for(s=0;o=t[s++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");r!==(a=wt(i))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e,i="string"===n||Array.isArray(e);return"boolean"==typeof t&&i?t?this.addClass(e):this.removeClass(e):y(e)?this.each(function(n){_(this).toggleClass(e.call(this,n,bt(this),t),t)}):this.each(function(){var t,r,o,s;if(i)for(r=0,o=_(this),s=xt(e);t=s[r++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=bt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&(" "+wt(bt(n))+" ").indexOf(t)>-1)return!0;return!1}});var Tt=/\r/g;_.fn.extend({val:function(e){var t,n,i,r=this[0];return arguments.length?(i=y(e),this.each(function(n){var r;1===this.nodeType&&(null==(r=i?e.call(this,n,_(this).val()):e)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=_.map(r,function(e){return null==e?"":e+""})),(t=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))})):r?(t=_.valHooks[r.type]||_.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(Tt,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(e){var t=_.find.attr(e,"value");return null!=t?t:wt(_.text(e))}},select:{get:function(e){var t,n,i,r=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],u=s?o+1:r.length;for(i=o<0?u:s?o:0;i-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=_.inArray(_(e).val(),t)>-1}},g.checkOn||(_.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),g.focusin="onfocusin"in n;var _t=/^(?:focusinfocus|focusoutblur)$/,St=function(e){e.stopPropagation()};_.extend(_.event,{trigger:function(e,t,i,r){var o,a,u,l,c,d,f,h,m=[i||s],v=p.call(e,"type")?e.type:e,g=p.call(e,"namespace")?e.namespace.split("."):[];if(a=h=u=i=i||s,3!==i.nodeType&&8!==i.nodeType&&!_t.test(v+_.event.triggered)&&(v.indexOf(".")>-1&&(v=(g=v.split(".")).shift(),g.sort()),c=v.indexOf(":")<0&&"on"+v,(e=e[_.expando]?e:new _.Event(v,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),t=null==t?[e]:_.makeArray(t,[e]),f=_.event.special[v]||{},r||!f.trigger||!1!==f.trigger.apply(i,t))){if(!r&&!f.noBubble&&!w(i)){for(l=f.delegateType||v,_t.test(l+v)||(a=a.parentNode);a;a=a.parentNode)m.push(a),u=a;u===(i.ownerDocument||s)&&m.push(u.defaultView||u.parentWindow||n)}for(o=0;(a=m[o++])&&!e.isPropagationStopped();)h=a,e.type=o>1?l:f.bindType||v,(d=(J.get(a,"events")||{})[e.type]&&J.get(a,"handle"))&&d.apply(a,t),(d=c&&a[c])&&d.apply&&X(a)&&(e.result=d.apply(a,t),!1===e.result&&e.preventDefault());return e.type=v,r||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(m.pop(),t)||!X(i)||c&&y(i[v])&&!w(i)&&((u=i[c])&&(i[c]=null),_.event.triggered=v,e.isPropagationStopped()&&h.addEventListener(v,St),i[v](),e.isPropagationStopped()&&h.removeEventListener(v,St),_.event.triggered=void 0,u&&(i[c]=u)),e.result}},simulate:function(e,t,n){var i=_.extend(new _.Event,n,{type:e,isSimulated:!0});_.event.trigger(i,null,t)}}),_.fn.extend({trigger:function(e,t){return this.each(function(){_.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return _.event.trigger(e,t,n,!0)}}),g.focusin||_.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){_.event.simulate(t,e.target,_.event.fix(e))};_.event.special[t]={setup:function(){var i=this.ownerDocument||this,r=J.access(i,t);r||i.addEventListener(e,n,!0),J.access(i,t,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=J.access(i,t)-1;r?J.access(i,t,r):(i.removeEventListener(e,n,!0),J.remove(i,t))}}});var Ct=n.location,zt=Date.now(),$t=/\?/;_.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||_.error("Invalid XML: "+e),t};var At=/\[\]$/,kt=/\r?\n/g,Ot=/^(?:submit|button|image|reset|file)$/i,Dt=/^(?:input|select|textarea|keygen)/i;function Lt(e,t,n,i){var r;if(Array.isArray(t))_.each(t,function(t,r){n||At.test(e)?i(e,r):Lt(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,i)});else if(n||"object"!==T(t))i(e,t);else for(r in t)Lt(e+"["+r+"]",t[r],n,i)}_.param=function(e,t){var n,i=[],r=function(e,t){var n=y(t)?t():t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!_.isPlainObject(e))_.each(e,function(){r(this.name,this.value)});else for(n in e)Lt(n,e[n],t,r);return i.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=_.prop(this,"elements");return e?_.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!_(this).is(":disabled")&&Dt.test(this.nodeName)&&!Ot.test(e)&&(this.checked||!me.test(e))}).map(function(e,t){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var Et=/%20/g,Wt=/#.*$/,Mt=/([?&])_=[^&]*/,Nt=/^(.*?):[ \t]*([^\r\n]*)$/gm,jt=/^(?:GET|HEAD)$/,Ft=/^\/\//,Ht={},It={},Rt="*/".concat("*"),Pt=s.createElement("a");function Bt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,o=t.toLowerCase().match(F)||[];if(y(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function qt(e,t,n,i){var r={},o=e===It;function s(a){var u;return r[a]=!0,_.each(e[a]||[],function(e,a){var l=a(t,n,i);return"string"!=typeof l||o||r[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),s(l),!1)}),u}return s(t.dataTypes[0])||!r["*"]&&s("*")}function Vt(e,t){var n,i,r=_.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&_.extend(!0,e,i),e}Pt.href=Ct.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Vt(Vt(e,_.ajaxSettings),t):Vt(_.ajaxSettings,e)},ajaxPrefilter:Bt(Ht),ajaxTransport:Bt(It),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,r,o,a,u,l,c,d,f,h,p=_.ajaxSetup({},t),m=p.context||p,v=p.context&&(m.nodeType||m.jquery)?_(m):_.event,g=_.Deferred(),y=_.Callbacks("once memory"),w=p.statusCode||{},b={},x={},T="canceled",S={readyState:0,getResponseHeader:function(e){var t;if(c){if(!a)for(a={};t=Nt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)S.always(e[S.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||T;return i&&i.abort(t),C(0,t),this}};if(g.promise(S),p.url=((e||p.url||Ct.href)+"").replace(Ft,Ct.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(F)||[""],null==p.crossDomain){l=s.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Pt.protocol+"//"+Pt.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=_.param(p.data,p.traditional)),qt(Ht,p,t,S),c)return S;for(f in(d=_.event&&p.global)&&0==_.active++&&_.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!jt.test(p.type),r=p.url.replace(Wt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Et,"+")):(h=p.url.slice(r.length),p.data&&(p.processData||"string"==typeof p.data)&&(r+=($t.test(r)?"&":"?")+p.data,delete p.data),!1===p.cache&&(r=r.replace(Mt,"$1"),h=($t.test(r)?"&":"?")+"_="+zt+++h),p.url=r+h),p.ifModified&&(_.lastModified[r]&&S.setRequestHeader("If-Modified-Since",_.lastModified[r]),_.etag[r]&&S.setRequestHeader("If-None-Match",_.etag[r])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&S.setRequestHeader("Content-Type",p.contentType),S.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Rt+"; q=0.01":""):p.accepts["*"]),p.headers)S.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(m,S,p)||c))return S.abort();if(T="abort",y.add(p.complete),S.done(p.success),S.fail(p.error),i=qt(It,p,t,S)){if(S.readyState=1,d&&v.trigger("ajaxSend",[S,p]),c)return S;p.async&&p.timeout>0&&(u=n.setTimeout(function(){S.abort("timeout")},p.timeout));try{c=!1,i.send(b,C)}catch(e){if(c)throw e;C(-1,e)}}else C(-1,"No Transport");function C(e,t,s,a){var l,f,h,b,x,T=t;c||(c=!0,u&&n.clearTimeout(u),i=void 0,o=a||"",S.readyState=e>0?4:0,l=e>=200&&e<300||304===e,s&&(b=function(e,t,n){for(var i,r,o,s,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){u.unshift(r);break}if(u[0]in n)o=u[0];else{for(r in n){if(!u[0]||e.converters[r+" "+u[0]]){o=r;break}s||(s=r)}o=o||s}if(o)return o!==u[0]&&u.unshift(o),n[o]}(p,S,s)),b=function(e,t,n,i){var r,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(s=l[u+" "+o]||l["* "+o]))for(r in l)if((a=r.split(" "))[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){!0===s?s=l[r]:!0!==l[r]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(p,b,S,l),l?(p.ifModified&&((x=S.getResponseHeader("Last-Modified"))&&(_.lastModified[r]=x),(x=S.getResponseHeader("etag"))&&(_.etag[r]=x)),204===e||"HEAD"===p.type?T="nocontent":304===e?T="notmodified":(T=b.state,f=b.data,l=!(h=b.error))):(h=T,!e&&T||(T="error",e<0&&(e=0))),S.status=e,S.statusText=(t||T)+"",l?g.resolveWith(m,[f,T,S]):g.rejectWith(m,[S,T,h]),S.statusCode(w),w=void 0,d&&v.trigger(l?"ajaxSuccess":"ajaxError",[S,p,l?f:h]),y.fireWith(m,[S,T]),d&&(v.trigger("ajaxComplete",[S,p]),--_.active||_.event.trigger("ajaxStop")))}return S},getJSON:function(e,t,n){return _.get(e,t,n,"json")},getScript:function(e,t){return _.get(e,void 0,t,"script")}}),_.each(["get","post"],function(e,t){_[t]=function(e,n,i,r){return y(n)&&(r=r||i,i=n,n=void 0),_.ajax(_.extend({url:e,type:t,dataType:r,data:n,success:i},_.isPlainObject(e)&&e))}}),_._evalUrl=function(e,t){return _.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){_.globalEval(e,t)}})},_.fn.extend({wrapAll:function(e){var t;return this[0]&&(y(e)&&(e=e.call(this[0])),t=_(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return y(e)?this.each(function(t){_(this).wrapInner(e.call(this,t))}):this.each(function(){var t=_(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=y(e);return this.each(function(n){_(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){_(this).replaceWith(this.childNodes)}),this}}),_.expr.pseudos.hidden=function(e){return!_.expr.pseudos.visible(e)},_.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Yt=_.ajaxSettings.xhr();g.cors=!!Yt&&"withCredentials"in Yt,g.ajax=Yt=!!Yt,_.ajaxTransport(function(e){var t,i;if(g.cors||Yt&&!e.crossDomain)return{send:function(r,o){var s,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(s in e.xhrFields)a[s]=e.xhrFields[s];for(s in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(s,r[s]);t=function(e){return function(){t&&(t=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Ut[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=t(),i=a.onerror=a.ontimeout=t("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout(function(){t&&i()})},t=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),_.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return _.globalEval(e),e}}}),_.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),_.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(i,r){t=_(" + + +@endif \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php index 269fc5ca4..294c0c5b6 100755 --- a/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php @@ -25,7 +25,7 @@
- +
@@ -33,7 +33,7 @@ {!! view_render_event('bagisto.shop.checkout.cart.item.name.before', ['item' => $item]) !!} @@ -127,6 +127,8 @@ @include('shop::checkout.total.summary', ['cart' => $cart]) + + {!! view_render_event('bagisto.shop.checkout.cart.summary.after', ['cart' => $cart]) !!}
@@ -155,6 +157,7 @@ @endsection @push('scripts') + @include('shop::checkout.cart.coupon') diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php index bbab890a3..70d5d87d6 100755 --- a/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php @@ -24,15 +24,12 @@
@endif -
base_discount_amount && $cart->base_discount_amount > 0) style="display: block;" @else style="display: none;" @endif>
@@ -43,36 +40,4 @@ {{ core()->currency($cart->base_grand_total) }} - -
is('checkout/cart')) v-if="parseInt(discount)" @endif> - @if (! request()->is('checkout/cart')) - @if (! $cart->coupon_code) -
-
-
-
- -
- -
* @{{ error_message }}
- - -
-
-
- @else -
-
- - - -
-
- @endif - @endif -
\ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/cms/page.blade.php b/packages/Webkul/Shop/src/Resources/views/cms/page.blade.php index 85c4c43c3..fe29692bd 100644 --- a/packages/Webkul/Shop/src/Resources/views/cms/page.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/cms/page.blade.php @@ -4,26 +4,14 @@ {{ $page->page_title }} @endsection -@section('head') - @isset($page->meta_title) - - @endisset +@section('seo') + - @isset($page->meta_description) - - @endisset + - @isset($page->meta_keywords) - - @endisset - - + @endsection @section('content-wrapper') {!! DbView::make($page)->field('html_content')->render() !!} -@endsection - -@push('scripts') - -@endpush \ No newline at end of file +@endsection \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/index.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/index.blade.php index 0e24927d6..a456ae557 100755 --- a/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/index.blade.php @@ -36,13 +36,13 @@
getProductBaseImage($review->product); ?> - +
diff --git a/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php b/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php index 6880d5204..b315da0f1 100755 --- a/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php @@ -76,7 +76,7 @@ @if (core()->getConfigData('general.content.footer.footer_content')) {{ core()->getConfigData('general.content.footer.footer_content') }} @else - {{ trans('admin::app.footer.copy-right') }} + {!! trans('admin::app.footer.copy-right') !!} @endif

diff --git a/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php b/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php index 7ffea6397..05be15dbe 100755 --- a/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php @@ -173,7 +173,7 @@ 0, 0 ], - max: {{ core()->convertPrice($productFlatRepository->getCategoryProductMaximumPrice($category)) }}, + max: {{ core()->convertPrice($productFlatRepository->getCategoryProductMaximumPrice($category)) ?? 0 }}, processStyle: { "backgroundColor": "#FF6472" }, diff --git a/packages/Webkul/Shop/src/Resources/views/products/reviews/create.blade.php b/packages/Webkul/Shop/src/Resources/views/products/reviews/create.blade.php index 0ce797b32..2c1867cfc 100755 --- a/packages/Webkul/Shop/src/Resources/views/products/reviews/create.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/reviews/create.blade.php @@ -64,7 +64,7 @@ @{{ errors.first('title') }}
- @if ($guest_review && ! auth()->guard('customer')->user()) + @if (core()->getConfigData('catalog.products.review.guest_review') && ! auth()->guard('customer')->user())
diff --git a/packages/Webkul/Shop/webpack.mix.js b/packages/Webkul/Shop/webpack.mix.js index 90624253c..3554980f1 100755 --- a/packages/Webkul/Shop/webpack.mix.js +++ b/packages/Webkul/Shop/webpack.mix.js @@ -22,6 +22,10 @@ mix.js([__dirname + "/src/Resources/assets/js/app.js"], "js/shop.js") processCssUrls: false }); +if (!mix.inProduction()) { + mix.sourceMaps(); +} + if (mix.inProduction()) { mix.version(); } diff --git a/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php b/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php index 0bc539456..e67ca4d39 100755 --- a/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php +++ b/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php @@ -77,7 +77,6 @@ class TaxRateController extends Controller 'zip_code' => 'sometimes|required_without:is_zip', 'zip_from' => 'nullable|required_with:is_zip', 'zip_to' => 'nullable|required_with:is_zip,zip_from', - 'state' => 'required|string', 'country' => 'required|string', 'tax_rate' => 'required|numeric|min:0.0001' ]); @@ -125,7 +124,6 @@ class TaxRateController extends Controller 'is_zip' => 'sometimes', 'zip_from' => 'nullable|required_with:is_zip', 'zip_to' => 'nullable|required_with:is_zip,zip_from', - 'state' => 'required|string', 'country' => 'required|string', 'tax_rate' => 'required|numeric|min:0.0001' ]); diff --git a/packages/Webkul/Ui/package.json b/packages/Webkul/Ui/package.json index 798f7716e..5afcb9705 100755 --- a/packages/Webkul/Ui/package.json +++ b/packages/Webkul/Ui/package.json @@ -10,16 +10,16 @@ "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { - "axios": "^0.18", - "cross-env": "^5.1.4", - "laravel-mix": "^2.1", - "laravel-mix-merge-manifest": "^0.1.1", - "jquery": "^3.2", - "vue": "^2.1.10", - "flatpickr": "^4.4.6" + "axios": "^0.19.0", + "cross-env": "^6.0.3", + "flatpickr": "^4.6.3", + "jquery": "^3.4.1", + "laravel-mix": "^5.0.0", + "laravel-mix-merge-manifest": "^0.1.2", + "vue": "^2.6.10" }, "dependencies": { - "@babel/polyfill": "^7.4.4", + "@babel/polyfill": "^7.7.0", "tooltip.js": "^1.3.1", "url-polyfill": "^1.1.5", "url-search-params-polyfill": "^6.0.0", diff --git a/packages/Webkul/Ui/publishable/assets/css/ui.css b/packages/Webkul/Ui/publishable/assets/css/ui.css index cdbd4622c..3078a0825 100644 --- a/packages/Webkul/Ui/publishable/assets/css/ui.css +++ b/packages/Webkul/Ui/publishable/assets/css/ui.css @@ -1 +1 @@ -.active .cms-icon,.active.configuration-icon,.catalog-icon,.cms-icon,.configuration-icon,.customer-icon,.dashboard-icon,.promotion-icon,.sales-icon,.settings-icon{width:48px;height:48px;display:inline-block;background-size:cover}.icon{display:inline-block;background-size:cover}.dashboard-icon{background-image:url("../images/Icon-Dashboard.svg")}.sales-icon{background-image:url("../images/Icon-Sales.svg")}.catalog-icon{background-image:url("../images/Icon-Catalog.svg")}.customer-icon{background-image:url("../images/Icon-Customers.svg")}.configuration-icon{background-image:url("../images/Icon-Configure.svg")}.settings-icon{background-image:url("../images/Icon-Settings.svg")}.promotion-icon{background-image:url("../images/icon-promotion.svg")}.cms-icon{background-image:url("../images/Icon-CMS.svg")}.angle-right-icon{background-image:url("../images/Angle-Right.svg");width:17px;height:17px}.angle-left-icon{background-image:url("../images/Angle-Left.svg");width:17px;height:17px}.arrow-down-icon{background-image:url("../images/Arrow-Down-Light.svg");width:14px;height:8px}.arrow-right-icon{background-image:url("../images/Arrow-Right.svg");width:18px;height:18px}.white-cross-sm-icon{background-image:url("../images/Icon-Sm-Cross-White.svg");width:18px;height:18px}.accordian-up-icon{background-image:url("../images/Accordion-Arrow-Up.svg");width:24px;height:24px}.accordian-down-icon{background-image:url("../images/Accordion-Arrow-Down.svg");width:24px;height:24px}.cross-icon{background-image:url("../images/Icon-Crossed.svg");width:18px;height:18px}.trash-icon{background-image:url("../images/Icon-Trash.svg");width:24px;height:24px}.remove-icon{background-image:url("../images/Icon-remove.svg");width:24px;height:24px}.pencil-lg-icon{background-image:url("../images/Icon-Pencil-Large.svg");width:24px;height:24px}.eye-icon{background-image:url("../images/Icon-eye.svg");width:24px;height:24px}.search-icon{background-image:url("../images/icon-search.svg");width:24px;height:24px}.sortable-icon{background-image:url("../images/Icon-Sortable.svg");width:24px;height:24px}.sort-down-icon,.sort-up-icon{background-image:url("../images/Icon-Sort-Down.svg");width:18px;height:18px}.sort-up-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.primary-back-icon{background-image:url("../images/Icon-Back-Primary.svg");width:24px;height:24px}.checkbox-dash-icon{background-image:url("../images/Checkbox-Dash.svg");width:24px;height:24px}.account-icon{background-image:url("../images/icon-account.svg");width:24px;height:24px}.expand-icon{background-image:url("../images/Expand-Light.svg");width:18px;height:18px}.expand-on-icon{background-image:url("../images/Expand-Light-On.svg");width:18px;height:18px}.dark-left-icon{background-image:url("../images/arrow-left-dark.svg");width:18px;height:18px}.light-right-icon{background-image:url("../images/arrow-right-light.svg");width:18px;height:18px}.folder-icon{background-image:url("../images/Folder-Icon.svg");width:24px;height:24px}.star-icon{background-image:url("../images/Star-Icon.svg");width:24px;height:24px}.arrow-down-white-icon{background-image:url("../images/down-arrow-white.svg");width:17px;height:13px}.arrow-up-white-icon{background-image:url("../images/up-arrow-white.svg");width:17px;height:13px}.profile-pic-icon{background-image:url("../images/Profile-Pic.svg");width:60px;height:60px}.graph-up-icon{background-image:url("../images/Icon-Graph-Green.svg");width:24px;height:24px}.graph-down-icon{background-image:url("../images/Icon-Graph-Red.svg");width:24px;height:24px}.no-result-icon{background-image:url("../images/limited-icon.svg");width:52px;height:47px}.note-icon{background-image:url("../images/icon-note.svg")}.list-icon,.note-icon{width:24px;height:24px}.list-icon{background-image:url("../images/Icon-Listing.svg")}.active .dashboard-icon{background-image:url("../images/Icon-Dashboard-Active.svg")}.active .sales-icon{background-image:url("../images/Icon-Sales-Active.svg")}.active .catalog-icon{background-image:url("../images/Icon-Catalog-Active.svg")}.active .customer-icon{background-image:url("../images/Icon-Customers-Active.svg")}.active .settings-icon{background-image:url("../images/Icon-Settings-Active.svg")}.active .configuration-icon{background-image:url("../images/Icon-Configure-Active.svg")}.active .promotion-icon{background-image:url("../images/icon-promotion-active.svg")}.active .cms-icon{background-image:url("../images/Icon-CMS-Active.svg")}.active>.arrow-down-icon{background-image:url("../images/Arrow-Down.svg");width:14px;height:8px}.active>.expand-icon{background-image:url("../images/Expand-Light-On.svg")}.active.dashboard-icon{background-image:url("../images/Icon-Dashboard-Active.svg")}.active.customer-icon{background-image:url("../images/Icon-Customers-Active.svg")}.active.sales-icon{background-image:url("../images/Icon-Sales-Active.svg")}.active.settings-icon{background-image:url("../images/Icon-Settings-Active.svg")}.active.configuration-icon{background-image:url("../images/Icon-Configure-Active.svg")}.active.arrow-down-icon{background-image:url("../images/Arrow-Down.svg");width:14px;height:8px}.active.expand-icon{background-image:url("../images/Expand-Light-On.svg")}.icon-404{background-image:url("../images/404-image.svg");width:255px;height:255px}.export-icon{background-image:url("../images/Icon-Export.svg");width:32px;height:32px}.import-icon{background-image:url("../images/Icon-Import.svg");width:32px;height:32px}.star-blue-icon{width:17px;height:17px;background-image:url("../images/Icon-star.svg")}.grid-container{display:block;width:100%}.filter-row-one{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:100%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:20px}.filter-row-one .dropdown-filters{position:absolute;right:25px}.filter-row-one .per-page{right:250px}.filter-row-one .per-page .per-page-label{position:absolute;right:120px;width:100%;top:8px}.filter-row-two{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-bottom:10px}.filter-row-two,.search-filter{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.search-filter .control{font-size:15px;border:2px solid #c7c7c7;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-radius:3px;height:36px;width:280px;padding-left:10px}.search-filter .contorl:focus{border-color:#0041ff}.search-filter .icon-wrapper{border:2px solid #c7c7c7;border-radius:3px;border-top-left-radius:0;border-bottom-left-radius:0;height:36px;width:36px;margin-left:-1px}.search-filter .icon-wrapper .search-icon{margin-top:3px;margin-left:3px}.grid-dropdown-header{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:36px;width:200px;border:2px solid #c7c7c7;border-radius:3px;color:#8e8e8e;padding:0 5px}.grid-dropdown-header .arrow-icon-down{float:right}.dropdown-list.dropdown-container{padding:15px;width:100%;top:43px}.dropdown-list.dropdown-container ul li .control-group{margin-bottom:15px}.dropdown-list.dropdown-container .apply-filter{padding:10px;width:100%}.filter-tag{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-right:20px}.filter-tag,.filter-tag .wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:14px;height:28px;border-radius:2px}.filter-tag .wrapper{margin-left:10px;padding:5px 10px;background:#e7e7e7;color:#000311;letter-spacing:-.22px}.filter-tag .wrapper .icon.cross-icon{margin-left:10px;cursor:pointer}@-webkit-keyframes jelly{0%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}70%{-webkit-transform:translateY(5px) scale(1.05);transform:translateY(5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}}@keyframes jelly{0%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}70%{-webkit-transform:translateY(5px) scale(1.05);transform:translateY(5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}}@-webkit-keyframes jelly-out{0%{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}30%{-webkit-transform:translateY(-5px) scale(1.05);transform:translateY(-5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}}@keyframes jelly-out{0%{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}30%{-webkit-transform:translateY(-5px) scale(1.05);transform:translateY(-5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}}*{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:focus{outline:none}.mb-10{margin-bottom:10px}.mb-15{margin-bottom:15px}.mb-20{margin-bottom:20px}.mb-25{margin-bottom:25px}.mb-30{margin-bottom:30px}.mb-35{margin-bottom:35px}.mb-40{margin-bottom:40px}.mb-45{margin-bottom:45px}.mb-50{margin-bottom:50px}.mb-60{margin-bottom:60px}.mb-70{margin-bottom:70px}.mb-80{margin-bottom:80px}.mb-90{margin-bottom:90px}.mt-5{margin-top:5px}.mt-10{margin-top:10px}.mt-15{margin-top:15px}.mt-20{margin-top:20px}.mt-25{margin-top:25px}.mt-30{margin-top:30px}.mt-35{margin-top:35px}.mt-40{margin-top:40px}.mt-45{margin-top:45px}.mt-50{margin-top:50px}.mt-60{margin-top:60px}.mt-70{margin-top:70px}.mt-80{margin-top:80px}.mt-90{margin-top:90px}body{letter-spacing:-.26px;line-height:19px}a:active,a:focus,a:hover,a:link,a:visited{text-decoration:none;color:#0041ff}::-moz-selection{background-color:rgba(0,64,255,.6);color:#fff}::selection{background-color:rgba(0,64,255,.6);color:#fff}textarea{resize:none}ul{margin:0;padding:0;list-style:none}h1{font-size:28px;margin-top:0}h1,h2{color:#3a3a3a}h2{font-size:24px}h3{font-size:20px}h3,h4{color:#3a3a3a}h4{font-size:16px}h5{font-size:12px;color:#3a3a3a}.hide{display:none!important}.row{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.btn{-webkit-box-shadow:0 1px 4px 0 rgba(0,0,0,.2),0 0 8px 0 rgba(0,0,0,.1);box-shadow:0 1px 4px 0 rgba(0,0,0,.2),0 0 8px 0 rgba(0,0,0,.1);border-radius:3px;border:none;color:#fff;cursor:pointer;-webkit-transition:.2s cubic-bezier(.4,0,.2,1);transition:.2s cubic-bezier(.4,0,.2,1);font:inherit;display:inline-block}.btn:active,.btn:focus,.btn:hover{opacity:.75;border:none}.btn.btn-sm{padding:6px 12px}.btn.btn-md{padding:8px 16px}.btn.btn-lg{padding:10px 20px}.btn.btn-xl{padding:12px 24px;font-size:16px}.btn.btn-primary{background:#0041ff;color:#fff}.btn.btn-black{background:#000;color:#fff}.btn.btn-white{background:#fff;color:#000}.btn:disabled,.btn[disabled=disabled],.btn[disabled=disabled]:active,.btn[disabled=disabled]:hover{cursor:not-allowed;background:#b1b1ae;-webkit-box-shadow:none;box-shadow:none;opacity:1}.dropdown-btn{min-width:150px;text-align:left;background:#fff;border:2px solid #c7c7c7;border-radius:3px;font-size:14px;padding:8px 35px 8px 10px;cursor:pointer;position:relative}.dropdown-btn:active,.dropdown-btn:focus,.dropdown-btn:hover{opacity:.75;border:2px solid #c7c7c7}.dropdown-btn .icon{position:absolute;right:10px;top:50%;margin-top:-4px}.dropdown-toggle{cursor:pointer}.dropdown-open{position:relative}.dropdown-list{width:200px;margin-bottom:20px;-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,.16),0 0 9px 0 rgba(0,0,0,.16);box-shadow:0 2px 4px 0 rgba(0,0,0,.16),0 0 9px 0 rgba(0,0,0,.16);border-radius:3px;background-color:#fff;position:absolute;display:none;z-index:10;text-align:left}.dropdown-list.bottom-left{top:42px;left:0}.dropdown-list.bottom-right{top:42px;right:0}.dropdown-list.top-left{bottom:0;left:42px}.dropdown-list.top-right{bottom:0;right:42px}.dropdown-list .search-box{padding:20px;border-bottom:1px solid #e8e8e8}.dropdown-list .search-box .control{background:#fff;border:2px solid #c7c7c7;border-radius:3px;width:100%;height:36px;display:inline-block;vertical-align:middle;-webkit-transition:.2s cubic-bezier(.4,0,.2,1);transition:.2s cubic-bezier(.4,0,.2,1);padding:0 10px;font-size:15px}.dropdown-list .search-box .control:focus{border-color:#0041ff}.dropdown-list .dropdown-container{padding:20px;overflow-y:auto}.dropdown-list .dropdown-container label{font-size:15px;display:inline-block;text-transform:uppercase;color:#9e9e9e;font-weight:700;padding-bottom:5px}.dropdown-list .dropdown-container ul{margin:0;list-style-type:none;padding:0}.dropdown-list .dropdown-container ul li{padding:5px 0}.dropdown-list .dropdown-container ul li a:active,.dropdown-list .dropdown-container ul li a:focus,.dropdown-list .dropdown-container ul li a:link,.dropdown-list .dropdown-container ul li a:visited{color:#333;display:block}.dropdown-list .dropdown-container ul li a:hover{color:#0041ff}.dropdown-list .dropdown-container ul li .checkbox{margin:0}.dropdown-list .dropdown-container ul li .control-group label{color:#3a3a3a;font-size:15px;font-weight:500;text-transform:capitalize;width:100%}.dropdown-list .dropdown-container .btn{width:100%;margin-top:10px}.section .secton-title{font-size:18px;color:#8e8e8e;padding:15px 0;border-bottom:1px solid #e8e8e8}.section .section-content{display:block;padding:20px 0}.section .section-content .row{display:block;padding:7px 0}.section .section-content .row .title{width:200px}.section .section-content .row .title,.section .section-content .row .value{color:#3a3a3a;letter-spacing:-.26px;display:inline-block}.table{width:100%}.table table{border-collapse:collapse;text-align:left;width:100%}.table table thead th{font-weight:700;padding:12px 10px;background:#f8f9fa;color:#3a3a3a}.table table tbody td{padding:10px;border-bottom:1px solid #d3d3d3;color:#3a3a3a;vertical-align:top}.table table tbody td.actions .action{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.table table tbody td.actions .icon{cursor:pointer;vertical-align:middle}.table table tbody td.empty{text-align:center}.table table tbody tr:last-child td{border-bottom:none}.table .control-group{width:100%;margin-bottom:0;min-width:140px}.table .control-group .control{width:100%;margin:0}.pagination .page-item{background:#fff;border:2px solid #c7c7c7;border-radius:3px;padding:7px 14px;margin-right:5px;font-size:16px;display:inline-block;color:#8e8e8e;vertical-align:middle;text-decoration:none}.pagination .page-item.next,.pagination .page-item.previous{padding:6px 9px}.pagination .page-item.active{background:#0041ff;color:#fff;border-color:#0041ff}.pagination .page-item .icon{vertical-align:middle;margin-bottom:3px}.checkbox{position:relative;display:block}.checkbox input{left:0;opacity:0;position:absolute;top:0;height:24px;width:24px;z-index:100}.checkbox .checkbox-view{background-image:url("../images/Checkbox.svg");height:24px;width:24px;margin:0;display:inline-block!important;vertical-align:middle;margin-right:5px}.checkbox input:checked+.checkbox-view{background-image:url("../images/Checkbox-Checked.svg")}.checkbox input:disabled+.checkbox-view{opacity:.5;cursor:not-allowed}.radio{position:relative;display:block;margin:10px 5px 5px 0}.radio input{left:0;opacity:0;position:absolute;top:0;z-index:100}.radio .radio-view{background-image:url("../images/controls.svg");background-position:-21px 0;height:20px;width:20px;margin:0;display:inline-block!important;vertical-align:middle;margin-right:5px}.radio input:checked+.radio-view{background-position:-21px -21px}.radio input:disabled+.radio-view{opacity:.5;cursor:not-allowed}.control-group{display:block;margin-bottom:25px;font-size:15px;color:#333;width:750px;max-width:100%;position:relative}.control-group label{display:block;color:#3a3a3a}.control-group label.required:after{content:"*";color:#fc6868;font-weight:700;display:inline-block}.control-group textarea.control{height:100px;padding:10px}.control-group .control{background:#fff;border:2px solid #c7c7c7;border-radius:3px;width:70%;height:36px;display:inline-block;vertical-align:middle;-webkit-transition:.2s cubic-bezier(.4,0,.2,1);transition:.2s cubic-bezier(.4,0,.2,1);padding:0 10px;font-size:15px;margin-top:10px;margin-bottom:5px}.control-group .control:focus{border-color:#0041ff}.control-group .control[disabled=disabled]{border-color:#d3d3d3;background-color:#d3d3d3;cursor:not-allowed}.control-group .control[multiple]{height:100px}.control-group.date:after,.control-group.datetime:after{background-image:url("../images/Icon-Calendar.svg");width:24px;height:24px;content:"";display:inline-block;vertical-align:middle;margin-left:-34px;margin-top:2px;pointer-events:none}.control-group .control-info{display:block;font-size:14px;color:#6f6f6f;font-style:italic}.control-group .control-error{display:none;color:#ff5656;margin-top:5px}.control-group.has-error .control{border-color:#fc6868}.control-group.has-error .control-error{display:block}.control-group.price .currency-code{vertical-align:middle;display:inline-block}.control-group .switch{position:relative;display:inline-block;width:60px;height:34px;margin-top:10px;margin-bottom:5px}.control-group .switch input{opacity:0;width:0;height:0}.control-group .slider{cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#8e8e8e}.control-group .slider,.control-group .slider:before{position:absolute;-webkit-transition:.2s;transition:.2s}.control-group .slider:before{content:"";height:26px;width:26px;left:4px;bottom:4px;background-color:#fff}.control-group input:checked+.slider{background-color:#0041ff}.control-group input:focus+.slider{-webkit-box-shadow:0 0 1px #0041ff;box-shadow:0 0 1px #0041ff}.control-group input:checked+.slider:before{-webkit-transform:translateX(26px);transform:translateX(26px)}.control-group .slider.round{border-radius:34px}.control-group .slider.round:before{border-radius:50%}.button-group{margin-top:20px;margin-bottom:20px}.alert-wrapper{width:300px;top:10px;right:10px;position:fixed;z-index:100;text-align:left}.alert-wrapper .alert{width:300px;padding:15px;border-radius:3px;display:inline-block;-webkit-box-shadow:0 4px 15.36px .64px rgba(0,0,0,.1),0 2px 6px 0 rgba(0,0,0,.12);box-shadow:0 4px 15.36px .64px rgba(0,0,0,.1),0 2px 6px 0 rgba(0,0,0,.12);position:relative;-webkit-animation:jelly .5s ease-in-out;animation:jelly .5s ease-in-out;-webkit-transform-origin:center top;transform-origin:center top;z-index:500;margin-bottom:10px}.alert-wrapper .alert.alert-error{background:#fc6868}.alert-wrapper .alert.alert-info{background:#204d74}.alert-wrapper .alert.alert-success{background:#4caf50}.alert-wrapper .alert.alert-warning{background:#ffc107}.alert-wrapper .alert .icon{position:absolute;right:10px;top:10px;cursor:pointer}.alert-wrapper .alert p{color:#fff;margin:0;padding:0;font-size:15px}.tabs ul{border-bottom:1px solid #e8e8e8}.tabs ul li{display:inline-block}.tabs ul li a{padding:15px 20px;cursor:pointer;margin:0 2px;text-align:center;color:#000311;display:block}.tabs ul li.active a{border-bottom:3px solid #0041ff}.accordian,accordian{display:inline-block;width:100%}.accordian .accordian-header,.accordian div[slot*=header],accordian .accordian-header,accordian div[slot*=header]{width:100%;display:inline-block;font-size:18px;color:#3a3a3a;border-top:1px solid #e8e8e8;border-bottom:1px solid #e8e8e8;padding:20px 15px;cursor:pointer;margin-top:-1px}.accordian .accordian-header .expand-icon,.accordian div[slot*=header] .expand-icon,accordian .accordian-header .expand-icon,accordian div[slot*=header] .expand-icon{background-image:url("../images/Expand-Light.svg");margin-right:10px;margin-top:3px}.accordian .accordian-header h1,.accordian div[slot*=header] h1,accordian .accordian-header h1,accordian div[slot*=header] h1{margin:0;font-size:20px;font-weight:500;display:inline-block}.accordian .accordian-header .icon,.accordian div[slot*=header] .icon,accordian .accordian-header .icon,accordian div[slot*=header] .icon{float:right}.accordian .accordian-header .icon.left,.accordian div[slot*=header] .icon.left,accordian .accordian-header .icon.left,accordian div[slot*=header] .icon.left{float:left}.accordian.error .accordian-header,accordian.error .accordian-header{color:#ff5656}.accordian .accordian-content,.accordian div[slot*=body],accordian .accordian-content,accordian div[slot*=body]{width:100%;padding:20px 15px;display:none;-webkit-transition:all .3s ease;transition:all .3s ease}.accordian.active>.accordian-content,accordian.active>.accordian-content{display:inline-block}.accordian.active>.accordian-header .expand-icon,accordian.active>.accordian-header .expand-icon{background-image:url("../images/Expand-Light-On.svg")}.tree-container .tree-item{padding-left:30px;display:inline-block;margin-top:10px;width:100%}.tree-container .tree-item>.tree-item{display:none}.tree-container .tree-item.active>.tree-item{display:inline-block}.tree-container .tree-item .checkbox,.tree-container .tree-item .radio{margin:0;display:inline-block}.tree-container .tree-item .expand-icon{display:inline-block;margin-right:10px;cursor:pointer;background-image:url("../images/Expand-Light.svg");width:18px;height:18px;vertical-align:middle}.tree-container .tree-item .folder-icon{vertical-align:middle;margin-right:10px}.tree-container .tree-item.active>.expand-icon{background-image:url("../images/Expand-Light-On.svg")}.tree-container>.tree-item{padding-left:0}.panel{-webkit-box-shadow:0 2px 25px 0 rgba(0,0,0,.15);box-shadow:0 2px 25px 0 rgba(0,0,0,.15);border-radius:5px;background:#fff}.panel .panel-content{padding:20px}modal{display:none}.modal-open{overflow:hidden}.modal-overlay{display:none;overflow-y:auto;z-index:10;top:0;right:0;bottom:0;left:0;position:fixed;background:#000;opacity:.7}.modal-open .modal-overlay{display:block}.modal-container{background:#fff;top:100px;width:600px;max-width:80%;left:50%;margin-left:-300px;position:fixed;z-index:11;-webkit-box-shadow:0 15px 25px 0 rgba(0,0,0,.03),0 20px 45px 5px rgba(0,0,0,.2);box-shadow:0 15px 25px 0 rgba(0,0,0,.03),0 20px 45px 5px rgba(0,0,0,.2);-webkit-animation:fade-in-white .3s ease-in-out;animation:fade-in-white .3s ease-in-out;-webkit-animation:jelly .5s ease-in-out;animation:jelly .5s ease-in-out;border-radius:5px;overflow-y:auto;max-height:80%}.modal-container .modal-header{padding:20px}.modal-container .modal-header h3{display:inline-block;font-size:20px;color:#3a3a3a;margin:0}.modal-container .modal-header .icon{float:right;cursor:pointer}.modal-container .modal-body{padding:20px}.modal-container .modal-body .control-group .control{width:100%}@media only screen and (max-width:770px){.modal-container{max-width:80%;left:10%;margin-left:0}}.label{background:#e7e7e7;border-radius:2px;padding:8px;color:#000311;display:inline-block}.label.label-sm{padding:5px}.label.label-md{padding:8px}.label.label-lg{padding:11px}.label.label-xl{padding:14px}.badge{border-radius:50px;color:#fff;padding:8px;white-space:nowrap}.badge.badge-sm{padding:5px}.badge.badge-md{padding:3px 10px}.badge.badge-lg{padding:11px}.badge.badge-xl{padding:14px}.badge.badge-success{background-color:#4caf50}.badge.badge-info{background-color:#0041ff}.badge.badge-danger{background-color:#fc6868}.badge.badge-warning{background-color:#ffc107}.image-wrapper{margin-bottom:20px;margin-top:10px;display:inline-block;width:100%}.image-wrapper .image-item{width:200px;height:200px;margin-right:20px;background:#f8f9fa;border-radius:3px;display:inline-block;position:relative;background-image:url("../images/placeholder-icon.svg");background-repeat:no-repeat;background-position:50%;margin-bottom:20px;float:left}.image-wrapper .image-item img.preview{width:100%;height:100%}.image-wrapper .image-item input{display:none}.image-wrapper .image-item .remove-image{background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.08)),to(rgba(0,0,0,.24)));background-image:linear-gradient(-180deg,rgba(0,0,0,.08),rgba(0,0,0,.24));border-radius:0 0 4px 4px;position:absolute;bottom:0;width:100%;padding:10px;text-align:center;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.24);margin-right:20px;cursor:pointer}.image-wrapper .image-item:hover .remove-image{display:block}.image-wrapper .image-item.has-image{background-image:none}.vue-swatches__trigger{border:1px solid #d3d3d3}.helper-container{display:block}.helper-container .group code{font-weight:700} \ No newline at end of file +.active .cms-icon,.active.configuration-icon,.catalog-icon,.cms-icon,.configuration-icon,.customer-icon,.dashboard-icon,.promotion-icon,.sales-icon,.settings-icon{width:48px;height:48px;display:inline-block;background-size:cover}.icon{display:inline-block;background-size:cover}.dashboard-icon{background-image:url(../images/Icon-Dashboard.svg)}.sales-icon{background-image:url(../images/Icon-Sales.svg)}.catalog-icon{background-image:url(../images/Icon-Catalog.svg)}.customer-icon{background-image:url(../images/Icon-Customers.svg)}.configuration-icon{background-image:url(../images/Icon-Configure.svg)}.settings-icon{background-image:url(../images/Icon-Settings.svg)}.promotion-icon{background-image:url(../images/icon-promotion.svg)}.cms-icon{background-image:url(../images/Icon-CMS.svg)}.angle-right-icon{background-image:url(../images/Angle-Right.svg);width:17px;height:17px}.angle-left-icon{background-image:url(../images/Angle-Left.svg);width:17px;height:17px}.arrow-down-icon{background-image:url(../images/Arrow-Down-Light.svg);width:14px;height:8px}.arrow-right-icon{background-image:url(../images/Arrow-Right.svg);width:18px;height:18px}.white-cross-sm-icon{background-image:url(../images/Icon-Sm-Cross-White.svg);width:18px;height:18px}.accordian-up-icon{background-image:url(../images/Accordion-Arrow-Up.svg);width:24px;height:24px}.accordian-down-icon{background-image:url(../images/Accordion-Arrow-Down.svg);width:24px;height:24px}.cross-icon{background-image:url(../images/Icon-Crossed.svg);width:18px;height:18px}.trash-icon{background-image:url(../images/Icon-Trash.svg);width:24px;height:24px}.remove-icon{background-image:url(../images/Icon-remove.svg);width:24px;height:24px}.pencil-lg-icon{background-image:url(../images/Icon-Pencil-Large.svg);width:24px;height:24px}.eye-icon{background-image:url(../images/Icon-eye.svg);width:24px;height:24px}.search-icon{background-image:url(../images/icon-search.svg);width:24px;height:24px}.sortable-icon{background-image:url(../images/Icon-Sortable.svg);width:24px;height:24px}.sort-down-icon,.sort-up-icon{background-image:url(../images/Icon-Sort-Down.svg);width:18px;height:18px}.sort-up-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.primary-back-icon{background-image:url(../images/Icon-Back-Primary.svg);width:24px;height:24px}.checkbox-dash-icon{background-image:url(../images/Checkbox-Dash.svg);width:24px;height:24px}.account-icon{background-image:url(../images/icon-account.svg);width:24px;height:24px}.expand-icon{background-image:url(../images/Expand-Light.svg);width:18px;height:18px}.expand-on-icon{background-image:url(../images/Expand-Light-On.svg);width:18px;height:18px}.dark-left-icon{background-image:url(../images/arrow-left-dark.svg);width:18px;height:18px}.light-right-icon{background-image:url(../images/arrow-right-light.svg);width:18px;height:18px}.folder-icon{background-image:url(../images/Folder-Icon.svg);width:24px;height:24px}.star-icon{background-image:url(../images/Star-Icon.svg);width:24px;height:24px}.arrow-down-white-icon{background-image:url(../images/down-arrow-white.svg);width:17px;height:13px}.arrow-up-white-icon{background-image:url(../images/up-arrow-white.svg);width:17px;height:13px}.profile-pic-icon{background-image:url(../images/Profile-Pic.svg);width:60px;height:60px}.graph-up-icon{background-image:url(../images/Icon-Graph-Green.svg);width:24px;height:24px}.graph-down-icon{background-image:url(../images/Icon-Graph-Red.svg);width:24px;height:24px}.no-result-icon{background-image:url(../images/limited-icon.svg);width:52px;height:47px}.note-icon{background-image:url(../images/icon-note.svg)}.list-icon,.note-icon{width:24px;height:24px}.list-icon{background-image:url(../images/Icon-Listing.svg)}.active .dashboard-icon{background-image:url(../images/Icon-Dashboard-Active.svg)}.active .sales-icon{background-image:url(../images/Icon-Sales-Active.svg)}.active .catalog-icon{background-image:url(../images/Icon-Catalog-Active.svg)}.active .customer-icon{background-image:url(../images/Icon-Customers-Active.svg)}.active .settings-icon{background-image:url(../images/Icon-Settings-Active.svg)}.active .configuration-icon{background-image:url(../images/Icon-Configure-Active.svg)}.active .promotion-icon{background-image:url(../images/icon-promotion-active.svg)}.active .cms-icon{background-image:url(../images/Icon-CMS-Active.svg)}.active>.arrow-down-icon{background-image:url(../images/Arrow-Down.svg);width:14px;height:8px}.active>.expand-icon{background-image:url(../images/Expand-Light-On.svg)}.active.dashboard-icon{background-image:url(../images/Icon-Dashboard-Active.svg)}.active.customer-icon{background-image:url(../images/Icon-Customers-Active.svg)}.active.sales-icon{background-image:url(../images/Icon-Sales-Active.svg)}.active.settings-icon{background-image:url(../images/Icon-Settings-Active.svg)}.active.configuration-icon{background-image:url(../images/Icon-Configure-Active.svg)}.active.arrow-down-icon{background-image:url(../images/Arrow-Down.svg);width:14px;height:8px}.active.expand-icon{background-image:url(../images/Expand-Light-On.svg)}.icon-404{background-image:url(../images/404-image.svg);width:255px;height:255px}.export-icon{background-image:url(../images/Icon-Export.svg);width:32px;height:32px}.import-icon{background-image:url(../images/Icon-Import.svg);width:32px;height:32px}.star-blue-icon{width:17px;height:17px;background-image:url(../images/Icon-star.svg)}.grid-container{display:block;width:100%}.filter-row-one{display:-webkit-inline-box;display:inline-flex;width:100%;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center;margin-bottom:20px}.filter-row-one .dropdown-filters{position:absolute;right:25px}.filter-row-one .per-page{right:250px}.filter-row-one .per-page .per-page-label{position:absolute;right:120px;width:100%;top:8px}.filter-row-two{-webkit-box-align:start;align-items:flex-start;flex-wrap:wrap;margin-bottom:10px}.filter-row-two,.search-filter{display:-webkit-inline-box;display:inline-flex}.search-filter .control{font-size:15px;border:2px solid #c7c7c7;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-radius:3px;height:36px;width:280px;padding-left:10px}.search-filter .contorl:focus{border-color:#0041ff}.search-filter .icon-wrapper{border:2px solid #c7c7c7;border-radius:3px;border-top-left-radius:0;border-bottom-left-radius:0;height:36px;width:36px;margin-left:-1px}.search-filter .icon-wrapper .search-icon{margin-top:3px;margin-left:3px}.grid-dropdown-header{display:-webkit-inline-box;display:inline-flex;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center;height:36px;width:200px;border:2px solid #c7c7c7;border-radius:3px;color:#8e8e8e;padding:0 5px}.grid-dropdown-header .arrow-icon-down{float:right}.dropdown-list.dropdown-container{padding:15px;width:100%;top:43px}.dropdown-list.dropdown-container ul li .control-group{margin-bottom:15px}.dropdown-list.dropdown-container .apply-filter{padding:10px;width:100%}.filter-tag{-webkit-box-pack:justify;justify-content:space-between;margin-right:20px}.filter-tag,.filter-tag .wrapper{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;font-size:14px;height:28px;border-radius:2px}.filter-tag .wrapper{margin-left:10px;padding:5px 10px;background:#e7e7e7;color:#000311;letter-spacing:-.22px}.filter-tag .wrapper .icon.cross-icon{margin-left:10px;cursor:pointer}@-webkit-keyframes jelly{0%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}70%{-webkit-transform:translateY(5px) scale(1.05);transform:translateY(5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}}@keyframes jelly{0%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}70%{-webkit-transform:translateY(5px) scale(1.05);transform:translateY(5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}}@-webkit-keyframes jelly-out{0%{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}30%{-webkit-transform:translateY(-5px) scale(1.05);transform:translateY(-5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}}@keyframes jelly-out{0%{-webkit-transform:translateY(0) scale(1);transform:translateY(0) scale(1);opacity:1}30%{-webkit-transform:translateY(-5px) scale(1.05);transform:translateY(-5px) scale(1.05);opacity:1}to{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:0}}*{box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:focus{outline:none}.mb-10{margin-bottom:10px}.mb-15{margin-bottom:15px}.mb-20{margin-bottom:20px}.mb-25{margin-bottom:25px}.mb-30{margin-bottom:30px}.mb-35{margin-bottom:35px}.mb-40{margin-bottom:40px}.mb-45{margin-bottom:45px}.mb-50{margin-bottom:50px}.mb-60{margin-bottom:60px}.mb-70{margin-bottom:70px}.mb-80{margin-bottom:80px}.mb-90{margin-bottom:90px}.mt-5{margin-top:5px}.mt-10{margin-top:10px}.mt-15{margin-top:15px}.mt-20{margin-top:20px}.mt-25{margin-top:25px}.mt-30{margin-top:30px}.mt-35{margin-top:35px}.mt-40{margin-top:40px}.mt-45{margin-top:45px}.mt-50{margin-top:50px}.mt-60{margin-top:60px}.mt-70{margin-top:70px}.mt-80{margin-top:80px}.mt-90{margin-top:90px}body{letter-spacing:-.26px;line-height:19px}a:active,a:focus,a:hover,a:link,a:visited{text-decoration:none;color:#0041ff}::-moz-selection{background-color:rgba(0,64,255,.6);color:#fff}::selection{background-color:rgba(0,64,255,.6);color:#fff}textarea{resize:none}ul{margin:0;padding:0;list-style:none}h1{font-size:28px;margin-top:0}h1,h2{color:#3a3a3a}h2{font-size:24px}h3{font-size:20px}h3,h4{color:#3a3a3a}h4{font-size:16px}h5{font-size:12px;color:#3a3a3a}.hide{display:none!important}.row{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center}.btn{box-shadow:0 1px 4px 0 rgba(0,0,0,.2),0 0 8px 0 rgba(0,0,0,.1);border-radius:3px;border:none;color:#fff;cursor:pointer;-webkit-transition:.2s cubic-bezier(.4,0,.2,1);transition:.2s cubic-bezier(.4,0,.2,1);font:inherit;display:inline-block}.btn:active,.btn:focus,.btn:hover{opacity:.75;border:none}.btn.btn-sm{padding:6px 12px}.btn.btn-md{padding:8px 16px}.btn.btn-lg{padding:10px 20px}.btn.btn-xl{padding:12px 24px;font-size:16px}.btn.btn-primary{background:#0041ff;color:#fff}.btn.btn-black{background:#000;color:#fff}.btn.btn-white{background:#fff;color:#000}.btn:disabled,.btn[disabled=disabled],.btn[disabled=disabled]:active,.btn[disabled=disabled]:hover{cursor:not-allowed;background:#b1b1ae;box-shadow:none;opacity:1}.dropdown-btn{min-width:150px;text-align:left;background:#fff;border:2px solid #c7c7c7;border-radius:3px;font-size:14px;padding:8px 35px 8px 10px;cursor:pointer;position:relative}.dropdown-btn:active,.dropdown-btn:focus,.dropdown-btn:hover{opacity:.75;border:2px solid #c7c7c7}.dropdown-btn .icon{position:absolute;right:10px;top:50%;margin-top:-4px}.dropdown-toggle{cursor:pointer}.dropdown-open{position:relative}.dropdown-list{width:200px;margin-bottom:20px;box-shadow:0 2px 4px 0 rgba(0,0,0,.16),0 0 9px 0 rgba(0,0,0,.16);border-radius:3px;background-color:#fff;position:absolute;display:none;z-index:10;text-align:left}.dropdown-list.bottom-left{top:42px;left:0}.dropdown-list.bottom-right{top:42px;right:0}.dropdown-list.top-left{bottom:0;left:42px}.dropdown-list.top-right{bottom:0;right:42px}.dropdown-list .search-box{padding:20px;border-bottom:1px solid #e8e8e8}.dropdown-list .search-box .control{background:#fff;border:2px solid #c7c7c7;border-radius:3px;width:100%;height:36px;display:inline-block;vertical-align:middle;-webkit-transition:.2s cubic-bezier(.4,0,.2,1);transition:.2s cubic-bezier(.4,0,.2,1);padding:0 10px;font-size:15px}.dropdown-list .search-box .control:focus{border-color:#0041ff}.dropdown-list .dropdown-container{padding:20px;overflow-y:auto}.dropdown-list .dropdown-container label{font-size:15px;display:inline-block;text-transform:uppercase;color:#9e9e9e;font-weight:700;padding-bottom:5px}.dropdown-list .dropdown-container ul{margin:0;list-style-type:none;padding:0}.dropdown-list .dropdown-container ul li{padding:5px 0}.dropdown-list .dropdown-container ul li a:active,.dropdown-list .dropdown-container ul li a:focus,.dropdown-list .dropdown-container ul li a:link,.dropdown-list .dropdown-container ul li a:visited{color:#333;display:block}.dropdown-list .dropdown-container ul li a:hover{color:#0041ff}.dropdown-list .dropdown-container ul li .checkbox{margin:0}.dropdown-list .dropdown-container ul li .control-group label{color:#3a3a3a;font-size:15px;font-weight:500;text-transform:capitalize;width:100%}.dropdown-list .dropdown-container .btn{width:100%;margin-top:10px}.section .secton-title{font-size:18px;color:#8e8e8e;padding:15px 0;border-bottom:1px solid #e8e8e8}.section .section-content{display:block;padding:20px 0}.section .section-content .row{display:block;padding:7px 0}.section .section-content .row .title{width:200px}.section .section-content .row .title,.section .section-content .row .value{color:#3a3a3a;letter-spacing:-.26px;display:inline-block}.table{width:100%}.table table{border-collapse:collapse;text-align:left;width:100%}.table table thead th{font-weight:700;padding:12px 10px;background:#f8f9fa;color:#3a3a3a}.table table tbody td{padding:10px;border-bottom:1px solid #d3d3d3;color:#3a3a3a;vertical-align:top}.table table tbody td.actions .action{display:-webkit-inline-box;display:inline-flex}.table table tbody td.actions .icon{cursor:pointer;vertical-align:middle}.table table tbody td.empty{text-align:center}.table table tbody tr:last-child td{border-bottom:none}.table .control-group{width:100%;margin-bottom:0;min-width:140px}.table .control-group .control{width:100%;margin:0}.pagination .page-item{background:#fff;border:2px solid #c7c7c7;border-radius:3px;padding:7px 14px;margin-right:5px;font-size:16px;display:inline-block;color:#8e8e8e;vertical-align:middle;text-decoration:none}.pagination .page-item.next,.pagination .page-item.previous{padding:6px 9px}.pagination .page-item.active{background:#0041ff;color:#fff;border-color:#0041ff}.pagination .page-item .icon{vertical-align:middle;margin-bottom:3px}.checkbox{position:relative;display:block}.checkbox input{left:0;opacity:0;position:absolute;top:0;height:24px;width:24px;z-index:100}.checkbox .checkbox-view{background-image:url(../images/Checkbox.svg);height:24px;width:24px;display:inline-block!important;vertical-align:middle;margin:0 5px 0 0}.checkbox input:checked+.checkbox-view{background-image:url(../images/Checkbox-Checked.svg)}.checkbox input:disabled+.checkbox-view{opacity:.5;cursor:not-allowed}.radio{position:relative;display:block;margin:10px 5px 5px 0}.radio input{left:0;opacity:0;position:absolute;top:0;z-index:100}.radio .radio-view{background-image:url(../images/controls.svg);background-position:-21px 0;height:20px;width:20px;display:inline-block!important;vertical-align:middle;margin:0 5px 0 0}.radio input:checked+.radio-view{background-position:-21px -21px}.radio input:disabled+.radio-view{opacity:.5;cursor:not-allowed}.control-group{display:block;margin-bottom:25px;font-size:15px;color:#333;width:750px;max-width:100%;position:relative}.control-group label{display:block;color:#3a3a3a}.control-group label.required:after{content:"*";color:#fc6868;font-weight:700;display:inline-block}.control-group textarea.control{height:100px;padding:10px}.control-group .control{background:#fff;border:2px solid #c7c7c7;border-radius:3px;width:70%;height:36px;display:inline-block;vertical-align:middle;-webkit-transition:.2s cubic-bezier(.4,0,.2,1);transition:.2s cubic-bezier(.4,0,.2,1);padding:0 10px;font-size:15px;margin-top:10px;margin-bottom:5px}.control-group .control:focus{border-color:#0041ff}.control-group .control[disabled=disabled]{border-color:#d3d3d3;background-color:#d3d3d3;cursor:not-allowed}.control-group .control[multiple]{height:100px}.control-group.date:after,.control-group.datetime:after{background-image:url(../images/Icon-Calendar.svg);width:24px;height:24px;content:"";display:inline-block;vertical-align:middle;margin-left:-34px;margin-top:2px;pointer-events:none}.control-group .control-info{display:block;font-size:14px;color:#6f6f6f;font-style:italic}.control-group .control-error{display:none;color:#ff5656;margin-top:5px}.control-group.has-error .control{border-color:#fc6868}.control-group.has-error .control-error{display:block}.control-group.price .currency-code{vertical-align:middle;display:inline-block}.control-group .switch{position:relative;display:inline-block;width:60px;height:34px;margin-top:10px;margin-bottom:5px}.control-group .switch input{opacity:0;width:0;height:0}.control-group .slider{cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#8e8e8e}.control-group .slider,.control-group .slider:before{position:absolute;-webkit-transition:.2s;transition:.2s}.control-group .slider:before{content:"";height:26px;width:26px;left:4px;bottom:4px;background-color:#fff}.control-group input:checked+.slider{background-color:#0041ff}.control-group input:focus+.slider{box-shadow:0 0 1px #0041ff}.control-group input:checked+.slider:before{-webkit-transform:translateX(26px);transform:translateX(26px)}.control-group .slider.round{border-radius:34px}.control-group .slider.round:before{border-radius:50%}.button-group{margin-top:20px;margin-bottom:20px}.alert-wrapper{width:300px;top:10px;right:10px;position:fixed;z-index:100;text-align:left}.alert-wrapper .alert{width:300px;padding:15px;border-radius:3px;display:inline-block;box-shadow:0 4px 15.36px .64px rgba(0,0,0,.1),0 2px 6px 0 rgba(0,0,0,.12);position:relative;-webkit-animation:jelly .5s ease-in-out;animation:jelly .5s ease-in-out;-webkit-transform-origin:center top;transform-origin:center top;z-index:500;margin-bottom:10px}.alert-wrapper .alert.alert-error{background:#fc6868}.alert-wrapper .alert.alert-info{background:#204d74}.alert-wrapper .alert.alert-success{background:#4caf50}.alert-wrapper .alert.alert-warning{background:#ffc107}.alert-wrapper .alert .icon{position:absolute;right:10px;top:10px;cursor:pointer}.alert-wrapper .alert p{color:#fff;margin:0;padding:0;font-size:15px}.tabs ul{border-bottom:1px solid #e8e8e8}.tabs ul li{display:inline-block}.tabs ul li a{padding:15px 20px;cursor:pointer;margin:0 2px;text-align:center;color:#000311;display:block}.tabs ul li.active a{border-bottom:3px solid #0041ff}.accordian,accordian{display:inline-block;width:100%}.accordian .accordian-header,.accordian div[slot*=header],accordian .accordian-header,accordian div[slot*=header]{width:100%;display:inline-block;font-size:18px;color:#3a3a3a;border-top:1px solid #e8e8e8;border-bottom:1px solid #e8e8e8;padding:20px 15px;cursor:pointer;margin-top:-1px}.accordian .accordian-header .expand-icon,.accordian div[slot*=header] .expand-icon,accordian .accordian-header .expand-icon,accordian div[slot*=header] .expand-icon{background-image:url(../images/Expand-Light.svg);margin-right:10px;margin-top:3px}.accordian .accordian-header h1,.accordian div[slot*=header] h1,accordian .accordian-header h1,accordian div[slot*=header] h1{margin:0;font-size:20px;font-weight:500;display:inline-block}.accordian .accordian-header .icon,.accordian div[slot*=header] .icon,accordian .accordian-header .icon,accordian div[slot*=header] .icon{float:right}.accordian .accordian-header .icon.left,.accordian div[slot*=header] .icon.left,accordian .accordian-header .icon.left,accordian div[slot*=header] .icon.left{float:left}.accordian.error .accordian-header,accordian.error .accordian-header{color:#ff5656}.accordian .accordian-content,.accordian div[slot*=body],accordian .accordian-content,accordian div[slot*=body]{width:100%;padding:20px 15px;display:none;-webkit-transition:all .3s ease;transition:all .3s ease}.accordian.active>.accordian-content,accordian.active>.accordian-content{display:inline-block}.accordian.active>.accordian-header .expand-icon,accordian.active>.accordian-header .expand-icon{background-image:url(../images/Expand-Light-On.svg)}.tree-container .tree-item{padding-left:30px;display:inline-block;margin-top:10px;width:100%}.tree-container .tree-item>.tree-item{display:none}.tree-container .tree-item.active>.tree-item{display:inline-block}.tree-container .tree-item .checkbox,.tree-container .tree-item .radio{margin:0;display:inline-block}.tree-container .tree-item .expand-icon{display:inline-block;margin-right:10px;cursor:pointer;background-image:url(../images/Expand-Light.svg);width:18px;height:18px;vertical-align:middle}.tree-container .tree-item .folder-icon{vertical-align:middle;margin-right:10px}.tree-container .tree-item.active>.expand-icon{background-image:url(../images/Expand-Light-On.svg)}.tree-container>.tree-item{padding-left:0}.panel{box-shadow:0 2px 25px 0 rgba(0,0,0,.15);border-radius:5px;background:#fff}.panel .panel-content{padding:20px}modal{display:none}.modal-open{overflow:hidden}.modal-overlay{display:none;overflow-y:auto;z-index:10;top:0;right:0;bottom:0;left:0;position:fixed;background:#000;opacity:.7}.modal-open .modal-overlay{display:block}.modal-container{background:#fff;top:100px;width:600px;max-width:80%;left:50%;margin-left:-300px;position:fixed;z-index:11;box-shadow:0 15px 25px 0 rgba(0,0,0,.03),0 20px 45px 5px rgba(0,0,0,.2);-webkit-animation:fade-in-white .3s ease-in-out;animation:fade-in-white .3s ease-in-out;-webkit-animation:jelly .5s ease-in-out;animation:jelly .5s ease-in-out;border-radius:5px;overflow-y:auto;max-height:80%}.modal-container .modal-header{padding:20px}.modal-container .modal-header h3{display:inline-block;font-size:20px;color:#3a3a3a;margin:0}.modal-container .modal-header .icon{float:right;cursor:pointer}.modal-container .modal-body{padding:20px}.modal-container .modal-body .control-group .control{width:100%}@media only screen and (max-width:770px){.modal-container{max-width:80%;left:10%;margin-left:0}}.label{background:#e7e7e7;border-radius:2px;padding:8px;color:#000311;display:inline-block}.label.label-sm{padding:5px}.label.label-md{padding:8px}.label.label-lg{padding:11px}.label.label-xl{padding:14px}.badge{border-radius:50px;color:#fff;padding:8px;white-space:nowrap}.badge.badge-sm{padding:5px}.badge.badge-md{padding:3px 10px}.badge.badge-lg{padding:11px}.badge.badge-xl{padding:14px}.badge.badge-success{background-color:#4caf50}.badge.badge-info{background-color:#0041ff}.badge.badge-danger{background-color:#fc6868}.badge.badge-warning{background-color:#ffc107}.image-wrapper{margin-bottom:20px;margin-top:10px;display:inline-block;width:100%}.image-wrapper .image-item{width:200px;height:200px;margin-right:20px;background:#f8f9fa;border-radius:3px;display:inline-block;position:relative;background-image:url(../images/placeholder-icon.svg);background-repeat:no-repeat;background-position:50%;margin-bottom:20px;float:left}.image-wrapper .image-item img.preview{width:100%;height:100%}.image-wrapper .image-item input{display:none}.image-wrapper .image-item .remove-image{background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.08)),to(rgba(0,0,0,.24)));background-image:linear-gradient(-180deg,rgba(0,0,0,.08),rgba(0,0,0,.24));border-radius:0 0 4px 4px;position:absolute;bottom:0;width:100%;padding:10px;text-align:center;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.24);margin-right:20px;cursor:pointer}.image-wrapper .image-item:hover .remove-image{display:block}.image-wrapper .image-item.has-image{background-image:none}.vue-swatches__trigger{border:1px solid #d3d3d3}.helper-container{display:block}.helper-container .group code{font-weight:700} \ No newline at end of file diff --git a/packages/Webkul/Ui/publishable/assets/js/ui.js b/packages/Webkul/Ui/publishable/assets/js/ui.js index 0c1379086..dedd23f01 100644 --- a/packages/Webkul/Ui/publishable/assets/js/ui.js +++ b/packages/Webkul/Ui/publishable/assets/js/ui.js @@ -1 +1,2 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=0)}({"+CM9":function(t,e,n){"use strict";var r=n("Ds5P"),i=n("ot5s")(!1),o=[].indexOf,a=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n("NNrz")(o)),"Array",{indexOf:function(t){return a?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},"+E39":function(t,e,n){t.exports=!n("S82l")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"+Mt+":function(t,e,n){"use strict";var r=n("Ds5P"),i=n("7gX0"),o=n("OzIq"),a=n("7O1s"),s=n("nphH");r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return s(e,t()).then(function(){return n})}:t,n?function(n){return s(e,t()).then(function(){throw n})}:t)}})},"+ZMJ":function(t,e,n){var r=n("lOnJ");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},"+vXH":function(t,e,n){n("77Ug")("Float64",8,function(t){return function(e,n,r){return t(this,e,n,r)}})},"+wdr":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={data:function(){return{sample:"",image_file:"",file:null,newImage:""}},mounted:function(){this.sample="";var t=this.$el.getElementsByTagName("input")[0],e=this;t.onchange=function(){var n=new FileReader;n.readAsDataURL(t.files[0]),n.onload=function(t){this.img=document.getElementsByTagName("input")[0],this.img.src=t.target.result,e.newImage=this.img.src,e.changePreview()}}},methods:{removePreviewImage:function(){this.sample=""},changePreview:function(){this.sample=this.newImage}},computed:{getInputImage:function(){console.log(this.imageData)}}}},"+yjc":function(t,e,n){var r=n("UKM+");n("3i66")("isSealed",function(t){return function(e){return!r(e)||!!t&&t(e)}})},"/whu":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},0:function(t,e,n){n("J66Q"),n("Oy72"),t.exports=n("MT9B")},"07k+":function(t,e,n){for(var r,i=n("OzIq"),o=n("2p1q"),a=n("ulTY"),s=a("typed_array"),c=a("view"),u=!(!i.ArrayBuffer||!i.DataView),l=u,f=0,p="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f<9;)(r=i[p[f++]])?(o(r.prototype,s,!0),o(r.prototype,c,!0)):l=!1;t.exports={ABV:u,CONSTR:l,TYPED:s,VIEW:c}},"0Rih":function(t,e,n){"use strict";var r=n("OzIq"),i=n("Ds5P"),o=n("R3AP"),a=n("A16L"),s=n("1aA0"),c=n("vmSO"),u=n("9GpA"),l=n("UKM+"),f=n("zgIt"),p=n("qkyc"),d=n("yYvK"),h=n("kic5");t.exports=function(t,e,n,v,g,m){var y=r[t],b=y,w=g?"set":"add",x=b&&b.prototype,_={},k=function(t){var e=x[t];o(x,t,"delete"==t?function(t){return!(m&&!l(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(m&&!l(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return m&&!l(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof b&&(m||x.forEach&&!f(function(){(new b).entries().next()}))){var S=new b,D=S[w](m?{}:-0,1)!=S,C=f(function(){S.has(1)}),O=p(function(t){new b(t)}),E=!m&&f(function(){for(var t=new b,e=5;e--;)t[w](e,e);return!t.has(-0)});O||((b=e(function(e,n){u(e,b,t);var r=h(new y,e,b);return void 0!=n&&c(n,g,r[w],r),r})).prototype=x,x.constructor=b),(C||E)&&(k("delete"),k("has"),g&&k("get")),(E||D)&&k(w),m&&x.clear&&delete x.clear}else b=v.getConstructor(e,t,g,w),a(b.prototype,n),s.NEED=!0;return d(b,t),_[t]=b,i(i.G+i.W+i.F*(b!=y),_),m||v.setStrong(b,t,g),b}},"0pGU":function(t,e,n){"use strict";var r=n("DIVP");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"11aO":function(t,e,n){var r=n("VU/8")(n("LxYr"),null,!1,null,null,null);t.exports=r.exports},"13ON":function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"tabs"},[n("ul",t._l(t.tabs,function(e){return n("li",{class:{active:e.isActive},on:{click:function(n){return t.selectTab(e)}}},[n("a",[t._v(t._s(e.name))])])}),0)]),t._v(" "),n("div",{staticClass:"tabs-content"},[t._t("default")],2)])},staticRenderFns:[]}},"1A13":function(t,e,n){"use strict";var r=n("49qz")(!0);n("uc2A")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},"1ETD":function(t,e,n){var r=n("kkCw")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},"1aA0":function(t,e,n){var r=n("ulTY")("meta"),i=n("UKM+"),o=n("WBcL"),a=n("lDLk").f,s=0,c=Object.isExtensible||function(){return!0},u=!n("zgIt")(function(){return c(Object.preventExtensions({}))}),l=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},f=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!c(t))return"F";if(!e)return"E";l(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!c(t))return!0;if(!e)return!1;l(t)}return t[r].w},onFreeze:function(t){return u&&f.NEED&&c(t)&&!o(t,r)&&l(t),t}}},"1ip3":function(t,e,n){var r=n("Ds5P");r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},"1uLP":function(t,e,n){var r=n("Ds5P");r(r.G+r.W+r.F*!n("07k+").ABV,{DataView:n("LrcN").DataView})},"2JMG":function(t,e,n){var r=n("VU/8")(n("G3lE"),null,!1,null,null,null);t.exports=r.exports},"2VSL":function(t,e,n){var r=n("BbyF"),i=n("xAdt"),o=n("/whu");t.exports=function(t,e,n,a){var s=String(o(t)),c=s.length,u=void 0===n?" ":String(n),l=r(e);if(l<=c||""==u)return s;var f=l-c,p=i.call(u,Math.ceil(f/u.length));return p.length>f&&(p=p.slice(0,f)),a?p+s:s+p}},"2p1q":function(t,e,n){var r=n("lDLk"),i=n("fU25");t.exports=n("bUqO")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},"31/P":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default={name:"tree-view",inheritAttrs:!1,props:{inputType:String,nameField:String,idField:String,captionField:String,childrenField:String,valueField:String,items:{type:[Array,String,Object],required:!1,default:null},value:{type:Array,required:!1,default:null},behavior:{type:String,required:!1,default:"reactive"},savedValues:{type:Array,required:!1,default:null}},created:function(){-1!==this.savedValues.indexOf(this.items[this.valueField])&&this.value.push(this.items)},computed:{caption:function(){return this.items[this.captionField]},allChildren:function(){var t=this,e=[];return function n(i){if(i[t.childrenField]&&t.getLength(i[t.childrenField])>0)if("object"==r(i[t.childrenField]))for(var o in i[t.childrenField])n(i[t.childrenField][o]);else i[t.childrenField].forEach(function(t){return n(t)});else e.push(i)}(this.items),e},hasChildren:function(){return!!this.items[this.childrenField]&&this.getLength(this.items[this.childrenField])>0},hasSelection:function(){return!!this.value&&this.value.length>0},isAllChildrenSelected:function(){var t=this;return this.hasChildren&&this.hasSelection&&this.allChildren.every(function(e){return t.value.some(function(n){return n[t.idField]===e[t.idField]})})},isSomeChildrenSelected:function(){var t=this;return this.hasChildren&&this.hasSelection&&this.allChildren.some(function(e){return t.value.some(function(n){return n[t.idField]===e[t.idField]})})}},methods:{getLength:function(t){if("object"==(void 0===t?"undefined":r(t))){var e=0;for(var n in t)e++;return e}return t.length},generateRoot:function(){var t=this;return"checkbox"==this.inputType?"reactive"==this.behavior?this.$createElement("tree-checkbox",{props:{id:this.items[this.idField],label:this.caption,nameField:this.nameField,modelValue:this.items[this.valueField],inputValue:this.hasChildren?this.isSomeChildrenSelected:this.value,value:this.hasChildren?this.isAllChildrenSelected:this.items},on:{change:function(e){t.hasChildren?(t.isAllChildrenSelected?t.allChildren.forEach(function(e){var n=t.value.indexOf(e);t.value.splice(n,1)}):t.allChildren.forEach(function(e){var n=!1;t.value.forEach(function(t){t.key==e.key&&(n=!0)}),n||t.value.push(e)}),t.$emit("input",t.value)):t.$emit("input",e)}}}):this.$createElement("tree-checkbox",{props:{id:this.items[this.idField],label:this.caption,nameField:this.nameField,modelValue:this.items[this.valueField],inputValue:this.value,value:this.items}}):"radio"==this.inputType?this.$createElement("tree-radio",{props:{id:this.items[this.idField],label:this.caption,nameField:this.nameField,modelValue:this.items[this.valueField],value:this.savedValues}}):void 0},generateChild:function(t){var e=this;return this.$createElement("tree-item",{on:{input:function(t){e.$emit("input",t)}},props:{items:t,value:this.value,savedValues:this.savedValues,nameField:this.nameField,inputType:this.inputType,captionField:this.captionField,childrenField:this.childrenField,valueField:this.valueField,idField:this.idField,behavior:this.behavior}})},generateChildren:function(){var t=this,e=[];if(this.items[this.childrenField])if("object"==r(this.items[this.childrenField]))for(var n in this.items[this.childrenField])e.push(this.generateChild(this.items[this.childrenField][n]));else this.items[this.childrenField].forEach(function(n){e.push(t.generateChild(n))});return e},generateIcon:function(){var t=this;return this.$createElement("i",{class:["expand-icon"],on:{click:function(e){t.$el.classList.toggle("active")}}})},generateFolderIcon:function(){return this.$createElement("i",{class:["icon","folder-icon"]})}},render:function(t){return t("div",{class:["tree-item","active",this.hasChildren?"has-children":""]},[this.generateIcon(),this.generateFolderIcon(),this.generateRoot()].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e1&&s.call(r[0],n,function(){for(i=1;i=u?t?"":void 0:(o=s.charCodeAt(c))<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?t?s.charAt(c):o:t?s.slice(c,c+2):a-56320+(o-55296<<10)+65536}}},"4IZP":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},"4Q0w":function(t,e,n){var r=n("kkCw")("toPrimitive"),i=Date.prototype;r in i||n("2p1q")(i,r,n("jB26"))},"4RlI":function(t,e,n){"use strict";n("y325")("blink",function(t){return function(){return t(this,"blink","","")}})},"4ZU1":function(t,e,n){var r=n("lDLk"),i=n("Ds5P"),o=n("DIVP"),a=n("s4j0");i(i.S+i.F*n("zgIt")(function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,n){o(t),e=a(e,!0),o(n);try{return r.f(t,e,n),!0}catch(t){return!1}}})},"52Wt":function(t,e,n){n("77Ug")("Int8",1,function(t){return function(e,n,r){return t(this,e,n,r)}})},"5iw+":function(t,e,n){"use strict";n("y325")("strike",function(t){return function(){return t(this,"strike","","")}})},"6wXy":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{title:String,id:String,className:String,active:Boolean},inject:["$validator"],data:function(){return{isActive:!1,imageData:"",hasError:!1}},mounted:function(){var t=this;eventBus.$on("onFormError",function(){$(t.$el).find(".control-group").each(function(e,n){$(n).hasClass("has-error")&&(t.hasError=!0)})}),this.isActive=this.active},methods:{toggleAccordian:function(){this.isActive=!this.isActive}},computed:{iconClass:function(){return{"accordian-down-icon":!this.isActive,"accordian-up-icon":this.isActive}}}}},"73qY":function(t,e,n){t.exports=n("VWgF")("native-function-to-string",Function.toString)},"77Pl":function(t,e,n){var r=n("EqjI");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},"77Ug":function(t,e,n){"use strict";if(n("bUqO")){var r=n("V3l/"),i=n("OzIq"),o=n("zgIt"),a=n("Ds5P"),s=n("07k+"),c=n("LrcN"),u=n("rFzY"),l=n("9GpA"),f=n("fU25"),p=n("2p1q"),d=n("A16L"),h=n("oeih"),v=n("BbyF"),g=n("8D8H"),m=n("zo/l"),y=n("s4j0"),b=n("WBcL"),w=n("wC1N"),x=n("UKM+"),_=n("FryR"),k=n("9vb1"),S=n("7ylX"),D=n("KOrd"),C=n("WcO1").f,O=n("SHe9"),E=n("ulTY"),M=n("kkCw"),P=n("LhTa"),F=n("ot5s"),I=n("7O1s"),T=n("WgSQ"),A=n("bN1p"),L=n("qkyc"),j=n("CEne"),N=n("zCYm"),R=n("DPsE"),V=n("lDLk"),z=n("x9zv"),U=V.f,B=z.f,q=i.RangeError,Y=i.TypeError,W=i.Uint8Array,H=Array.prototype,$=c.ArrayBuffer,G=c.DataView,K=P(0),X=P(2),J=P(3),Z=P(4),Q=P(5),tt=P(6),et=F(!0),nt=F(!1),rt=T.values,it=T.keys,ot=T.entries,at=H.lastIndexOf,st=H.reduce,ct=H.reduceRight,ut=H.join,lt=H.sort,ft=H.slice,pt=H.toString,dt=H.toLocaleString,ht=M("iterator"),vt=M("toStringTag"),gt=E("typed_constructor"),mt=E("def_constructor"),yt=s.CONSTR,bt=s.TYPED,wt=s.VIEW,xt=P(1,function(t,e){return Ct(I(t,t[mt]),e)}),_t=o(function(){return 1===new W(new Uint16Array([1]).buffer)[0]}),kt=!!W&&!!W.prototype.set&&o(function(){new W(1).set({})}),St=function(t,e){var n=h(t);if(n<0||n%e)throw q("Wrong offset!");return n},Dt=function(t){if(x(t)&&bt in t)return t;throw Y(t+" is not a typed array!")},Ct=function(t,e){if(!(x(t)&> in t))throw Y("It is not a typed array constructor!");return new t(e)},Ot=function(t,e){return Et(I(t,t[mt]),e)},Et=function(t,e){for(var n=0,r=e.length,i=Ct(t,r);r>n;)i[n]=e[n++];return i},Mt=function(t,e,n){U(t,e,{get:function(){return this._d[n]}})},Pt=function(t){var e,n,r,i,o,a,s=_(t),c=arguments.length,l=c>1?arguments[1]:void 0,f=void 0!==l,p=O(s);if(void 0!=p&&!k(p)){for(a=p.call(s),r=[],e=0;!(o=a.next()).done;e++)r.push(o.value);s=r}for(f&&c>2&&(l=u(l,arguments[2],2)),e=0,n=v(s.length),i=Ct(this,n);n>e;e++)i[e]=f?l(s[e],e):s[e];return i},Ft=function(){for(var t=0,e=arguments.length,n=Ct(this,e);e>t;)n[t]=arguments[t++];return n},It=!!W&&o(function(){dt.call(new W(1))}),Tt=function(){return dt.apply(It?ft.call(Dt(this)):Dt(this),arguments)},At={copyWithin:function(t,e){return R.call(Dt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return Z(Dt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return N.apply(Dt(this),arguments)},filter:function(t){return Ot(this,X(Dt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return Q(Dt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return tt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){K(Dt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return nt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return et(Dt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ut.apply(Dt(this),arguments)},lastIndexOf:function(t){return at.apply(Dt(this),arguments)},map:function(t){return xt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return st.apply(Dt(this),arguments)},reduceRight:function(t){return ct.apply(Dt(this),arguments)},reverse:function(){for(var t,e=Dt(this).length,n=Math.floor(e/2),r=0;r1?arguments[1]:void 0)},sort:function(t){return lt.call(Dt(this),t)},subarray:function(t,e){var n=Dt(this),r=n.length,i=m(t,r);return new(I(n,n[mt]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===e?r:m(e,r))-i))}},Lt=function(t,e){return Ot(this,ft.call(Dt(this),t,e))},jt=function(t){Dt(this);var e=St(arguments[1],1),n=this.length,r=_(t),i=v(r.length),o=0;if(i+e>n)throw q("Wrong length!");for(;o255?255:255&r),i.v[d](n*e+i.o,r,_t)}(this,n,t)},enumerable:!0})};b?(h=n(function(t,n,r,i){l(t,h,u,"_d");var o,a,s,c,f=0,d=0;if(x(n)){if(!(n instanceof $||"ArrayBuffer"==(c=w(n))||"SharedArrayBuffer"==c))return bt in n?Et(h,n):Pt.call(h,n);o=n,d=St(r,e);var m=n.byteLength;if(void 0===i){if(m%e)throw q("Wrong length!");if((a=m-d)<0)throw q("Wrong length!")}else if((a=v(i)*e)+d>m)throw q("Wrong length!");s=a/e}else s=g(n),o=new $(a=s*e);for(p(t,"_d",{b:o,o:d,l:a,e:s,v:new G(o)});f0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},"7KvD":function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"7O1s":function(t,e,n){var r=n("DIVP"),i=n("XSOZ"),o=n("kkCw")("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[o])?e:i(n)}},"7aQn":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"tree-view",inheritAttrs:!1,props:{inputType:{type:String,required:!1,default:"checkbox"},nameField:{type:String,required:!1,default:"permissions"},idField:{type:String,required:!1,default:"id"},valueField:{type:String,required:!1,default:"value"},captionField:{type:String,required:!1,default:"name"},childrenField:{type:String,required:!1,default:"children"},items:{type:[Array,String,Object],required:!1,default:function(){return[]}},behavior:{type:String,required:!1,default:"reactive"},value:{type:[Array,String,Object],required:!1,default:function(){return[]}}},data:function(){return{finalValues:[]}},computed:{savedValues:function(){return this.value?"radio"==this.inputType?[this.value]:"string"==typeof this.value?JSON.parse(this.value):this.value:[]}},methods:{generateChildren:function(){var t=[],e="string"==typeof this.items?JSON.parse(this.items):this.items;for(var n in e)t.push(this.generateTreeItem(e[n]));return t},generateTreeItem:function(t){var e=this;return this.$createElement("tree-item",{props:{items:t,value:this.finalValues,savedValues:this.savedValues,nameField:this.nameField,inputType:this.inputType,captionField:this.captionField,childrenField:this.childrenField,valueField:this.valueField,idField:this.idField,behavior:this.behavior},on:{input:function(t){e.finalValues=t}}})}},render:function(t){return t("div",{class:["tree-container"]},[this.generateChildren()])}}},"7gX0":function(t,e){var n=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=n)},"7ylX":function(t,e,n){var r=n("DIVP"),i=n("twxM"),o=n("QKXm"),a=n("mZON")("IE_PROTO"),s=function(){},c=function(){var t,e=n("jhxf")("iframe"),r=o.length;for(e.style.display="none",n("d075").appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("