Answer the question
In order to leave comments, you need to log in
Can't find the selected size?
pug:
each size in product.sizes
input(style="width:1px; height:1px; position:absolute;" type="checkbox" name="size")
label.product__block-size(for="size")= size
router.post('/add', auth, async(req, res) => {
try {
const product = await Product.findById(
req.body.id, req.body.title, req.body.nowPrice, req.body.mainSize,
req.body.article, req.body.sex, req.body.size
);
console.log(req.body.size);
await req.user.addToCart(product);
res.redirect('/cart');
} catch (e) {
console.log(e);
}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question