Merge branch 'master' of https://github.com/mrvautin/expressCart
commit
a03f1ef6e7
|
@ -10,6 +10,7 @@ const async = require('async');
|
||||||
const nodemailer = require('nodemailer');
|
const nodemailer = require('nodemailer');
|
||||||
const sanitizeHtml = require('sanitize-html');
|
const sanitizeHtml = require('sanitize-html');
|
||||||
const escape = require('html-entities').AllHtmlEntities;
|
const escape = require('html-entities').AllHtmlEntities;
|
||||||
|
const mkdirp = require('mkdirp');
|
||||||
let ObjectId = require('mongodb').ObjectID;
|
let ObjectId = require('mongodb').ObjectID;
|
||||||
|
|
||||||
const restrictedRoutes = [
|
const restrictedRoutes = [
|
||||||
|
@ -177,7 +178,12 @@ exports.checkDirectorySync = (directory) => {
|
||||||
try{
|
try{
|
||||||
fs.statSync(directory);
|
fs.statSync(directory);
|
||||||
}catch(e){
|
}catch(e){
|
||||||
|
try{
|
||||||
fs.mkdirSync(directory);
|
fs.mkdirSync(directory);
|
||||||
|
}
|
||||||
|
catch(err){
|
||||||
|
mkdirp.sync(directory);//error : directory & sub directories to be newly created
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -142,6 +142,12 @@ $(document).ready(function (){
|
||||||
cartUpdate(qtyElement);
|
cartUpdate(qtyElement);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on('change', '.cart-product-quantity', function (e) {
|
||||||
|
|
||||||
|
cartUpdate(e.target);
|
||||||
|
});
|
||||||
|
|
||||||
$(document).on('click', '.btn-delete-from-cart', function(e){
|
$(document).on('click', '.btn-delete-from-cart', function(e){
|
||||||
deleteFromCart($(e.target));
|
deleteFromCart($(e.target));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue