Passing proper config and params on product not found
							parent
							
								
									d6bff8496b
								
							
						
					
					
						commit
						7037e18017
					
				|  | @ -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){ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue