Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const productData = {
- 'form_type': 'product',
- 'utf8': '✓',
- 'id': '43915159568629',
- 'Color': 'BLACK',
- 'Size': '6',
- 'quantity': '1',
- 'product-id': '8066621210869'
- };
- const requestBody = new FormData();
- for(key in productData) {
- requestBody.append(key, productData[key]);
- }
- fetch("https://ruumur.com/cart/add", {
- "body": requestBody,
- "method": "POST",
- "mode": "cors",
- "credentials": "include"
- }).then(response => {
- console.log(response.status)
- }).then(() => {
- window.location.reload();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement