panier phase 1
This commit is contained in:
parent
f8a2f15fb0
commit
9d84ae1692
23 changed files with 2463 additions and 395 deletions
|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Models\Product;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Collection;
|
||||
use Gloudemans\Shoppingcart\Facades\Cart;
|
||||
|
||||
class BasketController extends Controller
|
||||
|
|
@ -18,11 +19,28 @@ class BasketController extends Controller
|
|||
$product = Product::find($request->id);
|
||||
Cart::add($product, $request->qty);
|
||||
|
||||
return $this->getCart();
|
||||
}
|
||||
|
||||
$dbpanier = new \Illuminate\Support\Collection();
|
||||
public function removeFromCart(Request $request)
|
||||
{
|
||||
$rowId = $request->rowId;
|
||||
Cart::remove($rowId);
|
||||
return $this->getCart();
|
||||
}
|
||||
|
||||
public function emptyCart() {
|
||||
Cart::destroy();
|
||||
return $this->getCart();
|
||||
}
|
||||
|
||||
public function getCart() {
|
||||
|
||||
$dbpanier = new Collection();
|
||||
foreach (Cart::content() as $row) {
|
||||
$product = $row->model;
|
||||
$product->additionnalProductInfo = $product->additionnalProductInfo($product->product_type);
|
||||
|
||||
$cartextendedItem = array(
|
||||
'cartItem' => $row,
|
||||
'product' => $product
|
||||
|
|
@ -30,6 +48,18 @@ class BasketController extends Controller
|
|||
$dbpanier->add($cartextendedItem);
|
||||
}
|
||||
|
||||
return $dbpanier;
|
||||
$cartInfos = array(
|
||||
"totalTTC" => Cart::total(),
|
||||
'totalTVA' => Cart::tax(), //total des taxes
|
||||
'totalHT' => Cart::subtotal(), //total sans les taxes
|
||||
'totalweight' => Cart::weight(), //poids total des items
|
||||
'totalHTbefore' => Cart::priceTotal(), //total avant taxes et remises
|
||||
'totaldiscount' => Cart::discount(), //total des remises
|
||||
'countItems' => Cart::count(), //nb de produits dans le cart
|
||||
);
|
||||
|
||||
$cartReturn = array($dbpanier,$cartInfos);
|
||||
|
||||
return $cartReturn;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,15 +2,9 @@
|
|||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Product;
|
||||
use App\Models\Range;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Gloudemans\Shoppingcart\Facades\Cart;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use stdClass;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -38,27 +32,5 @@ class AppServiceProvider extends ServiceProvider
|
|||
// on partage les ranges (gammes produit)
|
||||
$ranges = Range::all();
|
||||
View::share('ranges', $ranges);
|
||||
|
||||
|
||||
$product = Product::find(6);
|
||||
Cart::add($product, 1);
|
||||
$product = Product::find(2);
|
||||
Cart::add($product, 1);
|
||||
Cart::add($product, 1);
|
||||
$product = Product::find(5);
|
||||
Cart::add($product, 1);
|
||||
|
||||
$dbpanier = new \Illuminate\Support\Collection();
|
||||
foreach (Cart::content() as $row) {
|
||||
$product = $row->model;
|
||||
$product->additionnalProductInfo = $product->additionnalProductInfo($product->product_type);
|
||||
$cartextendedItem = array(
|
||||
'cartItem' => $row,
|
||||
'product' => $product
|
||||
);
|
||||
$dbpanier->add($cartextendedItem);
|
||||
}
|
||||
|
||||
View::share('dbpanier', $dbpanier);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'tax' => 21,
|
||||
'tax' => 20,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
21
package-lock.json
generated
21
package-lock.json
generated
|
|
@ -1641,12 +1641,20 @@
|
|||
}
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz",
|
||||
"integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==",
|
||||
"version": "0.21.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
|
||||
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"follow-redirects": "1.5.10"
|
||||
"follow-redirects": "^1.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"follow-redirects": {
|
||||
"version": "1.13.3",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz",
|
||||
"integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"babel-code-frame": {
|
||||
|
|
@ -9368,6 +9376,11 @@
|
|||
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
|
||||
"dev": true
|
||||
},
|
||||
"vuex": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz",
|
||||
"integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw=="
|
||||
},
|
||||
"watchpack": {
|
||||
"version": "1.7.5",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^0.19",
|
||||
"axios": "^0.21.1",
|
||||
"bootstrap": "^4.5.0",
|
||||
"cross-env": "^7.0",
|
||||
"jquery": "^3.6",
|
||||
|
|
@ -19,11 +19,12 @@
|
|||
"popper.js": "^1.12",
|
||||
"resolve-url-loader": "^3.1.0",
|
||||
"sass-loader": "^8.0.2",
|
||||
"vue-template-compiler": "^2.6.12",
|
||||
"swiper": "^6.3.4"
|
||||
"swiper": "^6.3.4",
|
||||
"vue-template-compiler": "^2.6.12"
|
||||
},
|
||||
"dependencies": {
|
||||
"sass": "^1.28.0",
|
||||
"vue": "^2.6.12"
|
||||
"vue": "^2.6.12",
|
||||
"vuex": "^3.6.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
191
public/b-o/js/app.js
vendored
191
public/b-o/js/app.js
vendored
|
|
@ -109,6 +109,7 @@ module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/li
|
|||
|
||||
var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
|
||||
var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js");
|
||||
var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js");
|
||||
var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
|
||||
var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js");
|
||||
var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
|
||||
|
|
@ -129,7 +130,7 @@ module.exports = function xhrAdapter(config) {
|
|||
// HTTP basic authentication
|
||||
if (config.auth) {
|
||||
var username = config.auth.username || '';
|
||||
var password = config.auth.password || '';
|
||||
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
||||
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
||||
}
|
||||
|
||||
|
|
@ -210,8 +211,6 @@ module.exports = function xhrAdapter(config) {
|
|||
// This is only done if running in a standard browser environment.
|
||||
// Specifically not if we're in a web worker, or react-native.
|
||||
if (utils.isStandardBrowserEnv()) {
|
||||
var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js");
|
||||
|
||||
// Add xsrf header
|
||||
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
|
||||
cookies.read(config.xsrfCookieName) :
|
||||
|
|
@ -277,7 +276,7 @@ module.exports = function xhrAdapter(config) {
|
|||
});
|
||||
}
|
||||
|
||||
if (requestData === undefined) {
|
||||
if (!requestData) {
|
||||
requestData = null;
|
||||
}
|
||||
|
||||
|
|
@ -346,6 +345,9 @@ axios.all = function all(promises) {
|
|||
};
|
||||
axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js");
|
||||
|
||||
// Expose isAxiosError
|
||||
axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./node_modules/axios/lib/helpers/isAxiosError.js");
|
||||
|
||||
module.exports = axios;
|
||||
|
||||
// Allow use of default import syntax in TypeScript
|
||||
|
|
@ -554,9 +556,10 @@ Axios.prototype.getUri = function getUri(config) {
|
|||
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
||||
/*eslint func-names:0*/
|
||||
Axios.prototype[method] = function(url, config) {
|
||||
return this.request(utils.merge(config || {}, {
|
||||
return this.request(mergeConfig(config || {}, {
|
||||
method: method,
|
||||
url: url
|
||||
url: url,
|
||||
data: (config || {}).data
|
||||
}));
|
||||
};
|
||||
});
|
||||
|
|
@ -564,7 +567,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
|
|||
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
||||
/*eslint func-names:0*/
|
||||
Axios.prototype[method] = function(url, data, config) {
|
||||
return this.request(utils.merge(config || {}, {
|
||||
return this.request(mergeConfig(config || {}, {
|
||||
method: method,
|
||||
url: url,
|
||||
data: data
|
||||
|
|
@ -824,7 +827,7 @@ module.exports = function enhanceError(error, config, code, request, response) {
|
|||
error.response = response;
|
||||
error.isAxiosError = true;
|
||||
|
||||
error.toJSON = function() {
|
||||
error.toJSON = function toJSON() {
|
||||
return {
|
||||
// Standard
|
||||
message: this.message,
|
||||
|
|
@ -873,59 +876,73 @@ module.exports = function mergeConfig(config1, config2) {
|
|||
config2 = config2 || {};
|
||||
var config = {};
|
||||
|
||||
var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
|
||||
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
|
||||
var valueFromConfig2Keys = ['url', 'method', 'data'];
|
||||
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
|
||||
var defaultToConfig2Keys = [
|
||||
'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
||||
'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
||||
'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
|
||||
'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
|
||||
'httpsAgent', 'cancelToken', 'socketPath'
|
||||
'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
||||
'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
||||
'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',
|
||||
'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',
|
||||
'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'
|
||||
];
|
||||
var directMergeKeys = ['validateStatus'];
|
||||
|
||||
function getMergedValue(target, source) {
|
||||
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
||||
return utils.merge(target, source);
|
||||
} else if (utils.isPlainObject(source)) {
|
||||
return utils.merge({}, source);
|
||||
} else if (utils.isArray(source)) {
|
||||
return source.slice();
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
function mergeDeepProperties(prop) {
|
||||
if (!utils.isUndefined(config2[prop])) {
|
||||
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
||||
} else if (!utils.isUndefined(config1[prop])) {
|
||||
config[prop] = getMergedValue(undefined, config1[prop]);
|
||||
}
|
||||
}
|
||||
|
||||
utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
|
||||
if (typeof config2[prop] !== 'undefined') {
|
||||
config[prop] = config2[prop];
|
||||
if (!utils.isUndefined(config2[prop])) {
|
||||
config[prop] = getMergedValue(undefined, config2[prop]);
|
||||
}
|
||||
});
|
||||
|
||||
utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
|
||||
if (utils.isObject(config2[prop])) {
|
||||
config[prop] = utils.deepMerge(config1[prop], config2[prop]);
|
||||
} else if (typeof config2[prop] !== 'undefined') {
|
||||
config[prop] = config2[prop];
|
||||
} else if (utils.isObject(config1[prop])) {
|
||||
config[prop] = utils.deepMerge(config1[prop]);
|
||||
} else if (typeof config1[prop] !== 'undefined') {
|
||||
config[prop] = config1[prop];
|
||||
}
|
||||
});
|
||||
utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
|
||||
|
||||
utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
|
||||
if (typeof config2[prop] !== 'undefined') {
|
||||
config[prop] = config2[prop];
|
||||
} else if (typeof config1[prop] !== 'undefined') {
|
||||
config[prop] = config1[prop];
|
||||
if (!utils.isUndefined(config2[prop])) {
|
||||
config[prop] = getMergedValue(undefined, config2[prop]);
|
||||
} else if (!utils.isUndefined(config1[prop])) {
|
||||
config[prop] = getMergedValue(undefined, config1[prop]);
|
||||
}
|
||||
});
|
||||
|
||||
utils.forEach(directMergeKeys, function merge(prop) {
|
||||
if (prop in config2) {
|
||||
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
||||
} else if (prop in config1) {
|
||||
config[prop] = getMergedValue(undefined, config1[prop]);
|
||||
}
|
||||
});
|
||||
|
||||
var axiosKeys = valueFromConfig2Keys
|
||||
.concat(mergeDeepPropertiesKeys)
|
||||
.concat(defaultToConfig2Keys);
|
||||
.concat(defaultToConfig2Keys)
|
||||
.concat(directMergeKeys);
|
||||
|
||||
var otherKeys = Object
|
||||
.keys(config2)
|
||||
.keys(config1)
|
||||
.concat(Object.keys(config2))
|
||||
.filter(function filterAxiosKeys(key) {
|
||||
return axiosKeys.indexOf(key) === -1;
|
||||
});
|
||||
|
||||
utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
|
||||
if (typeof config2[prop] !== 'undefined') {
|
||||
config[prop] = config2[prop];
|
||||
} else if (typeof config1[prop] !== 'undefined') {
|
||||
config[prop] = config1[prop];
|
||||
}
|
||||
});
|
||||
utils.forEach(otherKeys, mergeDeepProperties);
|
||||
|
||||
return config;
|
||||
};
|
||||
|
|
@ -954,7 +971,7 @@ var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios
|
|||
*/
|
||||
module.exports = function settle(resolve, reject, response) {
|
||||
var validateStatus = response.config.validateStatus;
|
||||
if (!validateStatus || validateStatus(response.status)) {
|
||||
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
||||
resolve(response);
|
||||
} else {
|
||||
reject(createError(
|
||||
|
|
@ -1086,6 +1103,7 @@ var defaults = {
|
|||
xsrfHeaderName: 'X-XSRF-TOKEN',
|
||||
|
||||
maxContentLength: -1,
|
||||
maxBodyLength: -1,
|
||||
|
||||
validateStatus: function validateStatus(status) {
|
||||
return status >= 200 && status < 300;
|
||||
|
|
@ -1149,7 +1167,6 @@ var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/util
|
|||
|
||||
function encode(val) {
|
||||
return encodeURIComponent(val).
|
||||
replace(/%40/gi, '@').
|
||||
replace(/%3A/gi, ':').
|
||||
replace(/%24/g, '$').
|
||||
replace(/%2C/gi, ',').
|
||||
|
|
@ -1333,6 +1350,29 @@ module.exports = function isAbsoluteURL(url) {
|
|||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/axios/lib/helpers/isAxiosError.js":
|
||||
/*!********************************************************!*\
|
||||
!*** ./node_modules/axios/lib/helpers/isAxiosError.js ***!
|
||||
\********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
/**
|
||||
* Determines whether the payload is an error thrown by Axios
|
||||
*
|
||||
* @param {*} payload The value to test
|
||||
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
||||
*/
|
||||
module.exports = function isAxiosError(payload) {
|
||||
return (typeof payload === 'object') && (payload.isAxiosError === true);
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
|
||||
|
|
@ -1658,6 +1698,21 @@ function isObject(val) {
|
|||
return val !== null && typeof val === 'object';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a value is a plain Object
|
||||
*
|
||||
* @param {Object} val The value to test
|
||||
* @return {boolean} True if value is a plain Object, otherwise false
|
||||
*/
|
||||
function isPlainObject(val) {
|
||||
if (toString.call(val) !== '[object Object]') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var prototype = Object.getPrototypeOf(val);
|
||||
return prototype === null || prototype === Object.prototype;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a value is a Date
|
||||
*
|
||||
|
|
@ -1814,34 +1869,12 @@ function forEach(obj, fn) {
|
|||
function merge(/* obj1, obj2, obj3, ... */) {
|
||||
var result = {};
|
||||
function assignValue(val, key) {
|
||||
if (typeof result[key] === 'object' && typeof val === 'object') {
|
||||
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
||||
result[key] = merge(result[key], val);
|
||||
} else {
|
||||
result[key] = val;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0, l = arguments.length; i < l; i++) {
|
||||
forEach(arguments[i], assignValue);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function equal to merge with the difference being that no reference
|
||||
* to original objects is kept.
|
||||
*
|
||||
* @see merge
|
||||
* @param {Object} obj1 Object to merge
|
||||
* @returns {Object} Result of all merge properties
|
||||
*/
|
||||
function deepMerge(/* obj1, obj2, obj3, ... */) {
|
||||
var result = {};
|
||||
function assignValue(val, key) {
|
||||
if (typeof result[key] === 'object' && typeof val === 'object') {
|
||||
result[key] = deepMerge(result[key], val);
|
||||
} else if (typeof val === 'object') {
|
||||
result[key] = deepMerge({}, val);
|
||||
} else if (isPlainObject(val)) {
|
||||
result[key] = merge({}, val);
|
||||
} else if (isArray(val)) {
|
||||
result[key] = val.slice();
|
||||
} else {
|
||||
result[key] = val;
|
||||
}
|
||||
|
|
@ -1872,6 +1905,19 @@ function extend(a, b, thisArg) {
|
|||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
||||
*
|
||||
* @param {string} content with BOM
|
||||
* @return {string} content value without BOM
|
||||
*/
|
||||
function stripBOM(content) {
|
||||
if (content.charCodeAt(0) === 0xFEFF) {
|
||||
content = content.slice(1);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isArray: isArray,
|
||||
isArrayBuffer: isArrayBuffer,
|
||||
|
|
@ -1881,6 +1927,7 @@ module.exports = {
|
|||
isString: isString,
|
||||
isNumber: isNumber,
|
||||
isObject: isObject,
|
||||
isPlainObject: isPlainObject,
|
||||
isUndefined: isUndefined,
|
||||
isDate: isDate,
|
||||
isFile: isFile,
|
||||
|
|
@ -1891,9 +1938,9 @@ module.exports = {
|
|||
isStandardBrowserEnv: isStandardBrowserEnv,
|
||||
forEach: forEach,
|
||||
merge: merge,
|
||||
deepMerge: deepMerge,
|
||||
extend: extend,
|
||||
trim: trim
|
||||
trim: trim,
|
||||
stripBOM: stripBOM
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
12
public/canard/css/app.css
vendored
12
public/canard/css/app.css
vendored
|
|
@ -2408,6 +2408,16 @@ BODY.cartOpened {
|
|||
vertical-align: top;
|
||||
transition: all 0.2s linear;
|
||||
}
|
||||
.ds-button.ds-button--secondary {
|
||||
border: 0.0625rem solid #a8be36;
|
||||
background-color: #a8be36;
|
||||
color: black;
|
||||
}
|
||||
.ds-button.ds-button--tertiary {
|
||||
border: 0.0625rem solid #1a3441;
|
||||
background-color: white;
|
||||
color: #a8be36;
|
||||
}
|
||||
|
||||
.basket-panel__title-wrapper {
|
||||
display: flex;
|
||||
|
|
@ -2838,7 +2848,7 @@ svg:not(:root) {
|
|||
background-color: #a8be36;
|
||||
border: 1px solid #a8be36;
|
||||
color: #fff;
|
||||
border-radius: 25px;
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.375rem 1.5rem;
|
||||
display: inline-block;
|
||||
letter-spacing: 0.5px;
|
||||
|
|
|
|||
2141
public/canard/js/app.js
vendored
2141
public/canard/js/app.js
vendored
File diff suppressed because it is too large
Load diff
54
resources/views/front/canard/auth/login.blade.php
Normal file
54
resources/views/front/canard/auth/login.blade.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('title', __('Connexion'))
|
||||
|
||||
@section('content')
|
||||
<div class="hero-banner">
|
||||
<div class="hero-banner__wrapper wrapper">
|
||||
<img src="img/hero_login.jpg" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="login-page section">
|
||||
<h1 class="login-page__title title">Connexion</h1>
|
||||
|
||||
<div class="auth-form">
|
||||
<form action="{{ route('auth.login.post') }}" method="POST">
|
||||
@csrf
|
||||
@if ($errors->any())
|
||||
<div class="form__error">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<div class="form__field">
|
||||
<input class="form__input" type="text" name="email" placeholder="Email*" required />
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<input class="form__input" type="password" name="password" placeholder="Mot de passe*" required />
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<label class="custom-input custom-input_checkbox">
|
||||
<input type="checkbox" name="remember" />
|
||||
<span>Se souvenir de moi</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form__field form__submit">
|
||||
<button class="form__btn btn btn_blue">Connexion</button>
|
||||
</div>
|
||||
|
||||
<div class="form__links">
|
||||
<a href="{{ route('auth.reset-password') }}">J’ai oublié mon mot de passe</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="auth-form__links">
|
||||
<a href="{{ route('auth.register') }}">Pas encore de compte ?</a>
|
||||
<a class="btn btn_blue" href="{{ route('auth.register') }}">Inscrivez-vous</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
83
resources/views/front/canard/auth/register.blade.php
Normal file
83
resources/views/front/canard/auth/register.blade.php
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('title', __('Inscription'))
|
||||
|
||||
@section('content')
|
||||
<div class="hero-banner">
|
||||
<div class="hero-banner__wrapper wrapper">
|
||||
<img src="img/hero_login.jpg" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="login-page section">
|
||||
<h1 class="login-page__title title">Inscription</h1>
|
||||
|
||||
<div class="auth-form auth-form_register">
|
||||
@if (session('success'))
|
||||
<div class="form-message">
|
||||
<div class="form-message__title title">Félicitations</div>
|
||||
<div class="form-message__text">Votre compte a bien été créé !<br>Vous allez recevoir un mail de confirmation<br>sur l’adresse exemple@mail.fr</div>
|
||||
<a class="form-message__btn btn btn_blue" href="login.php">Connexion</a>
|
||||
</div>
|
||||
@else
|
||||
<form action="{{ route('auth.register.post') }}" method="POST" class="auth-form__form form">
|
||||
@csrf
|
||||
@if ($errors->any())
|
||||
<div class="form__error">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<input class="form__input" type="text" name="lastname" placeholder="Nom*" required />
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<input class="form__input" type="text" name="firstname" placeholder="Prénom*" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<input class="form__input" name="email" type="email" placeholder="Votre adresse email *" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<input class="form__input" type="email" name="email_confirm" placeholder="Confirmez votre email*" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<input class="form__input" type="date" name="date_of_birth" placeholder="Date de naissance*" required />
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<input class="form__input" type="password" name="password" placeholder="Mot de passe*" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form__field">
|
||||
<label class="custom-input custom-input_checkbox">
|
||||
<input type="checkbox" name="agree" />
|
||||
<span>J’ai lu et accepte les conditions générales et la politique de gestion des données personnelles.</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form__field form__submit">
|
||||
<button class="form__btn btn btn_blue">S’inscrire</button>
|
||||
</div>
|
||||
|
||||
<div class="form__text mb0">*Champs obligatoires</div>
|
||||
|
||||
</form>
|
||||
|
||||
<div class="auth-form__links-wrap">
|
||||
<div class="auth-form__links">
|
||||
<a href="{{ route('auth.login') }}">Déjà inscrit ?</a>
|
||||
<a class="btn btn_blue" href="{{ route('auth.login') }}">Connectez-vous</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Mot de passe oublié ?</h1>
|
||||
@endsection
|
||||
45
resources/views/front/canard/js/app.js
vendored
45
resources/views/front/canard/js/app.js
vendored
|
|
@ -4,20 +4,61 @@ require('./cart.js');
|
|||
|
||||
window.Vue = require('vue');
|
||||
|
||||
// Vuex
|
||||
import Vuex from 'vuex';
|
||||
|
||||
Vue.component('timeslot-picker', require('./components/TimeSlotPicker.vue').default);
|
||||
Vue.component('basket-panel', require('./components/BasketPanel.vue').default);
|
||||
Vue.component('basket-counter', {
|
||||
computed: {
|
||||
count() {
|
||||
return this.$store.state.cartTotals.countItems;
|
||||
// let panier;
|
||||
// panier = this.$store.state.panier;
|
||||
// console.log(this.$store.state.panier);
|
||||
// console.log(panier);
|
||||
// console.log(panier.length);
|
||||
// return panier[panier.length - 1].countItems;
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
console.log('Basket Counter Component mounted.');
|
||||
},
|
||||
template: '<span class="header-actions__item-icon icon icon_cart"><span class="icon__count">{{ count }}</span></span>'
|
||||
});
|
||||
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
panier: {},
|
||||
cartTotals: {},
|
||||
},
|
||||
mutations: {
|
||||
Reload (state,payload) {
|
||||
state.reload = payload.reload;
|
||||
},
|
||||
updatePanier (state, payload) {
|
||||
state.panier = payload.panier;
|
||||
},
|
||||
updateCartTotals (state, payload) {
|
||||
state.cartTotals = payload.cartTotals;
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
data: {
|
||||
num: 1 //for the numeric stepper on product pages
|
||||
},
|
||||
methods: {
|
||||
addtocart(product,qtty) {
|
||||
console.log('root add');
|
||||
this.$refs.basketpanel.addtocart(product,qtty);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
//document is ready we can free css transitions
|
||||
$('.preload').removeClass("preload");
|
||||
|
|
|
|||
|
|
@ -19,14 +19,14 @@
|
|||
<g transform="translate(9.000000, 28.000000)">
|
||||
<ellipse fill="#D1D0CF" fill-rule="nonzero" opacity="0.55" cx="66.8073257" cy="99.9229657" rx="31.9939371" ry="3.8088"></ellipse>
|
||||
<path d="M60.72498,75.7225057 C60.6153257,75.7225057 60.50484,75.7275286 60.3935143,75.7367343 C58.3419203,75.9150845 56.8088142,77.7000529 56.9421803,79.7550615 C57.0755464,81.8100701 58.8265029,83.381909 60.8839399,83.293591 C62.9413768,83.205273 64.5511943,81.4891687 64.5079668,79.4302908 C64.4647393,77.3714129 62.7843108,75.7243895 60.72498,75.7225057 Z" fill="#FEE2A2" fill-rule="nonzero"></path>
|
||||
<path d="M67.4825143,78.9167 C67.1623695,75.2609992 63.9936654,72.5223307 60.3301407,72.7349996 C56.666616,72.9476685 53.8360896,76.0345943 53.9410992,79.7027838 C54.0461088,83.3709734 57.0485945,86.290917 60.7182857,86.2936571 C60.9149914,86.2936571 61.1142171,86.2852829 61.3142657,86.2677029 C65.0455789,85.9373988 67.8051492,82.6486842 67.4825143,78.9167 L67.4825143,78.9167 Z M60.72498,75.7225057 C62.7822657,75.7244759 64.4609671,77.3699124 64.5041075,79.4267467 C64.5472479,81.483581 62.9390159,83.1979583 60.8836221,83.2861886 C58.8282283,83.3744189 57.0789994,81.8041647 56.9457217,79.7511997 C56.812444,77.6982346 58.3439652,75.9149954 60.3935143,75.7367343 C60.5048571,75.7275286 60.6153257,75.7225057 60.72498,75.7225057 L60.72498,75.7225057 Z" id="Shape" fill="#095BA5" fill-rule="nonzero"></path>
|
||||
<path d="M67.4825143,78.9167 C67.1623695,75.2609992 63.9936654,72.5223307 60.3301407,72.7349996 C56.666616,72.9476685 53.8360896,76.0345943 53.9410992,79.7027838 C54.0461088,83.3709734 57.0485945,86.290917 60.7182857,86.2936571 C60.9149914,86.2936571 61.1142171,86.2852829 61.3142657,86.2677029 C65.0455789,85.9373988 67.8051492,82.6486842 67.4825143,78.9167 L67.4825143,78.9167 Z M60.72498,75.7225057 C62.7822657,75.7244759 64.4609671,77.3699124 64.5041075,79.4267467 C64.5472479,81.483581 62.9390159,83.1979583 60.8836221,83.2861886 C58.8282283,83.3744189 57.0789994,81.8041647 56.9457217,79.7511997 C56.812444,77.6982346 58.3439652,75.9149954 60.3935143,75.7367343 C60.5048571,75.7275286 60.6153257,75.7225057 60.72498,75.7225057 L60.72498,75.7225057 Z" id="Shape" fill="#a8be36" fill-rule="nonzero"></path>
|
||||
<path d="M85.3670057,74.0174257 C85.2565114,74.0174257 85.1460171,74.0216171 85.03386,74.0316543 C82.9819563,74.2100227 81.4485421,75.9951432 81.5817019,78.0504759 C81.7148617,80.1058086 83.465797,81.6781444 85.5235628,81.5902577 C87.5813286,81.502371 89.1918241,79.7864694 89.1492531,77.7272676 C89.1066822,75.6680659 87.4266456,74.0201911 85.3670057,74.0174257 Z" fill="#FEE2A2" fill-rule="nonzero"></path>
|
||||
<path d="M92.1237,77.21162 C91.8041941,73.5554324 88.6354676,70.8159573 84.9714933,71.0282865 C81.307519,71.2406158 78.4764495,74.3277824 78.5814201,77.9964024 C78.6863908,81.6650224 81.6893508,84.5852592 85.3594714,84.5877371 C85.5561771,84.5877371 85.7553943,84.5793714 85.9554514,84.5617914 C89.6862934,84.2312527 92.4456064,80.9432167 92.1237,77.21162 L92.1237,77.21162 Z M85.3670057,74.0174257 C87.4240987,74.0202982 89.1019847,75.6661962 89.1444478,77.7228528 C89.1869109,79.7795095 87.5783904,81.4932608 85.5231691,81.5810388 C83.4679477,81.6688168 81.7191636,80.0984551 81.5861133,78.0456674 C81.453063,75.9928797 82.9845031,74.2099122 85.03386,74.0316543 C85.146,74.0216171 85.2565114,74.0174257 85.3670057,74.0174257 L85.3670057,74.0174257 Z" id="Shape" fill="#095BA5" fill-rule="nonzero"></path>
|
||||
<path d="M92.1237,77.21162 C91.8041941,73.5554324 88.6354676,70.8159573 84.9714933,71.0282865 C81.307519,71.2406158 78.4764495,74.3277824 78.5814201,77.9964024 C78.6863908,81.6650224 81.6893508,84.5852592 85.3594714,84.5877371 C85.5561771,84.5877371 85.7553943,84.5793714 85.9554514,84.5617914 C89.6862934,84.2312527 92.4456064,80.9432167 92.1237,77.21162 L92.1237,77.21162 Z M85.3670057,74.0174257 C87.4240987,74.0202982 89.1019847,75.6661962 89.1444478,77.7228528 C89.1869109,79.7795095 87.5783904,81.4932608 85.5231691,81.5810388 C83.4679477,81.6688168 81.7191636,80.0984551 81.5861133,78.0456674 C81.453063,75.9928797 82.9845031,74.2099122 85.03386,74.0316543 C85.146,74.0216171 85.2565114,74.0174257 85.3670057,74.0174257 L85.3670057,74.0174257 Z" id="Shape" fill="#a8be36" fill-rule="nonzero"></path>
|
||||
<path d="M67.9645714,7.97827143 L68.5451057,1.70578571 C68.5973175,1.14173888 68.9464786,0.648392791 69.4610634,0.411586133 C69.9756482,0.174779475 70.577479,0.230488817 71.039852,0.55772899 C71.502225,0.884969162 71.7548947,1.4340246 71.7026829,1.99807143 L71.1221314,8.27054857 C71.0735147,8.83570804 70.7266747,9.33183778 70.2125852,9.5715893 C69.6984957,9.81134082 69.0954891,9.75818287 68.6312728,9.43218895 C68.1670565,9.10619503 67.9123637,8.55703727 67.9633714,7.99208857 L67.96464,7.97832286 L67.9645714,7.97827143 Z" fill="#FFCCBD" fill-rule="nonzero"></path>
|
||||
<path d="M77.1094286,9.90088571 L80.0137371,4.31104571 C80.4184016,3.53584377 81.3742995,3.23463343 82.1502783,3.63780618 C82.9262571,4.04097894 83.2293053,4.99629581 82.8276257,5.77304857 L79.9233086,11.36288 C79.5193836,12.1395112 78.5624792,12.4418306 77.7856784,12.038232 C77.0088777,11.6346333 76.7061562,10.677856 77.1094286,9.90088571 Z" fill="#FFCCBD" fill-rule="nonzero"></path>
|
||||
<path d="M60.72294,10.45958 C60.3205914,10.5816972 59.8862111,10.53898 59.5153582,10.3408257 C59.1445053,10.1426714 58.8675584,9.80531194 58.7454429,9.40296286 L58.7453743,9.40272286 L56.9163857,3.37478 C56.6650774,2.53782893 57.1383473,1.65532818 57.9745681,1.40160026 C58.8107888,1.14787235 59.6946547,1.618588 59.9508,2.45407143 L61.7797886,8.48202286 C62.034079,9.31986789 61.5610158,10.2052189 60.7231714,10.4595114 L60.72294,10.45958 Z" fill="#FFCCBD" fill-rule="nonzero"></path>
|
||||
<path d="M54.5468057,13.72802 C54.2405639,14.0161422 53.8324087,14.1708093 53.4121299,14.1579963 C52.991851,14.1451832 52.5938758,13.9659396 52.3057543,13.6596971 L52.3055914,13.6595257 L47.9894743,9.07124 C47.3939486,8.43281183 47.4266116,7.4330694 48.0625396,6.83487461 C48.6984676,6.23667983 49.6983381,6.26515479 50.2991914,6.89857143 L54.6153086,11.4868571 C55.215283,12.1245712 55.18469,13.1279157 54.5469771,13.7278914 L54.5468057,13.72802 Z" fill="#FFCCBD" fill-rule="nonzero"></path>
|
||||
<path d="M102.496466,20.7774714 C101.176696,19.3739105 99.2874161,18.6511315 97.3678371,18.81542 L36.4152771,23.8871429 C34.0360432,24.0735451 31.8918619,25.3934501 30.6538371,27.4337429 C30.6421114,27.4521543 30.6312343,27.4706 30.6203486,27.4889857 L29.7774429,25.4336 L26.0985857,17.40584 C24.8631842,14.3865739 22.4304508,12.0152173 19.3806086,10.8573543 C19.2355106,9.29582331 18.1587245,7.97791436 16.6574657,7.52442286 L5.43926571,4.14396286 C3.39963316,3.52911608 1.24775249,4.68413316 0.632905714,6.72376571 C0.018058937,8.76339827 1.17307602,10.9152789 3.21270857,11.5301257 L14.4309,14.91056 C15.895449,15.3549549 17.4839357,14.8842165 18.4698943,13.7136286 C20.6902631,14.6144705 22.4502183,16.377494 23.3471914,18.5994286 L27.0260486,26.6271886 L29.92812,33.7078229 C29.9808514,33.8647714 30.0386057,34.0207429 30.1013829,34.1757371 L31.3787314,37.3105057 C31.4133271,37.3949714 31.455343,37.4762036 31.5042857,37.5532486 L42.5433429,64.4833914 C43.6104623,67.1123374 46.1664564,68.8304612 49.0037229,68.8260286 C49.2088029,68.8260286 49.4163857,68.8168143 49.6248171,68.7984029 L93.0561771,64.9990143 C96.2940927,64.7252758 98.9133024,62.2505026 99.3700714,59.0333 L104.150486,26.01572 C104.43193,24.1083549 103.822202,22.177356 102.496466,20.7774714 Z M64.1744657,64.5144629 L54.8674886,25.36238 L80.1663857,23.2572371 L77.8059,63.3219629 L64.1744657,64.5144629 Z M49.3636371,65.81012 C47.6203783,65.9657102 45.979622,64.9656964 45.3189943,63.3449771 L32.7514886,32.6891429 C32.3456441,31.3885638 32.5522698,29.9740603 33.3131857,28.8439176 C34.0741015,27.7137748 35.3069939,26.9902482 36.6647143,26.8770629 L51.8443714,25.6139514 L61.1544943,64.7786429 L49.3636371,65.81012 Z M101.182286,25.5855114 L96.4010314,58.6030829 C96.1399459,60.4404711 94.6442385,61.8539057 92.7950314,62.0107314 L80.8268571,63.0577143 L83.1865114,23.0058971 L97.6189886,21.8049371 C98.6271159,21.7196868 99.6190517,22.0990713 100.312986,22.8353072 C101.006921,23.5715431 101.327014,24.584168 101.182329,25.5854943 L101.182286,25.5855114 Z" fill="#095BA5" fill-rule="nonzero"></path>
|
||||
<path d="M102.496466,20.7774714 C101.176696,19.3739105 99.2874161,18.6511315 97.3678371,18.81542 L36.4152771,23.8871429 C34.0360432,24.0735451 31.8918619,25.3934501 30.6538371,27.4337429 C30.6421114,27.4521543 30.6312343,27.4706 30.6203486,27.4889857 L29.7774429,25.4336 L26.0985857,17.40584 C24.8631842,14.3865739 22.4304508,12.0152173 19.3806086,10.8573543 C19.2355106,9.29582331 18.1587245,7.97791436 16.6574657,7.52442286 L5.43926571,4.14396286 C3.39963316,3.52911608 1.24775249,4.68413316 0.632905714,6.72376571 C0.018058937,8.76339827 1.17307602,10.9152789 3.21270857,11.5301257 L14.4309,14.91056 C15.895449,15.3549549 17.4839357,14.8842165 18.4698943,13.7136286 C20.6902631,14.6144705 22.4502183,16.377494 23.3471914,18.5994286 L27.0260486,26.6271886 L29.92812,33.7078229 C29.9808514,33.8647714 30.0386057,34.0207429 30.1013829,34.1757371 L31.3787314,37.3105057 C31.4133271,37.3949714 31.455343,37.4762036 31.5042857,37.5532486 L42.5433429,64.4833914 C43.6104623,67.1123374 46.1664564,68.8304612 49.0037229,68.8260286 C49.2088029,68.8260286 49.4163857,68.8168143 49.6248171,68.7984029 L93.0561771,64.9990143 C96.2940927,64.7252758 98.9133024,62.2505026 99.3700714,59.0333 L104.150486,26.01572 C104.43193,24.1083549 103.822202,22.177356 102.496466,20.7774714 Z M64.1744657,64.5144629 L54.8674886,25.36238 L80.1663857,23.2572371 L77.8059,63.3219629 L64.1744657,64.5144629 Z M49.3636371,65.81012 C47.6203783,65.9657102 45.979622,64.9656964 45.3189943,63.3449771 L32.7514886,32.6891429 C32.3456441,31.3885638 32.5522698,29.9740603 33.3131857,28.8439176 C34.0741015,27.7137748 35.3069939,26.9902482 36.6647143,26.8770629 L51.8443714,25.6139514 L61.1544943,64.7786429 L49.3636371,65.81012 Z M101.182286,25.5855114 L96.4010314,58.6030829 C96.1399459,60.4404711 94.6442385,61.8539057 92.7950314,62.0107314 L80.8268571,63.0577143 L83.1865114,23.0058971 L97.6189886,21.8049371 C98.6271159,21.7196868 99.6190517,22.0990713 100.312986,22.8353072 C101.006921,23.5715431 101.327014,24.584168 101.182329,25.5854943 L101.182286,25.5855114 Z" fill="#a8be36" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
</g>
|
||||
</svg>
|
||||
<h2 class="title">Votre panier est vide...</h2>
|
||||
<div class="cart-item__text">
|
||||
<!--<div class="cart-item__text">
|
||||
Besoin d’idées pour commencer ?
|
||||
</div>
|
||||
<button class="btn btn_blue">Voir mes achats fréquents</button>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<button class="btn btn_white">
|
||||
<span class="">voir les promotions</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- panier en avec produits -->
|
||||
|
|
@ -72,9 +72,9 @@
|
|||
|
||||
</a>
|
||||
<div class="message-box__actions">
|
||||
<div><a href="/mon-compte/login">
|
||||
<div><a href="/se-connecter">
|
||||
Me connecter
|
||||
</a> <a href="/mon-compte/inscription">
|
||||
</a> <a href="/inscription">
|
||||
Créer mon compte
|
||||
</a></div>
|
||||
</div>
|
||||
|
|
@ -116,14 +116,14 @@
|
|||
<div class="basket-products-list__inner">
|
||||
<div class="basket-products-list--first">
|
||||
<div class="category-heading basket-products-list__category" id="boissons">
|
||||
<!-- gamme -->
|
||||
<!-- gamme
|
||||
<div class="category-heading__header category-heading__header--collapsable">
|
||||
<h2 class="category-heading__title title title_xs">
|
||||
Boissons <!-- label de la gamme -->
|
||||
Boissons
|
||||
</h2>
|
||||
<div class="category-heading__left-content">
|
||||
<div class="ds-badge category-heading__badge" data-testid="category-quantity-badge">
|
||||
1 <!-- qté dans la gamme -->
|
||||
1
|
||||
</div> <span class="ds-chevron category-heading__chevron ds-chevron--s"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -134,7 +134,7 @@
|
|||
<li class="basket-products-list__product-card basket-products-list__product-card--no-margin" v-for="item in panier">
|
||||
<article class="ds-product-card--largehorizontal ds-product-card" id="3560070820542">
|
||||
<div class="ds-product-card--largehorizontal-icons">
|
||||
<div title="Supprimer" class="product-card-delete"></div>
|
||||
<div title="Supprimer" class="product-card-delete" @click="removeItem(item.cartItem.rowId)"></div>
|
||||
</div>
|
||||
|
||||
<div class="ds-product-card--largehorizontal-highlightlabel">
|
||||
|
|
@ -163,8 +163,8 @@
|
|||
<picture class="product-badge__icon"><img src="/images/badges/flag-common-organic.svg" alt="Produit Bio" importance="low" class="image product-badge__icon__img"></picture> <span class="product-badge__title">Produit Bio</span>
|
||||
</a></li>
|
||||
</ul>-->
|
||||
<div class="ds-format ds-product-card__shimzone--small">
|
||||
{{ item.cartItem.weight }}
|
||||
<div class="ds-format ds-product-card__shimzone--small" v-show="item.cartItem.weight">
|
||||
{{ item.cartItem.weight }} {{ item.product.weight_unit }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -264,6 +264,69 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="products-brief">
|
||||
<section class="products-brief__top-section">
|
||||
</section>
|
||||
<div class="">
|
||||
<section class="products-brief__box">
|
||||
<dl class="products-brief-data products-brief--items">
|
||||
<dt>
|
||||
<div class="ds-body-text ds-body-text--size-m">Total produits</div>
|
||||
</dt>
|
||||
<dd>
|
||||
<div class="ds-body-text ds-body-text--weight-bold ds-body-text--size-m">
|
||||
{{cartTotals.totalTTC}} €
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="products-brief__slot">
|
||||
<div class="checkout-clear-basket basket-panel__clear-basket">
|
||||
<div id="data-clear-basket" class="checkout-clear-basket__actions">
|
||||
<button class="pl-button checkout-clear-basket__cta pl-button--tertiary pl-button--small" @click="confirmEmpty()">
|
||||
<span class="pl-button__label">
|
||||
<svg aria-hidden="true" class="checkout-clear-basket__icon svg-icon svg-icon--m svg-icon--color-interactive-1">
|
||||
<use xlink:href="#i13"></use>
|
||||
</svg>
|
||||
Vider le panier
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div id="empty-basket-modal" class="checkout-clear-basket__modal">
|
||||
<div class="modal" v-show="showConfirmEmpty">
|
||||
<div class="modal__container">
|
||||
<div class="modal__body">
|
||||
<div class="checkout-clear-basket__modal__title">
|
||||
Voulez-vous réellement vider votre panier ?
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal__action">
|
||||
<div><button class="ds-button" id="checkout-empty-basket-confirm">
|
||||
<span class="ds-button__label" @click="emptyCart()">
|
||||
Oui, vider mon panier
|
||||
</span>
|
||||
</button>
|
||||
<button class="ds-button ds-button--tertiary" id="checkout-empty-basket-cancel">
|
||||
<span class="ds-button__label">Annuler</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="checkout-loyalty-info" loyalties-desactivated="true" style="display: none;">
|
||||
<div class="checkout-loyalty-info__loyalty">
|
||||
<section class="checkout-loyalty-info__top-section">
|
||||
<h3 class="ds-title ds-title--bold ds-title--xs">
|
||||
Avantages fidélité
|
||||
</h3>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- fin profuits-->
|
||||
<div class="cart-tile__bottom cart-tile__bottom--fixed">
|
||||
|
|
@ -272,7 +335,7 @@
|
|||
Total
|
||||
</h2>
|
||||
<h2 class="ds-title ds-title--bold ds-title--m ds-title--bright">
|
||||
50,64€
|
||||
{{cartTotals.totalTTC}} €
|
||||
</h2>
|
||||
</div>
|
||||
<button class="pl-button pl-button--primary pl-button--light">
|
||||
|
|
@ -304,20 +367,22 @@
|
|||
<script>
|
||||
export default {
|
||||
props: [
|
||||
'dbpanier',
|
||||
|
||||
],
|
||||
computed: {
|
||||
emptybasket() { return _.isEmpty(this.panier); }
|
||||
emptybasket() { return _.isEmpty(this.$store.state.panier); },
|
||||
panier() { return this.$store.state.panier; },
|
||||
cartTotals() { return this.$store.state.cartTotals; }
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
panier: {},
|
||||
processing: false,
|
||||
success:false,
|
||||
errors:false,
|
||||
showConfirmEmpty:false,
|
||||
response: '',
|
||||
}
|
||||
},
|
||||
|
|
@ -327,38 +392,35 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.panier = JSON.parse(this.dbpanier);
|
||||
axios.post('/ajax/get-cart')
|
||||
.then(response => {
|
||||
let result = response.data;
|
||||
this.updateStore(result);
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
addtocart(product_id,qtty) {
|
||||
let current;
|
||||
let breaker=false;
|
||||
this.panier.forEach(element => {
|
||||
if(element.cartItem.id == product_id) {
|
||||
current = element;
|
||||
element.cartItem.qty +=qtty;
|
||||
}
|
||||
if(element.cartItem.qty == 0) {
|
||||
this.removeItem(element.cartItem.rowId);
|
||||
breaker=true;
|
||||
}
|
||||
});
|
||||
current.cartItem.qty +=qtty;
|
||||
|
||||
axios.post('/ajax/add-to-cart', {
|
||||
|
||||
if(!breaker) {
|
||||
axios.post('/ajax/add-to-cart', {
|
||||
id: product_id,
|
||||
qty: qtty,
|
||||
}).then(
|
||||
(response) => {
|
||||
// let result = response.data;
|
||||
// switch (result) {
|
||||
// case 0: case 2:
|
||||
// // 0 = Supprimé, 2 = Pas encore en base, supprimer juste dans la vue
|
||||
// this.response = "Suppression terminée !";
|
||||
// this.myobjectives.splice(index, 1);
|
||||
// this.processing = false;
|
||||
// break;
|
||||
// case 3:
|
||||
// // 1 = Non supprimer car pa autorisé
|
||||
// this.response = "Erreur : Suppression impossible";
|
||||
// setTimeout(function() {
|
||||
// this.processing = false;
|
||||
// }.bind(this), 1500);
|
||||
// break;
|
||||
// }
|
||||
let result = response.data;
|
||||
this.updateStore(result);
|
||||
}
|
||||
)
|
||||
.catch(function (error) {
|
||||
|
|
@ -366,6 +428,54 @@ export default {
|
|||
this.response = "Erreur lors de la modification du panier.";
|
||||
this.processing = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
removeItem(rowId) {
|
||||
axios.post('/ajax/remove-from-cart', {
|
||||
rowId: rowId,
|
||||
}).then(
|
||||
(response) => {
|
||||
let result = response.data;
|
||||
this.updateStore(result);
|
||||
}
|
||||
)
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
this.response = "Erreur lors de la modification du panier.";
|
||||
this.processing = false;
|
||||
});
|
||||
},
|
||||
emptyCart() {
|
||||
//masquer la modale
|
||||
this.showConfirmEmpty = false;
|
||||
axios.post('/ajax/empty-cart', {
|
||||
}).then(
|
||||
(response) => {
|
||||
let result = response.data;
|
||||
this.updateStore(result);
|
||||
}
|
||||
)
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
this.response = "Erreur lors de la modification du panier.";
|
||||
this.processing = false;
|
||||
});
|
||||
},
|
||||
confirmEmpty() {
|
||||
//afficher la modale
|
||||
this.showConfirmEmpty = true;
|
||||
},
|
||||
updateStore(result) {
|
||||
if (result[0].length != this.panier.length) {
|
||||
this.$store.commit({
|
||||
type: 'updatePanier',
|
||||
panier: result[0]
|
||||
});
|
||||
}
|
||||
this.$store.commit({
|
||||
type: 'updateCartTotals',
|
||||
cartTotals: result[1]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
{{-- Fin du footer --}}
|
||||
{{-- Cart Panel
|
||||
@yield('cart-panel', view('partials.cart-panel')) --}}
|
||||
<basket-panel dbpanier='@json($dbpanier)' ref="basketpanel" prodroute="{{route('product','')}}"></basket-panel>
|
||||
<basket-panel ref="basketpanel"></basket-panel>
|
||||
{{-- Fin Cart Panel --}}
|
||||
|
||||
</div><!-- page-wrap END -->
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<div class="header__block header__block_right">
|
||||
<ul class="header-actions">
|
||||
<li class="header-actions__item" onclick="openCart()">
|
||||
<span class="header-actions__item-icon icon icon_cart"><span class="icon__count">1</span></span>
|
||||
<basket-counter></basket-counter>
|
||||
<span class="header-actions__item-title">Mon panier</span>
|
||||
</li>
|
||||
<li class="header-actions__item">
|
||||
|
|
|
|||
|
|
@ -42,14 +42,14 @@
|
|||
|
||||
@foreach ($products as $product)
|
||||
<div class="product-list__block">
|
||||
<xform class="pl-item">
|
||||
<div class="pl-item">
|
||||
<a class="pl-item__title title title_xs" href="{{route('product', ['productSlug' => $product->slug])}}">{{ $product->name }}</a>
|
||||
<a class="pl-item__image" href="{{route('product', ['productSlug' => $product->slug])}}"><img src="{{ asset('/images/produits/' . $product->picture )}}" /></a>
|
||||
<div class="pl-item__bottom">
|
||||
<div class="pl-item__price">{{ $product->formattedPrice }}/pièce</div>
|
||||
<button class="pl-item__btn btn btn_blue" @click="addtocart({{ $product->id }},3)"></button>
|
||||
<div class="pl-item__price">{{ $product->formattedPrice }}/{{ $product->sell_unit }}</div>
|
||||
<button class="pl-item__btn btn btn_blue" @click="addtocart({{ $product->id }},1)"></button>
|
||||
</div>
|
||||
</xform>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@
|
|||
<div class="product__trade">
|
||||
<div class="product__price title title_small mb0">{{ $product->formattedPrice }}/pièce</div>
|
||||
<div class="product__qty">
|
||||
<span class="product__qty-btn product__qty-btn_minus">-</span>
|
||||
<input class="product__qty-input form__input" type="text" value="1"></input>
|
||||
<span class="product__qty-btn product__qty-btn_plus">+</span>
|
||||
<span class="product__qty-btn product__qty-btn_minus" @click="num--">-</span>
|
||||
<input class="product__qty-input form__input" type="text" value="1" name="product_qty" id="product_qty" v-model="num">
|
||||
<span class="product__qty-btn product__qty-btn_plus" @click="num++">+</span>
|
||||
</div>
|
||||
<div class="product__btn-wrap">
|
||||
<button class="product__add2cart btn" @click="addtocart({{ $product->id }},3)">ajouter au panier</button>
|
||||
<button class="product__add2cart btn" @click="addtocart({{ $product->id }},num)">ajouter au panier</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
14
resources/views/front/canard/sass/cart.scss
vendored
14
resources/views/front/canard/sass/cart.scss
vendored
|
|
@ -231,6 +231,18 @@ BODY.cartOpened {
|
|||
justify-content: center;
|
||||
vertical-align: top;
|
||||
transition: all .2s linear;
|
||||
|
||||
&.ds-button--secondary {
|
||||
border: .0625rem solid $green;
|
||||
background-color: $green;
|
||||
color: black;
|
||||
}
|
||||
|
||||
&.ds-button--tertiary {
|
||||
border: .0625rem solid $blue;
|
||||
background-color: white;
|
||||
color: $green;
|
||||
}
|
||||
}
|
||||
|
||||
.basket-panel__title-wrapper {
|
||||
|
|
@ -661,7 +673,7 @@ svg:not(:root) {
|
|||
background-color: $green;
|
||||
border: 1px solid $green;
|
||||
color: #fff;
|
||||
border-radius: 25px;
|
||||
border-radius: 0.25rem;
|
||||
padding: .375rem 1.5rem;
|
||||
display: inline-block;
|
||||
letter-spacing: .5px;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,16 @@ Breadcrumbs::for('terms', function ($trail) {
|
|||
$trail->parent('home');
|
||||
$trail->push(__('Conditions générales de vente'), route('terms'));
|
||||
});
|
||||
//auth
|
||||
Breadcrumbs::for('auth.login', function ($trail) {
|
||||
$trail->parent('home');
|
||||
$trail->push(__('Connexion'), route('auth.login'));
|
||||
});
|
||||
Breadcrumbs::for('auth.register', function ($trail) {
|
||||
$trail->parent('home');
|
||||
$trail->push(__('Inscription'), route('auth.register'));
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('ranges', function ($trail) {
|
||||
$trail->parent('home');
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ Route::prefix('ajax')
|
|||
->name('ajx.')
|
||||
->group(function () {
|
||||
Route::post('/add-to-cart', [BasketController::class, 'addToCart'])->name('cart.add');
|
||||
Route::post('/get-cart', [BasketController::class, 'getCart'])->name('cart.get');
|
||||
Route::post('/remove-from-cart', [BasketController::class, 'removeFromCart'])->name('cart.remove');
|
||||
Route::post('/empty-cart', [BasketController::class, 'emptyCart'])->name('cart.empty');
|
||||
});
|
||||
|
||||
Route::namespace('Bo')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue