Passing proper config and params on product not found

react_convert
Mark Moffat 2018-02-07 20:51:30 +01:00
parent d6bff8496b
commit 7037e18017
1 changed files with 2 additions and 2 deletions

View File

@ -103,10 +103,10 @@ router.get('/product/:id', (req, res) => {
db.products.findOne({$or: [{_id: common.getId(req.params.id)}, {productPermalink: req.params.id}]}, (err, result) => {
// render 404 if page is not published
if(err){
res.render('error', {message: 'Product not found', helpers: req.handlebars.helpers});
res.render('error', {title: 'Not found', message: 'Product not found', helpers: req.handlebars.helpers, config});
}
if(err || result == null || result.productPublished === 'false'){
res.render('error', {message: 'Product not found', helpers: req.handlebars.helpers});
res.render('error', {title: 'Not found', message: 'Product not found', helpers: req.handlebars.helpers, config});
}else{
let productOptions = {};
if(result.productOptions){