Merge branch 'master' into new-published-files

Merged with master.
This commit is contained in:
devansh bawari 2020-11-26 14:38:44 +05:30
commit 2e27be566d
76 changed files with 2041 additions and 449 deletions

View File

@ -37,6 +37,7 @@
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
"maatwebsite/excel": "3.1.19",
"paypal/paypal-checkout-sdk": "1.0.1",
"prettus/l5-repository": "^2.6",
"tymon/jwt-auth": "^1.0.0"
},
@ -107,7 +108,8 @@
"Webkul\\CMS\\": "packages/Webkul/CMS/src",
"Webkul\\Velocity\\": "packages/Webkul/Velocity/src",
"Webkul\\BookingProduct\\": "packages/Webkul/BookingProduct/src",
"Webkul\\SocialLogin\\": "packages/Webkul/SocialLogin/src"
"Webkul\\SocialLogin\\": "packages/Webkul/SocialLogin/src",
"Webkul\\DebugBar\\": "packages/Webkul/DebugBar/src"
}
},

273
composer.lock generated
View File

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "d666b5a314de775c8d05fb2f94aa9e01",
"content-hash": "fc14e417d44f0efbc8d33e5ac654fba5",
"packages": [
{
"name": "algolia/algoliasearch-client-php",
"version": "2.7.0",
"version": "2.7.2",
"source": {
"type": "git",
"url": "https://github.com/algolia/algoliasearch-client-php.git",
"reference": "ce8b35a5aa842ad3e0dc05bbd7aaf5ed82481d71"
"reference": "a915109c76d5f4af67f10cd21855ea2d4c9aec9f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/algolia/algoliasearch-client-php/zipball/ce8b35a5aa842ad3e0dc05bbd7aaf5ed82481d71",
"reference": "ce8b35a5aa842ad3e0dc05bbd7aaf5ed82481d71",
"url": "https://api.github.com/repos/algolia/algoliasearch-client-php/zipball/a915109c76d5f4af67f10cd21855ea2d4c9aec9f",
"reference": "a915109c76d5f4af67f10cd21855ea2d4c9aec9f",
"shasum": ""
},
"require": {
@ -74,20 +74,20 @@
"php",
"search"
],
"time": "2020-06-25T08:47:13+00:00"
"time": "2020-11-24T10:16:46+00:00"
},
{
"name": "astrotomic/laravel-translatable",
"version": "v11.9.0",
"version": "v11.9.1",
"source": {
"type": "git",
"url": "https://github.com/Astrotomic/laravel-translatable.git",
"reference": "85a36a4c909fa1b5c800f50f91b96b433bdbfd2c"
"reference": "d853a3c34be42941dc83c5cddd9e1e98c71abae1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Astrotomic/laravel-translatable/zipball/85a36a4c909fa1b5c800f50f91b96b433bdbfd2c",
"reference": "85a36a4c909fa1b5c800f50f91b96b433bdbfd2c",
"url": "https://api.github.com/repos/Astrotomic/laravel-translatable/zipball/d853a3c34be42941dc83c5cddd9e1e98c71abae1",
"reference": "d853a3c34be42941dc83c5cddd9e1e98c71abae1",
"shasum": ""
},
"require": {
@ -139,20 +139,20 @@
"laravel",
"translation"
],
"time": "2020-09-09T19:37:03+00:00"
"time": "2020-11-19T14:10:38+00:00"
},
{
"name": "babenkoivan/elastic-adapter",
"version": "v1.7.2",
"version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/babenkoivan/elastic-adapter.git",
"reference": "aec0cf336f0efe605ac055dbdeaab80b5e25a5c5"
"reference": "e9e984e6d171235219d99b29992e3a001d5551b4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/babenkoivan/elastic-adapter/zipball/aec0cf336f0efe605ac055dbdeaab80b5e25a5c5",
"reference": "aec0cf336f0efe605ac055dbdeaab80b5e25a5c5",
"url": "https://api.github.com/repos/babenkoivan/elastic-adapter/zipball/e9e984e6d171235219d99b29992e3a001d5551b4",
"reference": "e9e984e6d171235219d99b29992e3a001d5551b4",
"shasum": ""
},
"require": {
@ -188,7 +188,7 @@
"elasticsearch",
"php"
],
"time": "2020-10-11T15:54:20+00:00"
"time": "2020-11-14T15:09:00+00:00"
},
{
"name": "babenkoivan/elastic-client",
@ -986,16 +986,16 @@
},
{
"name": "egulias/email-validator",
"version": "2.1.23",
"version": "2.1.24",
"source": {
"type": "git",
"url": "https://github.com/egulias/EmailValidator.git",
"reference": "5fa792ad1853ae2bc60528dd3e5cbf4542d3c1df"
"reference": "ca90a3291eee1538cd48ff25163240695bd95448"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/5fa792ad1853ae2bc60528dd3e5cbf4542d3c1df",
"reference": "5fa792ad1853ae2bc60528dd3e5cbf4542d3c1df",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ca90a3291eee1538cd48ff25163240695bd95448",
"reference": "ca90a3291eee1538cd48ff25163240695bd95448",
"shasum": ""
},
"require": {
@ -1040,20 +1040,20 @@
"validation",
"validator"
],
"time": "2020-10-31T20:37:35+00:00"
"time": "2020-11-14T15:56:27+00:00"
},
{
"name": "elasticsearch/elasticsearch",
"version": "v7.9.1",
"version": "v7.10.0",
"source": {
"type": "git",
"url": "https://github.com/elastic/elasticsearch-php.git",
"reference": "38e821f37491bd91fe06b18b88613128950a11bb"
"reference": "f4a5741f1d1966a4d0a3a3f68666e6d81432c343"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/38e821f37491bd91fe06b18b88613128950a11bb",
"reference": "38e821f37491bd91fe06b18b88613128950a11bb",
"url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/f4a5741f1d1966a4d0a3a3f68666e6d81432c343",
"reference": "f4a5741f1d1966a4d0a3a3f68666e6d81432c343",
"shasum": ""
},
"require": {
@ -1066,6 +1066,7 @@
"cpliakas/git-wrapper": "~2.0",
"doctrine/inflector": "^1.3",
"ext-yaml": "*",
"ext-zip": "*",
"mockery/mockery": "^1.2",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^7.5",
@ -1104,7 +1105,7 @@
"elasticsearch",
"search"
],
"time": "2020-10-06T13:03:50+00:00"
"time": "2020-11-11T16:31:00+00:00"
},
{
"name": "ezimuel/guzzlestreams",
@ -1845,16 +1846,16 @@
},
{
"name": "konekt/enum-eloquent",
"version": "1.6.0",
"version": "1.6.1",
"source": {
"type": "git",
"url": "https://github.com/artkonekt/enum-eloquent.git",
"reference": "4f6134f83e41da5501c0790584f9bc385f5b64b8"
"reference": "ef916a58df1db96f3d7d3f5c98451f48535d5c6d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/artkonekt/enum-eloquent/zipball/4f6134f83e41da5501c0790584f9bc385f5b64b8",
"reference": "4f6134f83e41da5501c0790584f9bc385f5b64b8",
"url": "https://api.github.com/repos/artkonekt/enum-eloquent/zipball/ef916a58df1db96f3d7d3f5c98451f48535d5c6d",
"reference": "ef916a58df1db96f3d7d3f5c98451f48535d5c6d",
"shasum": ""
},
"require": {
@ -1864,7 +1865,6 @@
},
"require-dev": {
"illuminate/events": "5.*|6.*|7.*|8.*",
"ocramius/package-versions": "^1.2",
"phpunit/phpunit": "6.3 - 7.5|~8.0"
},
"type": "library",
@ -1909,7 +1909,7 @@
"konekt",
"laravel"
],
"time": "2020-09-12T07:02:31+00:00"
"time": "2020-11-04T12:08:02+00:00"
},
{
"name": "laravel/framework",
@ -3012,16 +3012,16 @@
},
{
"name": "myclabs/php-enum",
"version": "1.7.6",
"version": "1.7.7",
"source": {
"type": "git",
"url": "https://github.com/myclabs/php-enum.git",
"reference": "5f36467c7a87e20fbdc51e524fd8f9d1de80187c"
"reference": "d178027d1e679832db9f38248fcc7200647dc2b7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/php-enum/zipball/5f36467c7a87e20fbdc51e524fd8f9d1de80187c",
"reference": "5f36467c7a87e20fbdc51e524fd8f9d1de80187c",
"url": "https://api.github.com/repos/myclabs/php-enum/zipball/d178027d1e679832db9f38248fcc7200647dc2b7",
"reference": "d178027d1e679832db9f38248fcc7200647dc2b7",
"shasum": ""
},
"require": {
@ -3054,7 +3054,7 @@
"keywords": [
"enum"
],
"time": "2020-02-14T08:15:52+00:00"
"time": "2020-11-14T18:14:52+00:00"
},
{
"name": "namshi/jose",
@ -3252,16 +3252,16 @@
},
{
"name": "opis/closure",
"version": "3.6.0",
"version": "3.6.1",
"source": {
"type": "git",
"url": "https://github.com/opis/closure.git",
"reference": "c547f8262a5fa9ff507bd06cc394067b83a75085"
"reference": "943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opis/closure/zipball/c547f8262a5fa9ff507bd06cc394067b83a75085",
"reference": "c547f8262a5fa9ff507bd06cc394067b83a75085",
"url": "https://api.github.com/repos/opis/closure/zipball/943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5",
"reference": "943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5",
"shasum": ""
},
"require": {
@ -3309,7 +3309,95 @@
"serialization",
"serialize"
],
"time": "2020-10-11T21:42:15+00:00"
"time": "2020-11-07T02:01:34+00:00"
},
{
"name": "paypal/paypal-checkout-sdk",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/paypal/Checkout-PHP-SDK.git",
"reference": "ed6a55075448308b87a8b59dcb7fedf04a048cb1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paypal/Checkout-PHP-SDK/zipball/ed6a55075448308b87a8b59dcb7fedf04a048cb1",
"reference": "ed6a55075448308b87a8b59dcb7fedf04a048cb1",
"shasum": ""
},
"require": {
"paypal/paypalhttp": "1.0.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
},
"type": "library",
"autoload": {
"psr-4": {
"PayPalCheckoutSdk\\": "lib/PayPalCheckoutSdk",
"Sample\\": "samples/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"https://github.com/paypal/Checkout-PHP-SDK/blob/master/LICENSE"
],
"authors": [
{
"name": "PayPal",
"homepage": "https://github.com/paypal/Checkout-PHP-SDK/contributors"
}
],
"description": "PayPal's PHP SDK for Checkout REST APIs",
"homepage": "http://github.com/paypal/Checkout-PHP-SDK/",
"keywords": [
"checkout",
"orders",
"payments",
"paypal",
"rest",
"sdk"
],
"time": "2019-11-07T23:16:44+00:00"
},
{
"name": "paypal/paypalhttp",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/paypal/paypalhttp_php.git",
"reference": "1ad9b846a046f09d6135cbf2cbaa7701bbc630a3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paypal/paypalhttp_php/zipball/1ad9b846a046f09d6135cbf2cbaa7701bbc630a3",
"reference": "1ad9b846a046f09d6135cbf2cbaa7701bbc630a3",
"shasum": ""
},
"require": {
"ext-curl": "*"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"wiremock-php/wiremock-php": "1.43.2"
},
"type": "library",
"autoload": {
"psr-4": {
"PayPalHttp\\": "lib/PayPalHttp"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PayPal",
"homepage": "https://github.com/paypal/paypalhttp_php/contributors"
}
],
"time": "2019-11-06T21:27:12+00:00"
},
{
"name": "phenx/php-font-lib",
@ -6334,23 +6422,23 @@
},
{
"name": "voku/portable-ascii",
"version": "1.5.3",
"version": "1.5.6",
"source": {
"type": "git",
"url": "https://github.com/voku/portable-ascii.git",
"reference": "25bcbf01678930251fd572891447d9e318a6e2b8"
"reference": "80953678b19901e5165c56752d087fc11526017c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/voku/portable-ascii/zipball/25bcbf01678930251fd572891447d9e318a6e2b8",
"reference": "25bcbf01678930251fd572891447d9e318a6e2b8",
"url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c",
"reference": "80953678b19901e5165c56752d087fc11526017c",
"shasum": ""
},
"require": {
"php": ">=7.0.0"
},
"require-dev": {
"phpunit/phpunit": "~6.0 || ~7.0"
"phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
},
"suggest": {
"ext-intl": "Use Intl for transliterator_transliterate() support"
@ -6378,7 +6466,7 @@
"clean",
"php"
],
"time": "2020-07-22T23:32:04+00:00"
"time": "2020-11-12T00:07:28+00:00"
}
],
"packages-dev": [
@ -6854,16 +6942,16 @@
},
{
"name": "codeception/module-webdriver",
"version": "1.1.3",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/Codeception/module-webdriver.git",
"reference": "b7dc227f91730e7abb520439decc9ad0677b8a55"
"reference": "f719edc1eca033e0dc5fd8d99db122070b1fb933"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/b7dc227f91730e7abb520439decc9ad0677b8a55",
"reference": "b7dc227f91730e7abb520439decc9ad0677b8a55",
"url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/f719edc1eca033e0dc5fd8d99db122070b1fb933",
"reference": "f719edc1eca033e0dc5fd8d99db122070b1fb933",
"shasum": ""
},
"require": {
@ -6902,7 +6990,7 @@
"browser-testing",
"codeception"
],
"time": "2020-10-24T15:41:19+00:00"
"time": "2020-11-16T06:50:15+00:00"
},
{
"name": "codeception/phpunit-wrapper",
@ -6980,36 +7068,31 @@
},
{
"name": "doctrine/instantiator",
"version": "1.3.1",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "f350df0268e904597e3bd9c4685c53e0e333feea"
"reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea",
"reference": "f350df0268e904597e3bd9c4685c53e0e333feea",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b",
"reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^6.0",
"doctrine/coding-standard": "^8.0",
"ext-pdo": "*",
"ext-phar": "*",
"phpbench/phpbench": "^0.13",
"phpstan/phpstan-phpunit": "^0.11",
"phpstan/phpstan-shim": "^0.11",
"phpunit/phpunit": "^7.0"
"phpbench/phpbench": "^0.13 || 1.0.0-alpha2",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-phpunit": "^0.12",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
@ -7023,7 +7106,7 @@
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"homepage": "http://ocramius.github.com/"
"homepage": "https://ocramius.github.io/"
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
@ -7032,7 +7115,7 @@
"constructor",
"instantiate"
],
"time": "2020-05-29T17:27:14+00:00"
"time": "2020-11-10T18:47:58+00:00"
},
{
"name": "facade/ignition-contracts",
@ -7322,16 +7405,16 @@
},
{
"name": "myclabs/deep-copy",
"version": "1.10.1",
"version": "1.10.2",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5"
"reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5",
"reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220",
"reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220",
"shasum": ""
},
"require": {
@ -7366,7 +7449,7 @@
"object",
"object graph"
],
"time": "2020-06-29T13:22:24+00:00"
"time": "2020-11-13T09:40:50+00:00"
},
{
"name": "nunomaduro/collision",
@ -7542,23 +7625,23 @@
},
{
"name": "php-webdriver/webdriver",
"version": "1.8.3",
"version": "1.9.0",
"source": {
"type": "git",
"url": "https://github.com/php-webdriver/php-webdriver.git",
"reference": "fb0fc4cb01c70a7790a5fcc91d461b88c83174a2"
"reference": "e3633154554605274cc9d59837f55a7427d72003"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/fb0fc4cb01c70a7790a5fcc91d461b88c83174a2",
"reference": "fb0fc4cb01c70a7790a5fcc91d461b88c83174a2",
"url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/e3633154554605274cc9d59837f55a7427d72003",
"reference": "e3633154554605274cc9d59837f55a7427d72003",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-json": "*",
"ext-zip": "*",
"php": "^5.6 || ~7.0",
"php": "^5.6 || ~7.0 || ^8.0",
"symfony/polyfill-mbstring": "^1.12",
"symfony/process": "^2.8 || ^3.1 || ^4.0 || ^5.0"
},
@ -7568,12 +7651,10 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0",
"ondram/ci-detector": "^2.1 || ^3.5",
"php-coveralls/php-coveralls": "^2.0",
"php-mock/php-mock-phpunit": "^1.1",
"php-coveralls/php-coveralls": "^2.4",
"php-mock/php-mock-phpunit": "^1.1 || ^2.0",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpunit/phpunit": "^5.7",
"sebastian/environment": "^1.3.4 || ^2.0 || ^3.0",
"sminnee/phpunit-mock-objects": "^3.4",
"phpunit/phpunit": "^5.7 || ^7 || ^8 || ^9",
"squizlabs/php_codesniffer": "^3.5",
"symfony/var-dumper": "^3.3 || ^4.0 || ^5.0"
},
@ -7607,7 +7688,7 @@
"selenium",
"webdriver"
],
"time": "2020-10-06T19:10:04+00:00"
"time": "2020-11-19T15:21:05+00:00"
},
{
"name": "phpdocumentor/reflection-common",
@ -8073,39 +8154,39 @@
},
{
"name": "phpunit/phpunit",
"version": "8.5.8",
"version": "8.5.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "34c18baa6a44f1d1fbf0338907139e9dce95b997"
"reference": "f5c8a5dd5e7e8d68d7562bfb48d47287d33937d6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/34c18baa6a44f1d1fbf0338907139e9dce95b997",
"reference": "34c18baa6a44f1d1fbf0338907139e9dce95b997",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f5c8a5dd5e7e8d68d7562bfb48d47287d33937d6",
"reference": "f5c8a5dd5e7e8d68d7562bfb48d47287d33937d6",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.2.0",
"doctrine/instantiator": "^1.3.1",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"ext-xmlwriter": "*",
"myclabs/deep-copy": "^1.9.1",
"myclabs/deep-copy": "^1.10.0",
"phar-io/manifest": "^1.0.3",
"phar-io/version": "^2.0.1",
"php": "^7.2",
"phpspec/prophecy": "^1.8.1",
"phpunit/php-code-coverage": "^7.0.7",
"phpspec/prophecy": "^1.10.3",
"phpunit/php-code-coverage": "^7.0.10",
"phpunit/php-file-iterator": "^2.0.2",
"phpunit/php-text-template": "^1.2.1",
"phpunit/php-timer": "^2.1.2",
"sebastian/comparator": "^3.0.2",
"sebastian/diff": "^3.0.2",
"sebastian/environment": "^4.2.2",
"sebastian/exporter": "^3.1.1",
"sebastian/environment": "^4.2.3",
"sebastian/exporter": "^3.1.2",
"sebastian/global-state": "^3.0.0",
"sebastian/object-enumerator": "^3.0.3",
"sebastian/resource-operations": "^2.0.1",
@ -8152,7 +8233,7 @@
"testing",
"xunit"
],
"time": "2020-06-22T07:06:58+00:00"
"time": "2020-11-10T12:51:38+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",

View File

@ -280,6 +280,7 @@ return [
Webkul\Velocity\Providers\VelocityServiceProvider::class,
Webkul\BookingProduct\Providers\BookingProductServiceProvider::class,
Webkul\SocialLogin\Providers\SocialLoginServiceProvider::class,
Webkul\DebugBar\Providers\DebugBarServiceProvider::class,
],
/*
@ -337,6 +338,7 @@ return [
'PDF' => Barryvdh\DomPDF\Facade::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
'Concord' => Konekt\Concord\Facades\Concord::class,
'Helper' => Konekt\Concord\Facades\Helper::class
'Helper' => Konekt\Concord\Facades\Helper::class,
'Debugbar' => Barryvdh\Debugbar\Facade::class,
],
];

View File

@ -12,21 +12,30 @@ return [
*
*/
\Webkul\Admin\Providers\ModuleServiceProvider::class,
\Webkul\API\Providers\ModuleServiceProvider::class,
\Webkul\Attribute\Providers\ModuleServiceProvider::class,
\Webkul\BookingProduct\Providers\ModuleServiceProvider::class,
\Webkul\CartRule\Providers\ModuleServiceProvider::class,
\Webkul\CatalogRule\Providers\ModuleServiceProvider::class,
\Webkul\Category\Providers\ModuleServiceProvider::class,
\Webkul\Checkout\Providers\ModuleServiceProvider::class,
\Webkul\Core\Providers\ModuleServiceProvider::class,
\Webkul\CMS\Providers\ModuleServiceProvider::class,
\Webkul\Customer\Providers\ModuleServiceProvider::class,
\Webkul\Inventory\Providers\ModuleServiceProvider::class,
\Webkul\Payment\Providers\ModuleServiceProvider::class,
\Webkul\Paypal\Providers\ModuleServiceProvider::class,
\Webkul\Product\Providers\ModuleServiceProvider::class,
\Webkul\Rule\Providers\ModuleServiceProvider::class,
\Webkul\Sales\Providers\ModuleServiceProvider::class,
\Webkul\Tax\Providers\ModuleServiceProvider::class,
\Webkul\User\Providers\ModuleServiceProvider::class,
\Webkul\CatalogRule\Providers\ModuleServiceProvider::class,
\Webkul\CartRule\Providers\ModuleServiceProvider::class,
\Webkul\CMS\Providers\ModuleServiceProvider::class,
\Webkul\Velocity\Providers\ModuleServiceProvider::class,
\Webkul\Shipping\Providers\ModuleServiceProvider::class,
\Webkul\Shop\Providers\ModuleServiceProvider::class,
\Webkul\SocialLogin\Providers\ModuleServiceProvider::class,
\Webkul\Tax\Providers\ModuleServiceProvider::class,
\Webkul\Theme\Providers\ModuleServiceProvider::class,
\Webkul\Ui\Providers\ModuleServiceProvider::class,
\Webkul\User\Providers\ModuleServiceProvider::class,
\Webkul\Velocity\Providers\ModuleServiceProvider::class,
]
];

View File

@ -0,0 +1,11 @@
<?php
namespace Webkul\API\Providers;
use Konekt\Concord\BaseModuleServiceProvider;
class ModuleServiceProvider extends BaseModuleServiceProvider
{
protected $models = [
];
}

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/admin.js": "/js/admin.js?id=c849d3c02afc5071f801",
"/js/admin.js": "/js/admin.js?id=e4c3d46b82083613b407",
"/css/admin.css": "/css/admin.css?id=f2b20e4283a639808ef6"
}

View File

@ -0,0 +1,11 @@
<?php
namespace Webkul\Admin\Providers;
use Konekt\Concord\BaseModuleServiceProvider;
class ModuleServiceProvider extends BaseModuleServiceProvider
{
protected $models = [
];
}

View File

@ -2,7 +2,7 @@
<div class="control-group" :class="[errors.has(name) ? 'has-error' : '']">
<label :for="name" :class="checkValidations">
{{ label }}
<span class="locale"> [{{ channel_locale }}] </span>
<span class="locale"> {{ channel_locale ? `[${channel_locale}]` : '' }} </span>
</label>
<select v-if="this.options.length" v-validate="checkValidations" class="control" :id = "name" :name = "name" v-model="savedValue"
@ -10,8 +10,15 @@
<option v-for='(option, index) in this.options' :value="option.value"> {{ option.title }} </option>
</select>
<input v-else type="text" class="control" v-validate="checkValidations" :id = "name" :name = "name" v-model="savedValue"
:data-vv-as="label">
<input v-else
type="text"
class="control"
:id="name"
:name="name"
:placeholder="info"
v-validate="checkValidations"
v-model="savedValue"
:data-vv-as="label">
<span class="control-error" v-if="errors.has(name)">
{{ errors.first(name) }}
@ -24,6 +31,7 @@ export default {
props: [
'name',
'label',
'info',
'options',
'result',
'validations',

View File

@ -529,7 +529,13 @@ return [
'checkbox' => 'خانة اختيار',
'multiselect' => 'تحديد متعدد',
'new-option' => 'خيار جديد',
'is-default' => 'افتراضي'
'is-default' => 'افتراضي',
'remove-image-btn-title' => 'Remove Image',
'videos' => 'Videos',
'video' => 'Video',
'add-video-btn-title' => 'Add Video',
'remove-video-btn-title' => 'Remove Video',
'not-support-video' => 'Your browser does not support the video tag.',
],
'attributes' => [
@ -1362,9 +1368,6 @@ return [
'custom-scripts' => 'Custom Scripts',
'custom-css' => 'Custom CSS',
'custom-javascript' => 'Custom Javascript',
'paypal-smart-button' => 'PayPal',
'client-id' => 'Client Id',
'client-id-info' => 'Use "sb" for testing.',
'mailing-address' => 'أرسل الشيك إلى',
'instructions' => 'تعليمات',
'custom-scripts' => 'البرامج النصية المخصصة',
@ -1372,7 +1375,11 @@ return [
'custom-javascript' => 'جافا سكريبت مخصص',
'paypal-smart-button' => 'زر PayPal الذكي',
'client-id' => 'معرف العميل',
'client-id-info' => 'استخدم "sb" للاختبار.'
'client-id-info' => 'استخدم "sb" للاختبار.',
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
]
]
];

View File

@ -521,6 +521,12 @@ return [
'multiselect' => 'Multiselect',
'new-option' => 'Neue Option',
'is-default' => 'Ist Standard',
'remove-image-btn-title' => 'Remove Image',
'videos' => 'Videos',
'video' => 'Video',
'add-video-btn-title' => 'Add Video',
'remove-video-btn-title' => 'Remove Video',
'not-support-video' => 'Your browser does not support the video tag.',
],
'attributes' =>
[
@ -1343,7 +1349,11 @@ return [
'custom-javascript' => 'Custom Javascript',
'paypal-smart-button' => 'PayPal',
'client-id' => 'Client Id',
'client-id-info' => 'Use "sb" for testing.'
'client-id-info' => 'Use "sb" for testing.',
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
],
],
];

View File

@ -533,6 +533,12 @@ return [
'all-group' => 'All Groups',
'fixed' => 'Fixed',
'discount' => 'Discount',
'remove-image-btn-title' => 'Remove Image',
'videos' => 'Videos',
'video' => 'Video',
'add-video-btn-title' => 'Add Video',
'remove-video-btn-title' => 'Remove Video',
'not-support-video' => 'Your browser does not support the video tag.',
],
'attributes' => [
@ -1369,7 +1375,11 @@ return [
'custom-javascript' => 'Custom Javascript',
'paypal-smart-button' => 'PayPal',
'client-id' => 'Client Id',
'client-id-info' => 'Use "sb" for testing.'
'client-id-info' => 'Use "sb" for testing.',
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
]
]
];

View File

@ -522,7 +522,13 @@ return [
'checkbox' => 'Opción múltiple',
'multiselect' => 'Lista de selección múltiple',
'new-option' => 'Nueva opción',
'is-default' => 'Es predeterminada'
'is-default' => 'Es predeterminada',
'remove-image-btn-title' => 'Remove Image',
'videos' => 'Videos',
'video' => 'Video',
'add-video-btn-title' => 'Add Video',
'remove-video-btn-title' => 'Remove Video',
'not-support-video' => 'Your browser does not support the video tag.',
],
'attributes' => [
@ -1325,7 +1331,11 @@ return [
'custom-javascript' => 'Custom Javascript',
'paypal-smart-button' => 'PayPal',
'client-id' => 'Client Id',
'client-id-info' => 'Use "sb" for testing.'
'client-id-info' => 'Use "sb" for testing.',
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
]
]
];

View File

@ -527,7 +527,13 @@ return [
'checkbox' => 'Checkbox',
'multiselect' => 'Multiselect',
'new-option' => 'New Option',
'is-default' => 'Is Default'
'is-default' => 'Is Default',
'remove-image-btn-title' => 'Remove Image',
'videos' => 'Videos',
'video' => 'Video',
'add-video-btn-title' => 'Add Video',
'remove-video-btn-title' => 'Remove Video',
'not-support-video' => 'Your browser does not support the video tag.',
],
'attributes' => [
@ -1361,7 +1367,11 @@ return [
'custom-javascript' => 'Custom Javascript',
'paypal-smart-button' => 'PayPal',
'client-id' => 'Client Id',
'client-id-info' => 'Use "sb" for testing.'
'client-id-info' => 'Use "sb" for testing.',
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
]
]
];

View File

@ -530,7 +530,13 @@ return [
'multiselect' => 'Multiselect',
'new-option' => 'Nuova Opzione',
'is-default' => 'È Predefinita',
'actions' => 'Azioni'
'actions' => 'Azioni',
'remove-image-btn-title' => 'Remove Image',
'videos' => 'Videos',
'video' => 'Video',
'add-video-btn-title' => 'Add Video',
'remove-video-btn-title' => 'Remove Video',
'not-support-video' => 'Your browser does not support the video tag.',
],
'attributes' => [
@ -1366,7 +1372,11 @@ return [
'custom-javascript' => 'Custom Javascript',
'paypal-smart-button' => 'PayPal',
'client-id' => 'Client Id',
'client-id-info' => 'Use "sb" for testing.'
'client-id-info' => 'Use "sb" for testing.',
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
]
]
];

View File

@ -529,6 +529,12 @@ return [
'multiselect' => 'Multiselect',
'new-option' => 'Nieuwe optie',
'is-default' => 'is standaard',
'remove-image-btn-title' => 'Remove Image',
'videos' => 'Videos',
'video' => 'Video',
'add-video-btn-title' => 'Add Video',
'remove-video-btn-title' => 'Remove Video',
'not-support-video' => 'Your browser does not support the video tag.',
],
'attributes' => [
@ -1361,7 +1367,11 @@ return [
'custom-javascript' => 'Custom Javascript',
'paypal-smart-button' => 'PayPal',
'client-id' => 'Client Id',
'client-id-info' => 'Use "sb" for testing.'
'client-id-info' => 'Use "sb" for testing.',
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
]
]
];

View File

@ -528,7 +528,13 @@ return [
'checkbox' => 'Pole wyboru',
'multiselect' => 'Wielokrotny wybór',
'new-option' => 'Nowa opcja',
'is-default' => 'Jest domyślny'
'is-default' => 'Jest domyślny',
'remove-image-btn-title' => 'Remove Image',
'videos' => 'Videos',
'video' => 'Video',
'add-video-btn-title' => 'Add Video',
'remove-video-btn-title' => 'Remove Video',
'not-support-video' => 'Your browser does not support the video tag.',
],
'attributes' => [
@ -1350,7 +1356,11 @@ return [
'custom-javascript' => 'Custom Javascript',
'paypal-smart-button' => 'PayPal',
'client-id' => 'Client Id',
'client-id-info' => 'Use "sb" for testing.'
'client-id-info' => 'Use "sb" for testing.',
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
]
]
];

View File

@ -527,7 +527,13 @@ return [
'checkbox' => 'Checkbox',
'multiselect' => 'Multiselect',
'new-option' => 'New Option',
'is-default' => 'Is Default'
'is-default' => 'Is Default',
'remove-image-btn-title' => 'Remove Image',
'videos' => 'Videos',
'video' => 'Video',
'add-video-btn-title' => 'Add Video',
'remove-video-btn-title' => 'Remove Video',
'not-support-video' => 'Your browser does not support the video tag.',
],
'attributes' => [
@ -1364,7 +1370,11 @@ return [
'custom-javascript' => 'Custom Javascript',
'paypal-smart-button' => 'PayPal',
'client-id' => 'Client Id',
'client-id-info' => 'Use "sb" for testing.'
'client-id-info' => 'Use "sb" for testing.',
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
]
]
];

View File

@ -523,7 +523,13 @@ return [
'checkbox' => 'Onay Kutusu',
'multiselect' => 'Çoklu Seçim',
'new-option' => 'Yeni Seçenek',
'is-default' => 'Varsayılan'
'is-default' => 'Varsayılan',
'remove-image-btn-title' => 'Remove Image',
'videos' => 'Videos',
'video' => 'Video',
'add-video-btn-title' => 'Add Video',
'remove-video-btn-title' => 'Remove Video',
'not-support-video' => 'Your browser does not support the video tag.',
],
'attributes' => [
@ -1347,7 +1353,11 @@ return [
'custom-javascript' => 'Custom Javascript',
'paypal-smart-button' => 'PayPal',
'client-id' => 'Client Id',
'client-id-info' => 'Use "sb" for testing.'
'client-id-info' => 'Use "sb" for testing.',
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
]
]
];

View File

@ -54,7 +54,9 @@
<img class="preview" :src="imageData" v-if="imageData.length > 0">
<label class="remove-image" @click="removeImage()">Remove Image</label>
<label class="remove-image" @click="removeImage()">
{{ __('admin::app.catalog.products.remove-image-btn-title') }}
</label>
</label>
</script>

View File

@ -0,0 +1,198 @@
{!! view_render_event('bagisto.admin.catalog.product.edit_form_accordian.videos.before', ['product' => $product]) !!}
<accordian :title="'{{ __('admin::app.catalog.products.videos') }}'" :active="false">
<div slot="body">
{!! view_render_event('bagisto.admin.catalog.product.edit_form_accordian.videos.controls.before', ['product' => $product]) !!}
<div class="control-group {!! $errors->has('videos.*') ? 'has-error' : '' !!}">
<label>{{ __('admin::app.catalog.products.video') }}</label>
<product-video></product-video>
<span class="control-error" v-if="{!! $errors->has('videos.*') !!}">
@php $count=1 @endphp
@foreach ($errors->get('videos.*') as $key => $message)
@php echo str_replace($key, 'Video'.$count, $message[0]); $count++ @endphp
@endforeach
</span>
</div>
{!! view_render_event('bagisto.admin.catalog.product.edit_form_accordian.videos.controls.after', ['product' => $product]) !!}
</div>
</accordian>
{!! view_render_event('bagisto.admin.catalog.product.edit_form_accordian.videos.after', ['product' => $product]) !!}
@push('scripts')
@parent
<script type="text/x-template" id="product-video-template">
<div>
<div class="image-wrapper">
<product-video-item
v-for='(video, index) in items'
:key='video.id'
:video="video"
@onRemoveVideo="removeVideo($event)"
@onVideoSelected="videoSelected($event)"
></product-video-item>
</div>
<label class="btn btn-lg btn-primary" style="display: inline-block; width: auto" @click="createFileType">
{{ __('admin::app.catalog.products.add-video-btn-title') }}
</label>
</div>
</script>
<script type="text/x-template" id="product-video-item-template">
<label class="image-item" v-bind:class="{ 'has-image': videoData.length > 0 }">
<input type="hidden" :name="'videos[' + video.id + ']'" v-if="! new_video"/>
<input type="file" v-validate="'mimes:video/*'" accept="video/*" :name="'videos[]'" ref="videoInput" :id="_uid" @change="addVideoView($event)" multiple="multiple"/>
<video class="preview" v-if="videoData.length > 0" width="200" height="160" controls>
<source :src="videoData" type="video/mp4">
{{ __('admin::app.catalog.products.not-support-video') }}
</video>
<label class="remove-image" @click="removeVideo()">
{{ __('admin::app.catalog.products.remove-video-btn-title') }}
</label>
</label>
</script>
<script>
Vue.component('product-video', {
template: '#product-video-template',
data: function() {
return {
videos: @json($product->videos),
videoCount: 0,
items: []
}
},
computed: {
finalInputName: function() {
return 'videos[' + this.video.id + ']';
}
},
created: function() {
var this_this = this;
this.videos.forEach(function(video) {
this_this.items.push(video)
this_this.videoCount++;
});
},
methods: {
createFileType: function() {
var this_this = this;
this.videoCount++;
this.items.push({'id': 'video_' + this.videoCount});
},
removeVideo (video) {
let index = this.items.indexOf(video)
Vue.delete(this.items, index);
},
videoSelected: function(event) {
var this_this = this;
Array.from(event.files).forEach(function(video, index) {
if (index) {
this_this.videoCount++;
this_this.items.push({'id': 'video_' + this_this.videoCount, file: video});
}
});
}
}
});
Vue.component('product-video-item', {
template: '#product-video-item-template',
props: {
video: {
type: Object,
required: false,
default: null
},
},
data: function() {
return {
videoData: '',
new_video: 0
}
},
mounted () {
if (this.video.id && this.video.url) {
this.videoData = this.video.url;
} else if (this.video.id && this.video.file) {
this.readFile(this.video.file);
}
},
computed: {
finalInputName: function() {
return this.inputName + '[' + this.video.id + ']';
}
},
methods: {
addVideoView: function() {
var videoInput = this.$refs.videoInput;
if (videoInput.files && videoInput.files[0]) {
if (videoInput.files[0].type.includes('video/')) {
this.readFile(videoInput.files[0])
if (videoInput.files.length > 1) {
this.$emit('onVideoSelected', videoInput)
}
} else {
videoInput.value = "";
alert('Only videos (.mp4, .mov, .ogg ..) are allowed.');
}
}
},
readFile: function(video) {
var reader = new FileReader();
reader.onload = (e) => {
this.videoData = e.target.result;
}
reader.readAsDataURL(video);
this.new_video = 1;
},
removeVideo: function() {
this.$emit('onRemoveVideo', this.video)
}
}
});
</script>
@endpush

View File

@ -72,6 +72,7 @@
<required-if
:name = "'{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]'"
:label = "'{{ trans($field['title']) }}'"
:info = "'{{ trans(isset($field['info']) ? $field['info'] : '') }}'"
:options = '@json($field['options'])'
:result = "'{{ $selectedOption }}'"
:validations = "'{{ $validations }}'"

View File

@ -39,7 +39,7 @@
<div class="dropdown-list bottom-right">
<div class="control-group">
<select class="control" id="locale-switcher" onChange="window.location.href = this.value" style="margin-left: 30px;">
<select class="control" onChange="window.location.href = this.value" style="margin-left: 30px;">
@foreach (core()->getAllLocales() as $localeModel)
<option value="{{ '?admin_locale=' . $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}>

View File

@ -12,6 +12,7 @@ use Webkul\Product\Datatypes\CartItemValidationResult;
use Webkul\Product\Helpers\ProductImage;
use Webkul\Product\Repositories\ProductAttributeValueRepository;
use Webkul\Product\Repositories\ProductImageRepository;
use Webkul\Product\Repositories\ProductVideoRepository;
use Webkul\Product\Repositories\ProductInventoryRepository;
use Webkul\Product\Repositories\ProductRepository;
use Webkul\Product\Type\Virtual;
@ -44,6 +45,7 @@ class Booking extends Virtual
'admin::catalog.products.accordians.channels',
'bookingproduct::admin.catalog.products.accordians.booking',
'admin::catalog.products.accordians.product-links',
'admin::catalog.products.accordians.videos',
];
/**
@ -54,9 +56,10 @@ class Booking extends Virtual
* @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
* @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
* @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository
* @param \Webkul\Product\Helpers\ProductImage $productImageHelper
* @param \Webkul\Product\Helpers\ProductImage $productImageHelper
* @param \Webkul\BookingProduct\Repositories\BookingProductRepository $bookingProductRepository
* @param \Webkul\BookingProduct\Helpers\BookingHelper $bookingHelper
* @param \Webkul\BookingProduct\Helpers\BookingHelper $bookingHelper
* @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository
* @return void
*/
public function __construct(
@ -67,7 +70,8 @@ class Booking extends Virtual
ProductImageRepository $productImageRepository,
ProductImage $productImageHelper,
BookingProductRepository $bookingProductRepository,
BookingHelper $bookingHelper
BookingHelper $bookingHelper,
ProductVideoRepository $productVideoRepository
)
{
parent::__construct(
@ -76,7 +80,8 @@ class Booking extends Virtual
$attributeValueRepository,
$productInventoryRepository,
$productImageRepository,
$productImageHelper
$productImageHelper,
$productVideoRepository
);
$this->bookingProductRepository = $bookingProductRepository;

View File

@ -6,6 +6,7 @@ use Exception;
use Illuminate\View\View;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Event;
use Illuminate\Validation\ValidationException;
use Webkul\CartRule\Repositories\CartRuleRepository;
use Webkul\CartRule\Repositories\CartRuleCouponRepository;
@ -113,30 +114,39 @@ class CartRuleController extends Controller
*/
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|unique:cart_rule_coupons,code',
'starts_from' => 'nullable|date',
'ends_till' => 'nullable|date|after_or_equal:starts_from',
'action_type' => 'required',
'discount_amount' => 'required|numeric',
]);
try {
$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|unique:cart_rule_coupons,code',
'starts_from' => 'nullable|date',
'ends_till' => 'nullable|date|after_or_equal:starts_from',
'action_type' => 'required',
'discount_amount' => 'required|numeric',
]);
$data = request()->all();
$data = request()->all();
Event::dispatch('promotions.cart_rule.create.before');
Event::dispatch('promotions.cart_rule.create.before');
$cartRule = $this->cartRuleRepository->create($data);
$cartRule = $this->cartRuleRepository->create($data);
Event::dispatch('promotions.cart_rule.create.after', $cartRule);
Event::dispatch('promotions.cart_rule.create.after', $cartRule);
session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Cart Rule']));
session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Cart Rule']));
return redirect()->route($this->_config['redirect']);
return redirect()->route($this->_config['redirect']);
} catch (ValidationException $e) {
if ($firstError = collect($e->errors())->first()) {
session()->flash('error', $firstError[0]);
}
}
return redirect()->back();
}
/**
@ -163,30 +173,39 @@ class CartRuleController extends Controller
*/
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|unique:cart_rule_coupons,code,' . $id,
'starts_from' => 'nullable|date',
'ends_till' => 'nullable|date|after_or_equal:starts_from',
'action_type' => 'required',
'discount_amount' => 'required|numeric',
]);
try {
$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|unique:cart_rule_coupons,code,' . $id,
'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);
$cartRule = $this->cartRuleRepository->findOrFail($id);
Event::dispatch('promotions.cart_rule.update.before', $cartRule);
Event::dispatch('promotions.cart_rule.update.before', $cartRule);
$cartRule = $this->cartRuleRepository->update(request()->all(), $id);
$cartRule = $this->cartRuleRepository->update(request()->all(), $id);
Event::dispatch('promotions.cart_rule.update.after', $cartRule);
Event::dispatch('promotions.cart_rule.update.after', $cartRule);
session()->flash('success', trans('admin::app.response.update-success', ['name' => 'Cart Rule']));
session()->flash('success', trans('admin::app.response.update-success', ['name' => 'Cart Rule']));
return redirect()->route($this->_config['redirect']);
return redirect()->route($this->_config['redirect']);
} catch (ValidationException $e) {
if ($firstError = collect($e->errors())->first()) {
session()->flash('error', $firstError[0]);
}
}
return redirect()->back();
}
/**

View File

@ -12,21 +12,30 @@ return [
*
*/
\Webkul\Admin\Providers\ModuleServiceProvider::class,
\Webkul\API\Providers\ModuleServiceProvider::class,
\Webkul\Attribute\Providers\ModuleServiceProvider::class,
\Webkul\BookingProduct\Providers\ModuleServiceProvider::class,
\Webkul\CartRule\Providers\ModuleServiceProvider::class,
\Webkul\CatalogRule\Providers\ModuleServiceProvider::class,
\Webkul\Category\Providers\ModuleServiceProvider::class,
\Webkul\Checkout\Providers\ModuleServiceProvider::class,
\Webkul\Core\Providers\ModuleServiceProvider::class,
\Webkul\CMS\Providers\ModuleServiceProvider::class,
\Webkul\Customer\Providers\ModuleServiceProvider::class,
\Webkul\Inventory\Providers\ModuleServiceProvider::class,
\Webkul\Payment\Providers\ModuleServiceProvider::class,
\Webkul\Paypal\Providers\ModuleServiceProvider::class,
\Webkul\Product\Providers\ModuleServiceProvider::class,
\Webkul\Rule\Providers\ModuleServiceProvider::class,
\Webkul\Sales\Providers\ModuleServiceProvider::class,
\Webkul\Tax\Providers\ModuleServiceProvider::class,
\Webkul\User\Providers\ModuleServiceProvider::class,
\Webkul\CatalogRule\Providers\ModuleServiceProvider::class,
\Webkul\CartRule\Providers\ModuleServiceProvider::class,
\Webkul\CMS\Providers\ModuleServiceProvider::class,
\Webkul\Velocity\Providers\ModuleServiceProvider::class,
\Webkul\Shipping\Providers\ModuleServiceProvider::class,
\Webkul\Shop\Providers\ModuleServiceProvider::class,
\Webkul\SocialLogin\Providers\ModuleServiceProvider::class,
\Webkul\Tax\Providers\ModuleServiceProvider::class,
\Webkul\Theme\Providers\ModuleServiceProvider::class,
\Webkul\Ui\Providers\ModuleServiceProvider::class,
\Webkul\User\Providers\ModuleServiceProvider::class,
\Webkul\Velocity\Providers\ModuleServiceProvider::class,
]
];

View File

@ -0,0 +1,280 @@
<?php
namespace Webkul\DebugBar\DataCollector;
use Illuminate\Support\Str;
use DebugBar\DataCollector\DataCollector;
use DebugBar\DataCollector\DataCollectorInterface;
use DebugBar\DataCollector\Renderable;
use DebugBar\DataCollector\AssetProvider;
use Konekt\Concord\Facades\Concord;
use Illuminate\Contracts\Events\Dispatcher;
use DebugBar\DataCollector\PDO\PDOCollector;
use Debugbar;
/**
* Collector for Bagisto's Module Collector
*/
class ModuleCollector extends DataCollector implements DataCollectorInterface, Renderable, AssetProvider
{
public $models = [];
public $views = [];
public $queries = [];
public $count = 0;
/**
* @param Dispatcher $events
* @param PDOCollector $pdoCollector
* @return void
*/
public function __construct(
Dispatcher $events,
PDOCollector $pdoCollector
)
{
$events->listen('eloquent.*', function ($event, $models) {
if (Str::contains($event, 'eloquent.retrieved')) {
foreach (array_filter($models) as $model) {
$class = get_class($model);
$this->models[$class] = ($this->models[$class] ?? 0) + 1;
$this->count++;
}
}
});
$events->listen('composing:*', function ($view, $data = []) {
$view = $data ? $data[0] : $view;
$this->views[] = $this->trimViewName($view->getName(), $view->getPath());
});
app()['db']->listen(
function ($query, $bindings = null, $time = null, $connectionName = null) use ($pdoCollector) {
$this->queries[] = [
'sql' => $this->addQueryBindings($query),
'duration' => $query->time,
"duration_str" => $pdoCollector->formatDuration($query->time),
"connection" => $query->connection->getDatabaseName()
];
}
);
}
/**
* @param \Illuminate\Database\Events\QueryExecuted $query
* @return string
*/
public function addQueryBindings($query)
{
$sql = $query->sql;
$bindings = $this->checkBindings($query->connection->prepareBindings($query->bindings));
if (! empty($bindings)) {
foreach ($bindings as $key => $binding) {
$regex = is_numeric($key)
? "/\?(?=(?:[^'\\\']*'[^'\\\']*')*[^'\\\']*$)/"
: "/:{$key}(?=(?:[^'\\\']*'[^'\\\']*')*[^'\\\']*$)/";
if (! is_int($binding) && ! is_float($binding)) {
$binding = $query->connection->getPdo()->quote($binding);
}
$sql = preg_replace($regex, $binding, $sql, 1);
}
}
return $sql;
}
/**
* Check bindings for illegal (non UTF-8) strings, like Binary data.
*
* @param array $bindings
* @return mixed
*/
public function checkBindings($bindings)
{
foreach ($bindings as &$binding) {
if (is_string($binding) && ! mb_check_encoding($binding, 'UTF-8')) {
$binding = '[BINARY DATA]';
}
}
return $bindings;
}
/**
* @param string $name
* @param string $path
* @return string
*/
public function trimViewName($name, $path)
{
if ($path) {
$path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
}
return $path ? sprintf('%s (%s)', $name, $path) : $name;
}
/**
* {@inheritdoc}
*/
public function collect()
{
$modules = [];
foreach (Concord::getModules() as $moduleId => $module) {
$models = $this->getModels($module->getNamespaceRoot());
$views = $this->getTemplates($module->getNamespaceRoot());
$queries = $this->getQueries($module->getNamespaceRoot());
if (count($models) || count($views) || count($queries)) {
$modules[] = [
'name' => $module->getNamespaceRoot(),
'models' => $models,
'views' => $views,
'queries' => $queries,
];
}
}
$data = [
'count' => count($modules),
'modules' => $modules,
];
return $data;
}
/**
* @param string $classNamespace
* @return array
*/
public function getModels($classNamespace)
{
$models = [];
foreach ($this->models as $model => $count) {
if (strpos($model, $classNamespace . '\\') !== false) {
$models[] = $model . ' (' . $count . ')';
}
}
return $models;
}
/**
* @param string $classNamespace
* @return array
*/
public function getTemplates($classNamespace)
{
$viewNamespace = Str::lower(class_basename($classNamespace));
$classNamespace = str_replace('\\', '/', $classNamespace) . '/';
$views = [];
foreach ($this->views as $view) {
if (strpos($view, $classNamespace) !== false) {
$views[] = $view;
} elseif (strpos($view, 'resources/themes/' . $viewNamespace . '/') !== false) {
$views[] = $view;
} elseif (strpos($view, 'resources/admin-themes/' . $viewNamespace . '/') !== false) {
$views[] = $view;
} elseif (strpos($view, 'resources/vendor/views/' . $viewNamespace . '/') !== false) {
$views[] = $view;
}
}
return $views;
}
/**
* @param string $classNamespace
* @return array
*/
public function getQueries($classNamespace)
{
$moduleTables = $this->getDatabaseTables($classNamespace);
$queries = [];
foreach ($this->queries as $query) {
$sqlParts = explode(' ', str_replace('`', '', $query['sql']));
$tableName = $sqlParts[array_search('from', $sqlParts) + 1];
if (in_array($tableName, $moduleTables)) {
$queries[] = $query;
}
}
return $queries;
}
/**
* @param string $classNamespace
* @return array
*/
public function getDatabaseTables($classNamespace)
{
$tables = [];
foreach (Concord::getModelBindings() as $contract => $model) {
if (strpos($model, $classNamespace . '\\') !== false) {
$tables[] = app($model)->getTable();
}
}
return $tables;
}
/**
* {@inheritDoc}
*/
public function getName()
{
return 'modules';
}
/**
* {@inheritDoc}
*/
public function getWidgets()
{
return [
"modules" => [
"icon" => "cubes",
"widget" => "PhpDebugBar.Widgets.ModulesWidget",
"map" => "modules",
"default" => "[]",
],
"modules:badge" => [
"map" => "modules.count",
"default" => 0,
],
];
}
/**
* @return array
*/
public function getAssets()
{
return [
'base_path' => '/home/jitendra/www/html/laravel/bagisto/packages/Webkul/DebugBar/src/Resources/',
'base_url' => '/home/jitendra/www/html/laravel/bagisto/packages/Webkul/DebugBar/src/Resources/',
'css' => 'widgets/modules/widget.css',
'js' => 'widgets/modules/widget.js'
];
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace Webkul\DebugBar\Providers;
use Illuminate\Support\ServiceProvider;
use Webkul\DebugBar\DataCollector\ModuleCollector;
use Debugbar;
class DebugBarServiceProvider extends ServiceProvider
{
public function boot()
{
}
/**
* Register services.
*
* @return void
*/
public function register()
{
Debugbar::addCollector(app(ModuleCollector::class));
}
}

View File

@ -0,0 +1,91 @@
div.phpdebugbar-widgets-modules table.phpdebugbar-widgets-params {
display: none;
width: 70%;
margin: 10px;
border: 1px solid #ddd;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
border-collapse: collapse;
}
div.phpdebugbar-widgets-modules table.phpdebugbar-widgets-params td {
border: 1px solid #ddd;
text-align: center;
}
div.phpdebugbar-widgets-modules table.phpdebugbar-widgets-params .phpdebugbar-widgets-name {
width: 20%;
font-weight: bold;
}
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-models,
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-views,
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-queries,
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-duration,
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-database {
float: right;
margin-left: 8px;
color: #888;
}
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-models:before,
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-views:before,
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-queries:before,
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-duration:before,
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-database:before {
font-family: PhpDebugbarFontAwesome;
margin-right: 4px;
font-size: 12px;
}
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-models:before {
content: "\f1b3";
}
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-duration:before {
content: "\f017";
}
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-views:before {
content: "\f06c";
}
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-queries:before {
content: "\f1c0";
}
div.phpdebugbar-widgets-modules span.phpdebugbar-widgets-database:before {
content: "\f1c0";
}
div.phpdebugbar-widgets-modules table.phpdebugbar-widgets-params td.phpdebugbar-widgets-name {
width: auto;
}
div.phpdebugbar-widgets-modules table.phpdebugbar-widgets-params td.phpdebugbar-widgets-name .phpdebugbar-fa {
position: relative;
top: 1px;
margin-left: 3px;
}
div.phpdebugbar-widgets-modules {
line-height: 20px;
}
div.phpdebugbar-widgets-modules table.phpdebugbar-widgets-params th,
div.phpdebugbar-widgets-modules table.phpdebugbar-widgets-params td {
padding: 4px 10px;
}
div.phpdebugbar-widgets-modules table.phpdebugbar-widgets-params th {
background-color: #efefef;
}
div.phpdebugbar-widgets-modules table.phpdebugbar-widgets-params td.phpdebugbar-widgets-name {
text-align: right;
vertical-align: top;
white-space: nowrap;
}
div.phpdebugbar-widgets-modules table.phpdebugbar-widgets-params td.phpdebugbar-widgets-value {
text-align: left;
}

View File

@ -0,0 +1,108 @@
(function($) {
var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-');
/**
* Widget for the displaying all modules
*
* Options:
* - data
*/
var ModulesWidget = PhpDebugBar.Widgets.ModulesWidget = PhpDebugBar.Widget.extend({
className: csscls('modules'),
render: function() {
this.$list = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, module) {
$('<strong />').addClass(csscls('module')).addClass(csscls('name')).text(module.name).appendTo(li);
$('<span title="Queries" />').addClass('phpdebugbar-fa phpdebugbar-widgets-queries').text(module.queries.length).appendTo(li);
$('<span title="Views" />').addClass('phpdebugbar-fa phpdebugbar-widgets-views').text(module.views.length).appendTo(li);
$('<span title="Models" />').addClass('phpdebugbar-fa phpdebugbar-widgets-models').text(module.models.length).appendTo(li);
var table = $('<table><tr><th colspan="2">Details</th></tr></table>').addClass(csscls('params')).appendTo(li);
if (module.models && module.models.length) {
table.append(function () {
var $name = $('<td />').addClass(csscls('name')).html('Models');
var $value = $('<td />').addClass(csscls('value'));
var $span = $('<span />').addClass('phpdebugbar-text-muted');
var index = 0;
var $models = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, binding) {
var $index = $span.clone().text(index++ + '.');
li.append($index, '&nbsp;', binding).removeClass(csscls('list-item')).addClass(csscls('table-list-item'));
}});
$models.set('data', module.models);
$models.$el
.removeClass(csscls('list'))
.addClass(csscls('table-list'))
.appendTo($value);
return $('<tr />').append($name, $value);
});
}
if (module.views && module.views.length) {
table.append(function () {
var $name = $('<td />').addClass(csscls('name')).html('Views');
var $value = $('<td />').addClass(csscls('value'));
var $views = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, view) {
li.append(view).removeClass(csscls('list-item')).addClass(csscls('table-list-item'));
}});
$views.set('data', module.views);
$views.$el
.removeClass(csscls('list'))
.addClass(csscls('table-list'))
.appendTo($value);
return $('<tr />').append($name, $value);
});
}
if (module.queries && module.queries.length) {
table.append(function () {
var $name = $('<td />').addClass(csscls('name')).html('Queries');
var $value = $('<td />').addClass(csscls('value'));
var $queries = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, query) {
$('<code />').addClass(csscls('sql')).html(PhpDebugBar.Widgets.highlight(query.sql, 'sql')).appendTo(li);
$('<span title="Connection" />').addClass(csscls('database')).text(query.connection).appendTo(li);
$('<span title="Duration" />').addClass(csscls('duration')).text(query.duration_str).appendTo(li);
}});
$queries.set('data', module.queries);
$queries.$el
.removeClass(csscls('list'))
.addClass(csscls('table-list'))
.appendTo($value);
return $('<tr />').append($name, $value);
});
}
li.css('cursor', 'pointer').click(function() {
if (table.is(':visible')) {
table.hide();
} else {
table.show();
}
});
}});
this.$list.$el.appendTo(this.$el);
this.bindAttr('data', function(data) {
this.$list.set('data', data.modules);
});
}
});
})(PhpDebugBar.$);

View File

@ -0,0 +1,11 @@
<?php
namespace Webkul\Payment\Providers;
use Konekt\Concord\BaseModuleServiceProvider;
class ModuleServiceProvider extends BaseModuleServiceProvider
{
protected $models = [
];
}

View File

@ -2,7 +2,7 @@
return [
'paypal_smart_button' => [
'code' => 'paypal_smart_button',
'title' => 'PayPal',
'title' => 'PayPal Smart Button',
'description' => 'PayPal',
'client_id' => 'sb',
'class' => 'Webkul\Paypal\Payment\SmartButton',

View File

@ -86,6 +86,20 @@ return [
'type' => 'depends',
'depend' => 'active:1',
'validation' => 'required_if:active,1',
], [
'name' => 'client_secret',
'title' => 'admin::app.admin.system.client-secret',
'info' => 'admin::app.admin.system.client-secret-info',
'type' => 'depends',
'depend' => 'active:1',
'validation' => 'required_if:active,1',
], [
'name' => 'accepted_currencies',
'title' => 'admin::app.admin.system.accepted-currencies',
'info' => 'admin::app.admin.system.accepted-currencies-info',
'type' => 'depends',
'depend' => 'active:1',
'validation' => 'required_if:active,1',
], [
'name' => 'active',
'title' => 'admin::app.admin.system.status',
@ -93,7 +107,13 @@ return [
'validation' => 'required',
'channel_based' => false,
'locale_based' => true
], [
], [
'name' => 'sandbox',
'title' => 'admin::app.admin.system.sandbox',
'type' => 'boolean',
'channel_based' => false,
'locale_based' => true,
], [
'name' => 'sort',
'title' => 'admin::app.admin.system.sort_order',
'type' => 'select',

View File

@ -3,11 +3,20 @@
namespace Webkul\Paypal\Http\Controllers;
use Webkul\Checkout\Facades\Cart;
use Webkul\Paypal\Payment\SmartButton;
use Webkul\Sales\Repositories\OrderRepository;
use Webkul\Sales\Repositories\InvoiceRepository;
use PayPalCheckoutSdk\Orders\OrdersCreateRequest;
class SmartButtonController extends Controller
{
/**
* SmartButton object
*
* @var \Webkul\Paypal\Payment\SmartButton
*/
protected $smartButtonClient;
/**
* OrderRepository object
*
@ -30,6 +39,7 @@ class SmartButtonController extends Controller
* @return void
*/
public function __construct(
SmartButton $smartButtonClient,
OrderRepository $orderRepository,
InvoiceRepository $invoiceRepository
)
@ -37,14 +47,67 @@ class SmartButtonController extends Controller
$this->orderRepository = $orderRepository;
$this->invoiceRepository = $invoiceRepository;
$this->smartButtonClient = $smartButtonClient->client();
}
/**
* Success payment
* Success payment.
*
* @return \Illuminate\Http\JsonResponse
*/
public function details()
public function details(OrdersCreateRequest $request)
{
$request->prefer('return=representation');
$request->body = $this->buildRequestBody();
$response = $this->smartButtonClient->execute($request);
return response()->json($response);
}
/**
* Save order.
*
* @return \Illuminate\Http\Response
*/
public function saveOrder()
{
if (Cart::hasError()) {
return response()->json(['redirect_url' => route('shop.checkout.cart.index')], 403);
}
try {
Cart::collectTotals();
$this->validateOrder();
$order = $this->orderRepository->create(Cart::prepareDataForOrder());
$this->orderRepository->update(['status' => 'processing'], $order->id);
if ($order->canInvoice()) {
$this->invoiceRepository->create($this->prepareInvoiceData($order));
}
Cart::deActivateCart();
session()->flash('order', $order);
return response()->json([
'success' => true,
]);
} catch (\Exception $e) {
session()->flash('error', trans('shop::app.common.error'));
throw $e;
}
}
/**
* Build request body.
*
* @return array
*/
protected function buildRequestBody()
{
$cart = Cart::getCart();
@ -143,12 +206,12 @@ class SmartButtonController extends Controller
}
/**
* Return cart items
* Return cart items.
*
* @param string $cart
* @return array
*/
public function getLineItems($cart)
protected function getLineItems($cart)
{
$lineItems = [];
@ -169,12 +232,12 @@ class SmartButtonController extends Controller
}
/**
* Return convert multiple address lines into 2 address lines
* Return convert multiple address lines into 2 address lines.
*
* @param string $address
* @return array
*/
public function getAddressLines($address)
protected function getAddressLines($address)
{
$address = explode(PHP_EOL, $address, 2);
@ -190,47 +253,7 @@ class SmartButtonController extends Controller
}
/**
* Save order
*
* @return \Illuminate\Http\Response
*/
public function saveOrder()
{
if (Cart::hasError()) {
return response()->json(['redirect_url' => route('shop.checkout.cart.index')], 403);
}
try {
Cart::collectTotals();
$this->validateOrder();
$cart = Cart::getCart();
$order = $this->orderRepository->create(Cart::prepareDataForOrder());
$this->orderRepository->update(['status' => 'processing'], $order->id);
if ($order->canInvoice()) {
$invoice = $this->invoiceRepository->create($this->prepareInvoiceData($order));
}
Cart::deActivateCart();
session()->flash('order', $order);
return response()->json([
'success' => true,
]);
} catch (\Exception $e) {
session()->flash('error', trans('shop::app.common.error'));
throw $e;
}
}
/**
* Prepares order's invoice data for creation
* Prepares order's invoice data for creation.
*
* @param \Webkul\Sales\Models\Order $order
* @return array
@ -247,14 +270,20 @@ class SmartButtonController extends Controller
}
/**
* Validate order before creation
* Validate order before creation.
*
* @return void|\Exception
*/
public function validateOrder()
protected function validateOrder()
{
$cart = Cart::getCart();
$minimumOrderAmount = (int) core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0;
if (! $cart->checkMinimumOrder()) {
throw new \Exception(trans('shop::app.checkout.cart.minimum-order-message', ['amount' => core()->currency($minimumOrderAmount)]));
}
if ($cart->haveStockableItems() && ! $cart->shipping_address) {
throw new \Exception(trans('Please check shipping address.'));
}

View File

@ -2,15 +2,41 @@
namespace Webkul\Paypal\Payment;
use PayPalCheckoutSdk\Core\PayPalHttpClient;
use PayPalCheckoutSdk\Core\SandboxEnvironment;
use PayPalCheckoutSdk\Core\ProductionEnvironment;
class SmartButton extends Paypal
{
/**
* Payment method code
* Client ID.
*
* @var string
*/
protected $clientId;
/**
* Client secret.
*
* @var string
*/
protected $clientSecret;
/**
* Payment method code.
*
* @var string
*/
protected $code = 'paypal_smart_button';
/**
* Constructor.
*/
public function __construct()
{
$this->initialize();
}
/**
* Return paypal redirect url
*
@ -19,4 +45,39 @@ class SmartButton extends Paypal
public function getRedirectUrl()
{
}
/**
* Returns PayPal HTTP client instance with environment that has access
* credentials context. Use this instance to invoke PayPal APIs, provided the
* credentials have access.
*/
public function client()
{
return new PayPalHttpClient($this->environment());
}
/**
* Set up and return PayPal PHP SDK environment with PayPal access credentials.
* This sample uses SandboxEnvironment. In production, use LiveEnvironment.
*/
protected function environment()
{
$isSandbox = $this->getConfigData('sandbox') ?: false;
if ($isSandbox) {
return new SandboxEnvironment($this->clientId, $this->clientSecret);
}
return new ProductionEnvironment($this->clientId, $this->clientSecret);
}
/**
* Initialize properties.
*/
protected function initialize()
{
$this->clientId = $this->getConfigData('client_id') ?: '';
$this->clientSecret = $this->getConfigData('client_secret') ?: '';
}
}

View File

@ -0,0 +1,11 @@
<?php
namespace Webkul\Paypal\Providers;
use Konekt\Concord\BaseModuleServiceProvider;
class ModuleServiceProvider extends BaseModuleServiceProvider
{
protected $models = [
];
}

View File

@ -1,96 +1,95 @@
@if (request()->route()->getName() == 'shop.checkout.onepage.index' && core()->getConfigData('sales.paymentmethods.paypal_smart_button.active'))
<script src="https://www.paypal.com/sdk/js?client-id={{core()->getConfigData('sales.paymentmethods.paypal_smart_button.client_id')}}" data-partner-attribution-id="Bagisto_Cart"></script>
@if (request()->route()->getName() == 'shop.checkout.onepage.index')
<style>
.component-frame.visible {
z-index: 1 !important;
}
</style>
@php
$clientId = core()->getConfigData('sales.paymentmethods.paypal_smart_button.client_id');
$acceptedCurrency = core()->getConfigData('sales.paymentmethods.paypal_smart_button.accepted_currencies');
@endphp
<script>
window.onload = (function() {
eventBus.$on('after-payment-method-selected', function(payment) {
if (payment.method != 'paypal_smart_button') {
$('.paypal-buttons').remove();
<script src="https://www.paypal.com/sdk/js?client-id={{ $clientId }}&currency={{ $acceptedCurrency }}" data-partner-attribution-id="Bagisto_Cart"></script>
return;
}
<style>
.component-frame.visible {
z-index: 1 !important;
}
</style>
if (typeof paypal == 'undefined') {
window.flashMessages = [{'type': 'alert-error', 'message': "SDK Validation error: 'client-id not recognized for either production or sandbox: {{core()->getConfigData('sales.paymentmethods.paypal_smart_button.client_id')}}'" }];
<script>
window.onload = (function() {
eventBus.$on('after-payment-method-selected', function(payment) {
if (payment.method != 'paypal_smart_button') {
$('.paypal-buttons').remove();
window.flashMessages.alertMessage = "SDK Validation error: 'client-id not recognized for either production or sandbox: {{core()->getConfigData('sales.paymentmethods.paypal_smart_button.client_id')}}'";
return;
}
app.addFlashMessages();
if (typeof paypal == 'undefined') {
window.flashMessages = [{'type': 'alert-error', 'message': "SDK Validation error: 'client-id not recognized for either production or sandbox: {{core()->getConfigData('sales.paymentmethods.paypal_smart_button.client_id')}}'" }];
return;
}
var options = {
style: {
layout: 'vertical',
shape: 'rect',
},
enableStandardCardFields: false,
createOrder: function(data, actions) {
return window.axios.get("{{ route('paypal.smart_button.details') }}")
.then(function(response) {
return actions.order.create(response.data);
})
.catch(function (error) {})
},
// Finalize the transaction
onApprove: function(data, actions) {
app.showLoader();
return actions.order.capture()
.then(function(response) {
if (response.error == 'INSTRUMENT_DECLINED') {
return actions.restart();
} else {
return response;
}
})
.then(function(details) {
return window.axios.post("{{ route('paypal.smart_button.save_order') }}", {
'_token': "{{ csrf_token() }}",
'data' : details
})
.then(function(response) {
if (response.data.success) {
if (response.data.redirect_url) {
window.location.href = response.data.redirect_url;
} else {
window.location.href = "{{ route('shop.checkout.success') }}";
}
}
app.hideLoader()
})
.catch(function (error) {
window.location.href = "{{ route('shop.checkout.cart.index') }}";
})
});
},
onCancel: function (data) {
console.log('Canceled payment')
},
onError: function (err) {
window.flashMessages = [{'type': 'alert-error', 'message': err }];
window.flashMessages.alertMessage = err;
window.flashMessages.alertMessage = "SDK Validation error: 'client-id not recognized for either production or sandbox: {{core()->getConfigData('sales.paymentmethods.paypal_smart_button.client_id')}}'";
app.addFlashMessages();
}
};
paypal.Buttons(options).render(".paypal-button-container");
return;
}
let options = {
style: {
layout: 'vertical',
shape: 'rect',
},
enableStandardCardFields: false,
createOrder: function(data, actions) {
return window.axios.get("{{ route('paypal.smart_button.details') }}")
.then(function(response) {
return response.data.result;
})
.then(function(orderData) {
return orderData.id;
})
.catch(function (error) {})
},
onApprove: function(data, actions) {
app.showLoader();
window.axios.post("{{ route('paypal.smart_button.save_order') }}", {
'_token': "{{ csrf_token() }}",
'data' : data
})
.then(function(response) {
if (response.data.success) {
if (response.data.redirect_url) {
window.location.href = response.data.redirect_url;
} else {
window.location.href = "{{ route('shop.checkout.success') }}";
}
}
app.hideLoader()
})
.catch(function (error) {
window.location.href = "{{ route('shop.checkout.cart.index') }}";
})
},
onCancel: function (data) {
console.log('Canceled payment...');
},
onError: function (err) {
window.flashMessages = [{'type': 'alert-error', 'message': err }];
window.flashMessages.alertMessage = err;
app.addFlashMessages();
}
};
paypal.Buttons(options).render('.paypal-button-container');
});
});
});
</script>
</script>
@endif

View File

@ -0,0 +1,7 @@
<?php
namespace Webkul\Product\Contracts;
interface ProductVideo
{
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProductVideosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('product_videos', function (Blueprint $table) {
$table->increments('id');
$table->string('type')->nullable();
$table->string('path');
$table->integer('product_id')->unsigned();
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('product_videos');
}
}

View File

@ -54,7 +54,7 @@ class ProductImage extends AbstractProduct
];
}
if (! $product->parent_id && ! count($images)) {
if (! $product->parent_id && ! count($images) && ! count($product->videos)) {
$images[] = [
'small_image_url' => asset('vendor/webkul/ui/assets/images/product/small-product-placeholder.webp'),
'medium_image_url' => asset('vendor/webkul/ui/assets/images/product/meduim-product-placeholder.webp'),

View File

@ -0,0 +1,36 @@
<?php
namespace Webkul\Product\Helpers;
use Illuminate\Support\Facades\Storage;
class ProductVideo extends AbstractProduct
{
/**
* Retrieve collection of videos
*
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
* @return array
*/
public function getVideos($product)
{
if (! $product) {
return [];
}
$videos = [];
foreach ($product->videos as $video) {
if (! Storage::has($video->path)) {
continue;
}
$videos[] = [
'type' => $video->type,
'video_url' => Storage::url($video->path),
];
}
return $videos;
}
}

View File

@ -182,6 +182,7 @@ class Toolbar extends AbstractProduct
$viewOption = 'list';
}
return $viewOption;
/* if still default config is not set from the admin then in last needed hardcoded value */
return $viewOption ?? 'grid';
}
}

View File

@ -65,9 +65,12 @@ class ProductForm extends FormRequest
{
$product = $this->productRepository->find($this->id);
$maxVideoFileSize = (core()->getConfigData('catalog.products.attribute.file_attribute_upload_size')) ? core()->getConfigData('catalog.products.attribute.file_attribute_upload_size') : '2048' ;
$this->rules = array_merge($product->getTypeInstance()->getTypeValidationRules(), [
'sku' => ['required', 'unique:products,sku,' . $this->id, new \Webkul\Core\Contracts\Validations\Slug],
'images.*' => 'nullable|mimes:bmp,jpeg,jpg,png,webp',
'videos.*' => "nullable|mimes:mov,mp4|max:$maxVideoFileSize",
'special_price_from' => 'nullable|date',
'special_price_to' => 'nullable|date|after_or_equal:special_price_from',
'special_price' => ['nullable', new \Webkul\Core\Contracts\Validations\Decimal, 'lt:price'],

View File

@ -143,6 +143,14 @@ class Product extends Model implements ProductContract
return $this->hasMany(ProductImageProxy::modelClass(), 'product_id');
}
/**
* The videos that belong to the product.
*/
public function videos()
{
return $this->hasMany(ProductVideoProxy::modelClass(), 'product_id');
}
/**
* The images that belong to the product.
*/

View File

@ -126,6 +126,14 @@ class ProductFlat extends Model implements ProductFlatContract
->select('product_images.*');
}
/**
* The videos that belong to the product.
*/
public function videos()
{
return $this->product->videos();
}
/**
* Get all of the attributes for the attribute groups.
*/

View File

@ -0,0 +1,64 @@
<?php
namespace Webkul\Product\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
use Webkul\Product\Contracts\ProductVideo as ProductVideoContract;
class ProductVideo extends Model implements ProductVideoContract
{
public $timestamps = false;
protected $fillable = [
'path',
'product_id',
'type',
];
/**
* Get the product that owns the image.
*/
public function product()
{
return $this->belongsTo(ProductProxy::modelClass());
}
/**
* Get image url for the product image.
*/
public function url()
{
return Storage::url($this->path);
}
/**
* Get image url for the product image.
*/
public function getUrlAttribute()
{
return $this->url();
}
/**
* @param string $key
*
* @return bool
*/
public function isCustomAttribute($attribute)
{
return $this->attribute_family->custom_attributes->pluck('code')->contains($attribute);
}
/**
* @return array
*/
public function toArray()
{
$array = parent::toArray();
$array['url'] = $this->url;
return $array;
}
}

View File

@ -0,0 +1,10 @@
<?php
namespace Webkul\Product\Models;
use Konekt\Concord\Proxies\ModelProxy;
class ProductVideoProxy extends ModelProxy
{
}

View File

@ -22,5 +22,6 @@ class ModuleServiceProvider extends CoreModuleServiceProvider
\Webkul\Product\Models\ProductBundleOptionTranslation::class,
\Webkul\Product\Models\ProductBundleOptionProduct::class,
\Webkul\Product\Models\ProductCustomerGroupPrice::class,
\Webkul\Product\Models\ProductVideo::class,
];
}

View File

@ -16,6 +16,7 @@ use Illuminate\Pagination\LengthAwarePaginator;
use Webkul\Product\Models\ProductAttributeValueProxy;
use Webkul\Attribute\Repositories\AttributeRepository;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Facades\Storage;
class ProductRepository extends Repository
{
@ -731,7 +732,17 @@ class ProductRepository extends Repository
if (! in_array('images', $attributesToSkip)) {
foreach ($originalProduct->images as $image) {
$copiedProduct->images()->save($image->replicate());
$copiedProductImage = $copiedProduct->images()->save($image->replicate());
$this->copyProductImageVideo($image, $copiedProduct, $copiedProductImage);
}
}
if (! in_array('videos', $attributesToSkip)) {
foreach ($originalProduct->videos as $video) {
$copiedProductVideo = $copiedProduct->videos()->save($video->replicate());
$this->copyProductImageVideo($video, $copiedProduct, $copiedProductVideo);
}
}
@ -762,4 +773,24 @@ class ProductRepository extends Repository
]);
}
}
/**
* @object $data
* @object $copiedProduct
* @object $copiedProductImageVideo
*/
private function copyProductImageVideo($data, $copiedProduct, $copiedProductImageVideo): void
{
$path = explode("/", $data->path);
$path = 'product/' . $copiedProduct->id .'/'. end($path);
$copiedProductImageVideo->path = $path;
$copiedProductImageVideo->save();
Storage::makeDirectory('product/' . $copiedProduct->id);
Storage::copy($data->path, $copiedProductImageVideo->path);
}
}

View File

@ -0,0 +1,60 @@
<?php
namespace Webkul\Product\Repositories;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Illuminate\Http\UploadedFile;
use Webkul\Core\Eloquent\Repository;
class ProductVideoRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Product\Contracts\ProductVideo';
}
/**
* @param array $data
* @param \Webkul\Product\Contracts\Product $product
* @return void
*/
public function uploadVideos($data, $product)
{
$previousVideoIds = $product->videos()->pluck('id');
if (isset($data['videos'])) {
foreach ($data['videos'] as $videoId => $video) {
$file = 'videos.' . $videoId;
$dir = 'product/' . $product->id;
if ($video instanceof UploadedFile) {
if (request()->hasFile($file)) {
$this->create([
'path' => request()->file($file)->store($dir),
'product_id' => $product->id,
'type' => 'video'
]);
}
} else {
if (is_numeric($index = $previousVideoIds->search($videoId))) {
$previousVideoIds->forget($index);
}
}
}
}
foreach ($previousVideoIds as $videoId) {
if ($videoModel = $this->find($videoId)) {
Storage::delete($videoModel->path);
$this->delete($videoId);
}
}
}
}

View File

@ -11,6 +11,7 @@ use Webkul\Product\Repositories\ProductRepository;
use Webkul\Attribute\Repositories\AttributeRepository;
use Webkul\Product\Datatypes\CartItemValidationResult;
use Webkul\Product\Repositories\ProductImageRepository;
use Webkul\Product\Repositories\ProductVideoRepository;
use Webkul\Product\Repositories\ProductInventoryRepository;
use Webkul\Product\Repositories\ProductAttributeValueRepository;
@ -47,10 +48,17 @@ abstract class AbstractType
/**
* ProductImageRepository instance
*
* @var \Webkul\Product\Repositories\ProductInventoryRepository
* @var \Webkul\Product\Repositories\productImageRepository
*/
protected $productImageRepository;
/**
* ProductVideoRepository instance
*
* @var \Webkul\Product\Repositories\productVideoRepository
*/
protected $productVideoRepository;
/**
* Product Image helper instance
*
@ -141,6 +149,7 @@ abstract class AbstractType
* @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
* @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository
* @param \Webkul\Product\Helpers\ProductImage $productImageHelper
* @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository
*
* @return void
*/
@ -150,7 +159,8 @@ abstract class AbstractType
ProductAttributeValueRepository $attributeValueRepository,
ProductInventoryRepository $productInventoryRepository,
ProductImageRepository $productImageRepository,
ProductImage $productImageHelper
ProductImage $productImageHelper,
ProductVideoRepository $productVideoRepository
) {
$this->attributeRepository = $attributeRepository;
@ -163,6 +173,8 @@ abstract class AbstractType
$this->productImageRepository = $productImageRepository;
$this->productImageHelper = $productImageHelper;
$this->productVideoRepository = $productVideoRepository;
}
/**
@ -271,6 +283,8 @@ abstract class AbstractType
$this->productImageRepository->uploadImages($data, $product);
$this->productVideoRepository->uploadVideos($data, $product);
app('Webkul\Product\Repositories\ProductCustomerGroupPriceRepository')->saveCustomerGroupPrices($data,
$product);
}

View File

@ -8,6 +8,7 @@ use Webkul\Product\Repositories\ProductRepository;
use Webkul\Product\Repositories\ProductAttributeValueRepository;
use Webkul\Product\Repositories\ProductInventoryRepository;
use Webkul\Product\Repositories\ProductImageRepository;
use Webkul\Product\Repositories\ProductVideoRepository;
use Webkul\Product\Repositories\ProductBundleOptionRepository;
use Webkul\Product\Repositories\ProductBundleOptionProductRepository;
use Webkul\Product\Helpers\ProductImage;
@ -54,7 +55,8 @@ class Bundle extends AbstractType
'admin::catalog.products.accordians.categories',
'admin::catalog.products.accordians.bundle-items',
'admin::catalog.products.accordians.channels',
'admin::catalog.products.accordians.product-links'
'admin::catalog.products.accordians.product-links',
'admin::catalog.products.accordians.videos',
];
/**
@ -88,6 +90,7 @@ class Bundle extends AbstractType
* @param \Webkul\Product\Repositories\ProductBundleOptionProductRepository $productBundleOptionProductRepository
* @param \Webkul\Product\Helpers\ProductImage $productImageHelper
* @param \Webkul\Product\Helpers\BundleOption $bundleOptionHelper
* @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository
* @return void
*/
public function __construct(
@ -99,7 +102,8 @@ class Bundle extends AbstractType
ProductBundleOptionRepository $productBundleOptionRepository,
ProductBundleOptionProductRepository $productBundleOptionProductRepository,
ProductImage $productImageHelper,
BundleOption $bundleOptionHelper
BundleOption $bundleOptionHelper,
ProductVideoRepository $productVideoRepository
)
{
parent::__construct(
@ -108,7 +112,8 @@ class Bundle extends AbstractType
$attributeValueRepository,
$productInventoryRepository,
$productImageRepository,
$productImageHelper
$productImageHelper,
$productVideoRepository
);
$this->productBundleOptionRepository = $productBundleOptionRepository;

View File

@ -29,7 +29,8 @@ class Configurable extends AbstractType
'admin::catalog.products.accordians.categories',
'admin::catalog.products.accordians.variations',
'admin::catalog.products.accordians.channels',
'admin::catalog.products.accordians.product-links'
'admin::catalog.products.accordians.product-links',
'admin::catalog.products.accordians.videos',
];
/**

View File

@ -8,6 +8,7 @@ use Webkul\Product\Repositories\ProductRepository;
use Webkul\Attribute\Repositories\AttributeRepository;
use Webkul\Product\Datatypes\CartItemValidationResult;
use Webkul\Product\Repositories\ProductImageRepository;
use Webkul\Product\Repositories\ProductVideoRepository;
use Webkul\Product\Repositories\ProductInventoryRepository;
use Webkul\Product\Repositories\ProductAttributeValueRepository;
use Webkul\Product\Repositories\ProductDownloadableLinkRepository;
@ -47,6 +48,7 @@ class Downloadable extends AbstractType
'admin::catalog.products.accordians.downloadable',
'admin::catalog.products.accordians.channels',
'admin::catalog.products.accordians.product-links',
'admin::catalog.products.accordians.videos',
];
/**
@ -79,6 +81,7 @@ class Downloadable extends AbstractType
* @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository
* @param \Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository
* @param \Webkul\Product\Helpers\ProductImage $productImageHelper
* @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository
*
* @return void
*/
@ -90,7 +93,8 @@ class Downloadable extends AbstractType
productImageRepository $productImageRepository,
ProductDownloadableLinkRepository $productDownloadableLinkRepository,
ProductDownloadableSampleRepository $productDownloadableSampleRepository,
ProductImage $productImageHelper
ProductImage $productImageHelper,
ProductVideoRepository $productVideoRepository
)
{
parent::__construct(
@ -99,7 +103,8 @@ class Downloadable extends AbstractType
$attributeValueRepository,
$productInventoryRepository,
$productImageRepository,
$productImageHelper
$productImageHelper,
$productVideoRepository
);
$this->productDownloadableLinkRepository = $productDownloadableLinkRepository;

View File

@ -7,6 +7,7 @@ use Webkul\Product\Repositories\ProductRepository;
use Webkul\Product\Repositories\ProductAttributeValueRepository;
use Webkul\Product\Repositories\ProductInventoryRepository;
use Webkul\Product\Repositories\ProductImageRepository;
use Webkul\Product\Repositories\ProductVideoRepository;
use Webkul\Product\Repositories\ProductGroupedProductRepository;
use Webkul\Product\Helpers\ProductImage;
use Webkul\Product\Models\ProductAttributeValue;
@ -38,7 +39,8 @@ class Grouped extends AbstractType
'admin::catalog.products.accordians.categories',
'admin::catalog.products.accordians.grouped-products',
'admin::catalog.products.accordians.channels',
'admin::catalog.products.accordians.product-links'
'admin::catalog.products.accordians.product-links',
'admin::catalog.products.accordians.videos',
];
/**
@ -51,13 +53,14 @@ class Grouped extends AbstractType
/**
* Create a new product type instance.
*
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
* @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
* @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
* @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository
* @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
* @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository
* @param \Webkul\Product\Repositories\ProductGroupedProductRepository $productGroupedProductRepository
* @param \Webkul\Product\Helpers\ProductImage $productImageHelper
* @param \Webkul\Product\Helpers\ProductImage $productImageHelper
* @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository
* @return void
*/
public function __construct(
@ -67,7 +70,8 @@ class Grouped extends AbstractType
ProductInventoryRepository $productInventoryRepository,
ProductImageRepository $productImageRepository,
ProductGroupedProductRepository $productGroupedProductRepository,
ProductImage $productImageHelper
ProductImage $productImageHelper,
ProductVideoRepository $productVideoRepository
)
{
parent::__construct(
@ -76,7 +80,8 @@ class Grouped extends AbstractType
$attributeValueRepository,
$productInventoryRepository,
$productImageRepository,
$productImageHelper
$productImageHelper,
$productVideoRepository
);
$this->productGroupedProductRepository = $productGroupedProductRepository;

View File

@ -22,6 +22,7 @@ class Simple extends AbstractType
'admin::catalog.products.accordians.categories',
'admin::catalog.products.accordians.channels',
'admin::catalog.products.accordians.product-links',
'admin::catalog.products.accordians.videos',
];
/**

View File

@ -22,6 +22,7 @@ class Virtual extends AbstractType
'admin::catalog.products.accordians.categories',
'admin::catalog.products.accordians.channels',
'admin::catalog.products.accordians.product-links',
'admin::catalog.products.accordians.videos',
];
/**

View File

@ -0,0 +1,11 @@
<?php
namespace Webkul\Rule\Providers;
use Konekt\Concord\BaseModuleServiceProvider;
class ModuleServiceProvider extends BaseModuleServiceProvider
{
protected $models = [
];
}

View File

@ -0,0 +1,11 @@
<?php
namespace Webkul\Shipping\Providers;
use Konekt\Concord\BaseModuleServiceProvider;
class ModuleServiceProvider extends BaseModuleServiceProvider
{
protected $models = [
];
}

View File

@ -0,0 +1,11 @@
<?php
namespace Webkul\Shop\Providers;
use Konekt\Concord\BaseModuleServiceProvider;
class ModuleServiceProvider extends BaseModuleServiceProvider
{
protected $models = [
];
}

View File

@ -1,7 +1,15 @@
@inject ('productImageHelper', 'Webkul\Product\Helpers\ProductImage')
@inject ('productVideoHelper', 'Webkul\Product\Helpers\ProductVideo')
@inject ('wishListHelper', 'Webkul\Customer\Helpers\Wishlist')
<?php $images = $productImageHelper->getGalleryImages($product); ?>
<?php
$images = $productImageHelper->getGalleryImages($product);
$videos = $productVideoHelper->getVideos($product);
$images = array_merge($images, $videos);
?>
{!! view_render_event('bagisto.shop.products.view.gallery.before', ['product' => $product]) !!}
@ -30,7 +38,12 @@
</li>
<li class="thumb-frame" v-for='(thumb, index) in thumbs' @mouseover="changeImage(thumb)" :class="[thumb.large_image_url == currentLargeImageUrl ? 'active' : '']" id="thumb-frame">
<img :src="thumb.small_image_url" alt=""/>
<video v-if="thumb.type == 'video'" width="100%" height="100%" onclick="this.paused ? this.play() : this.pause();">
<source :src="thumb.video_url" type="video/mp4">
{{ __('admin::app.catalog.products.not-support-video') }}
</video>
<img v-else :src="thumb.small_image_url" alt=""/>
</li>
<li class="gallery-control bottom" @click="moveThumbs('bottom')" v-if="(thumbs.length > 4) && this.is_move.down">
@ -39,10 +52,13 @@
</li>
</ul>
<div class="product-hero-image" id="product-hero-image">
<img :src="currentLargeImageUrl" id="pro-img" :data-image="currentOriginalImageUrl" alt=""/>
<video :key="currentVideoUrl" v-if="currentType == 'video'" width="100%" height="100%" controls>
<source :src="currentVideoUrl" :data-image="currentOriginalImageUrl" type="video/mp4">
{{ __('admin::app.catalog.products.not-support-video') }}
</video>
<img v-else :src="currentLargeImageUrl" id="pro-img" :data-image="currentOriginalImageUrl" alt=""/>
@auth('customer')
@php
@ -76,6 +92,10 @@
currentOriginalImageUrl: '',
currentVideoUrl: '',
currentType: '',
counter: {
up: 0,
down: 0,
@ -114,11 +134,19 @@
},
changeImage: function(image) {
this.currentLargeImageUrl = image.large_image_url;
this.currentType = image.type;
this.currentOriginalImageUrl = image.original_image_url;
if (image.type == 'video') {
this.currentVideoUrl = image.video_url;
if ($(window).width() > 580) {
this.currentLargeImageUrl = image.large_image_url = image.video_url;
} else {
this.currentLargeImageUrl = image.large_image_url;
this.currentOriginalImageUrl = image.original_image_url;
}
if ($(window).width() > 580 && image.original_image_url) {
$('img#pro-img').data('zoom-image', image.original_image_url).ezPlus();
}
},

View File

@ -0,0 +1,11 @@
<?php
namespace Webkul\Theme\Providers;
use Konekt\Concord\BaseModuleServiceProvider;
class ModuleServiceProvider extends BaseModuleServiceProvider
{
protected $models = [
];
}

View File

@ -0,0 +1,11 @@
<?php
namespace Webkul\Ui\Providers;
use Konekt\Concord\BaseModuleServiceProvider;
class ModuleServiceProvider extends BaseModuleServiceProvider
{
protected $models = [
];
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
{
"/js/velocity.js": "/js/velocity.js?id=4ac9d3094b2372ee0b3e",
"/js/velocity.js": "/js/velocity.js?id=64eee9a349d40f22629e",
"/css/velocity-admin.css": "/css/velocity-admin.css?id=4322502d80a0e4a0affd",
"/css/velocity.css": "/css/velocity.css?id=d1461e1147981876a7fd"
"/css/velocity.css": "/css/velocity.css?id=e41e400c39a3cb5bc551"
}

View File

@ -46,7 +46,9 @@ class ConfigurationController extends Controller
* @return \Illuminate\View\View
*/
public function renderMetaData()
{
{
$this->locale = request()->get('locale') ? request()->get('locale') : app()->getLocale();
$velocityMetaData = $this->velocityHelper->getVelocityMetaData($this->locale, $this->channel, false);
if (! $velocityMetaData) {

View File

@ -1,45 +1,67 @@
<template>
<div class="magnifier">
<img
:src="src"
:data-zoom-image="src"
ref="activeProductImage"
id="active-product-image"
class="main-product-image"
alt=""
/>
<div :class="currentType == 'video' ? '' : 'magnifier'">
<video :key="activeImageVideoURL" v-if="currentType == 'video'" width="100%" height="100%" controls>
<source :src="activeImageVideoURL" type="video/mp4">
</video>
<img v-else
:src="activeImageVideoURL"
:data-zoom-image="activeImageVideoURL"
class="main-product-image">
</div>
</template>
<style lang="scss">
.magnifier {
> img {
max-width: 100%;
min-height: 530px;
max-height: 530px;
}
}
</style>
<script type="text/javascript">
export default {
props: ['src'],
props: ['src', 'type'],
data: function () {
return {
'activeImage': null,
'activeImageElement': null,
activeImage: null,
activeImageVideoURL: '',
currentType: '',
}
},
mounted: function () {
/* store image related info in global variables */
this.activeImageElement = this.$refs.activeProductImage;
/* type checking for media type */
this.currentType = this.type;
/* convert into jQuery object */
this.activeImage = new jQuery.fn.init(this.activeImageElement);
/* getting url */
this.activeImageVideoURL = this.src;
/* binding should be with class as ezplus is having bug of creating multiple containers */
this.activeImage = $('.main-product-image');
this.activeImage.attr('src', this.activeImageVideoURL);
this.activeImage.data('zoom-image', this.activeImageVideoURL);
/* initialise zoom */
this.elevateZoom();
this.$root.$on('changeMagnifiedImage', ({smallImageUrl, largeImageUrl}) => {
this.$root.$on('changeMagnifiedImage', ({smallImageUrl, largeImageUrl, currentType}) => {
/* removed old instance */
$('.zoomContainer').remove();
this.activeImage.removeData('elevateZoom');
/* type checking for media type */
this.currentType = currentType;
/* getting url */
this.activeImageVideoURL = largeImageUrl;
/* update source for images */
this.activeImageElement.src = smallImageUrl;
this.activeImage.data('zoom-image', (largeImageUrl ? largeImageUrl : smallImageUrl));
this.activeImage.attr('src', smallImageUrl);
this.activeImage.data('zoom-image', largeImageUrl);
/* reinitialize zoom */
this.elevateZoom();
@ -47,12 +69,13 @@
},
methods: {
'elevateZoom': function () {
elevateZoom: function () {
this.activeImage.ezPlus({
zoomLevel: 0.5,
cursor: 'pointer',
scrollZoom: true,
zoomWindowWidth: 400,
zoomWindowHeight: 400,
zoomWindowWidth: 250,
zoomWindowHeight: 250,
});
},
}

View File

@ -113,6 +113,7 @@
this.$http.delete(`${this.$root.baseUrl}/cart/remove/${productId}`)
.then(response => {
this.cartItems = this.cartItems.filter(item => item.id != productId);
this.$root.miniCartKey++;
window.showAlert(`alert-${response.data.status}`, response.data.label, response.data.message);
})
@ -122,7 +123,7 @@
},
checkMinimumOrder: function (e) {
if (! this.isMinimumOrderCompleted) {
if (! Boolean(this.isMinimumOrderCompleted)) {
e.preventDefault();
window.showAlert(`alert-warning`, 'Warning', this.minimumOrderMessage);
}

View File

@ -5,13 +5,13 @@
<template v-else-if="productCollections.length > 0">
<card-list-header
:heading="isCategory ? categoryDetails.name : productTitle"
:view-all="isCategory ? `${this.baseUrl}/${categoryDetails.slug}` : ''">
:view-all="isCategory ? `${this.baseUrl}/${categoryDetails.url_path}` : ''">
</card-list-header>
<div class="row" :class="localeDirection">
<div
class="col-md-12 no-padding carousel-products"
:class="showRecentlyViewed ? 'with-recent-viewed col-lg-9' : 'col-lg-12'">
:class="showRecentlyViewed ? 'with-recent-viewed col-lg-9' : 'without-recent-viewed col-lg-12'">
<carousel-component
:slides-per-page="slidesPerPage"
navigation-enabled="hide"
@ -85,6 +85,7 @@
});
this.getProducts();
this.setWindowWidth();
this.setSlidesPerPage(this.windowWidth);
},
@ -122,17 +123,46 @@
})
},
/* waiting for element */
waitForElement: function (selector, callback) {
if (jQuery(selector).length) {
callback();
} else {
setTimeout(() => {
this.waitForElement(selector, callback);
}, 100);
}
},
/* setting window width */
setWindowWidth: function () {
let windowClass = this.getWindowClass();
this.waitForElement(windowClass, () => {
this.windowWidth = $(windowClass).width();
});
},
/* get window class */
getWindowClass: function () {
return this.showRecentlyViewed ? '.with-recent-viewed' : '.without-recent-viewed';
},
/* on resize set window width */
onResize: function () {
this.windowWidth = window.innerWidth;
this.windowWidth = $(this.getWindowClass()).width();
},
/* setting slides on the basis of window width */
setSlidesPerPage: function (width) {
if (width >= 992) {
if (width >= 1200) {
this.slidesPerPage = 6;
} else if (width < 992 && width >= 420) {
} else if (width < 1200 && width >= 992) {
this.slidesPerPage = 5;
} else if (width < 992 && width >= 822) {
this.slidesPerPage = 4;
} else if (width < 822 && width >= 626) {
this.slidesPerPage = 3;
} else {
this.slidesPerPage = 2;
}

View File

@ -2450,14 +2450,22 @@
width: 800px;
}
/* compare products */
.compare-products {
width: 100%;
cursor: pointer;
overflow-x: auto;
padding-bottom: 20px;
word-break: break-word;
margin-left: 0 !important;
margin-right: 10px !important;
.active {
cursor: grabbing;
cursor: -webkit-grabbing;
transform: scale(1);
}
tr {
width: 100%;
}
@ -2520,6 +2528,20 @@
}
}
/* hide scrollbar for chrome, safari and opera */
.compare-products::-webkit-scrollbar {
display: none;
}
/* hide scrollbar for ie, edge and firefox */
.compare-products {
/* ie and edge */
-ms-overflow-style: none;
/* firefox */
scrollbar-width: none;
}
//CSS for loader
.cp-spinner {
width: 48px;

View File

@ -4,19 +4,6 @@
padding-left: 0 !important;
padding-right: 0 !important;
.magnifier {
> img {
max-width: 100%;
min-height: 450px;
max-height: 530px;
}
}
img {
// width: 100%;
// height: 100%;
}
.right {
@extend .fs16;

View File

@ -9,7 +9,7 @@
checkout-text="{{ __('shop::app.minicart.checkout') }}"
checkout-url="{{ route('shop.checkout.onepage.index') }}"
subtotal-text="{{ __('shop::app.checkout.cart.cart-subtotal') }}"
is-minimum-order-completed="{{ Cart::checkMinimumOrder() }}"
is-minimum-order-completed="{{ (bool) Cart::checkMinimumOrder() }}"
minimum-order-message="{{ __('shop::app.checkout.cart.minimum-order-message', ['amount' => core()->currency($minimumOrderAmount)]) }}">
</mini-cart>
</div>

View File

@ -165,6 +165,8 @@
mounted: function () {
this.getComparedProducts();
this.activateSlider();
},
methods: {
@ -192,10 +194,6 @@
.then(response => {
this.isProductListLoaded = true;
if (response.data.products.length > 3) {
$('.compare-products').css('overflow-x', 'scroll');
}
this.products = response.data.products;
})
.catch(error => {
@ -286,6 +284,47 @@
}
return attributeOptions;
},
activateSlider: function () {
/* main slider */
const slider = document.querySelector('.compare-products');
let startX;
let scrollLeft;
/* check for mouse down */
let isMouseDown = false;
slider.addEventListener('mousedown', (e) => {
isMouseDown = true;
slider.classList.add('active');
startX = e.pageX - slider.offsetLeft;
scrollLeft = slider.scrollLeft;
});
slider.addEventListener('mouseleave', () => {
isMouseDown = false;
slider.classList.remove('active');
});
slider.addEventListener('mouseup', () => {
isMouseDown = false;
slider.classList.remove('active');
});
slider.addEventListener('mousemove', (e) => {
if (! isMouseDown) {
return;
}
e.preventDefault();
const x = e.pageX - slider.offsetLeft;
const walk = (x - startX) * 3;
slider.scrollLeft = scrollLeft - walk;
});
}
}
});

View File

@ -102,7 +102,7 @@
style="width: 100%"
@endif>
<shimmer-component v-if="isLoading && !isMobile()" shimmer-count="4"></shimmer-component>
<shimmer-component v-if="isLoading" shimmer-count="4"></shimmer-component>
<template v-else-if="products.length > 0">
@if ($toolbarHelper->getCurrentMode() == 'grid')

View File

@ -1,75 +1,89 @@
@inject ('productImageHelper', 'Webkul\Product\Helpers\ProductImage')
@inject ('productVideoHelper', 'Webkul\Product\Helpers\ProductVideo')
@inject ('wishListHelper', 'Webkul\Customer\Helpers\Wishlist')
@php
$images = $productImageHelper->getGalleryImages($product);
$videos = $productVideoHelper->getVideos($product);
if (! count($images)) {
$images[0] = $productImageHelper->getProductBaseImage($product);
$videoData = $imageData = [];
foreach ($videos as $key => $video) {
$videoData[$key]['type'] = $video['type'];
$videoData[$key]['large_image_url'] = $videoData[$key]['small_image_url']= $videoData[$key]['medium_image_url']= $videoData[$key]['original_image_url'] = $video['video_url'];
}
foreach ($images as $key => $image) {
$imageData[$key]['type'] = '';
$imageData[$key]['large_image_url'] = $image['large_image_url'];
$imageData[$key]['small_image_url'] = $image['small_image_url'];
$imageData[$key]['medium_image_url'] = $image['medium_image_url'];
$imageData[$key]['original_image_url'] = $image['original_image_url'];
}
$images = array_merge($imageData, $videoData);
@endphp
{!! view_render_event('bagisto.shop.products.view.gallery.before', ['product' => $product]) !!}
<div class="product-image-group">
<div class="row">
<div class="col-12">
<magnify-image src="{{ $images[0]['large_image_url'] }}" v-if="!isMobile()">
</magnify-image>
<div class="row col-12">
<magnify-image src="{{ $images[0]['large_image_url'] }}" type="{{ $images[0]['type'] }}">
</magnify-image>
</div>
<img
v-else
class="vc-small-product-image"
src="{{ $images[0]['large_image_url'] }}" alt="" />
</div>
</div>
<div class="row">
<div class="col-12">
<product-gallery></product-gallery>
</div>
<div class="row col-12">
<product-gallery></product-gallery>
</div>
</div>
{!! view_render_event('bagisto.shop.products.view.gallery.after', ['product' => $product]) !!}
<script type="text/x-template" id="product-gallery-template">
<ul class="thumb-list col-12 row ltr" type="none">
<li class="arrow left" @click="scroll('prev')" v-if="thumbs.length > 4">
<i class="rango-arrow-left fs24"></i>
</li>
<carousel-component
slides-per-page="4"
:id="galleryCarouselId"
pagination-enabled="hide"
navigation-enabled="hide"
add-class="product-gallery"
:slides-count="thumbs.length">
<slide :slot="`slide-${index}`" v-for="(thumb, index) in thumbs">
<li
@mouseover="changeImage({
largeImageUrl: thumb.large_image_url,
originalImageUrl: thumb.original_image_url,
currentType: thumb.type
})"
:class="`thumb-frame ${index + 1 == 4 ? '' : 'mr5'} ${thumb.large_image_url == currentLargeImageUrl ? 'active' : ''}`"
>
<video v-if="thumb.type == 'video'" width="110" height="110" controls>
<source :src="thumb.small_image_url" type="video/mp4">
{{ __('admin::app.catalog.products.not-support-video') }}
</video>
<div v-else
class="bg-image"
:style="`background-image: url(${thumb.small_image_url})`">
</div>
</li>
</slide>
</carousel-component>
<li class="arrow right" @click="scroll('next')" v-if="thumbs.length > 4">
<i class="rango-arrow-right fs24"></i>
</li>
</ul>
</script>
@push('scripts')
<script type="text/x-template" id="product-gallery-template">
<ul class="thumb-list col-12 row ltr" type="none">
<li class="arrow left" @click="scroll('prev')" v-if="thumbs.length > 4">
<i class="rango-arrow-left fs24"></i>
</li>
<carousel-component
slides-per-page="4"
:id="galleryCarouselId"
pagination-enabled="hide"
navigation-enabled="hide"
add-class="product-gallery"
:slides-count="thumbs.length">
<slide :slot="`slide-${index}`" v-for="(thumb, index) in thumbs">
<li
@mouseover="changeImage({
largeImageUrl: thumb.large_image_url,
originalImageUrl: thumb.original_image_url,
})"
:class="`thumb-frame ${index + 1 == 4 ? '' : 'mr5'} ${thumb.large_image_url == currentLargeImageUrl ? 'active' : ''}`"
>
<div
class="bg-image"
:style="`background-image: url(${thumb.small_image_url})`">
</div>
</li>
</slide>
</carousel-component>
<li class="arrow right" @click="scroll('next')" v-if="thumbs.length > 4">
<i class="rango-arrow-right fs24"></i>
</li>
</ul>
</script>
<script type="text/javascript">
(() => {
var galleryImages = @json($images);
@ -83,6 +97,7 @@
galleryCarouselId: 'product-gallery-carousel',
currentLargeImageUrl: '',
currentOriginalImageUrl: '',
currentType: '',
counter: {
up: 0,
down: 0,
@ -96,6 +111,7 @@
this.changeImage({
largeImageUrl: this.images[0]['large_image_url'],
originalImageUrl: this.images[0]['original_image_url'],
currentType: this.images[0]['type']
})
}
@ -107,11 +123,12 @@
this.changeImage({
largeImageUrl: this.images[0]['large_image_url'],
originalImageUrl: this.images[0]['original_image_url'],
currentType: this.images[0]['type']
});
eventBus.$on('configurable-variant-update-images-event', this.updateImages);
this.prepareThumbs()
this.prepareThumbs();
},
methods: {
@ -127,13 +144,17 @@
});
},
changeImage: function({largeImageUrl, originalImageUrl}) {
changeImage: function({largeImageUrl, originalImageUrl, currentType}) {
this.currentLargeImageUrl = largeImageUrl;
this.currentOriginalImageUrl = originalImageUrl;
this.currentType = currentType;
this.$root.$emit('changeMagnifiedImage', {
smallImageUrl: this.currentOriginalImageUrl
smallImageUrl: this.currentOriginalImageUrl,
largeImageUrl: this.currentLargeImageUrl,
currentType : this.currentType
});
let productImage = $('.vc-small-product-image');