Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var data = "product=271317&selected_configurable_option=&related_product=&form_key=s5piFgV5L9gg3MTo&super_attribute%5B93%5D=29&super_attribute%5B158%5D=43&qty=1";
- var url = "https://www.crazyline.com/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuY3JhenlsaW5lLmNvbS9tMTYzODg3MTA,/product/271317/";
- fetch(url, {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
- },
- body: data
- }).then(function() {
- require(['Magento_Customer/js/customer-data'], function(customerData) {
- var sections = ['cart'];
- customerData.invalidate(sections);
- customerData.reload(sections, true);
- document.location.reload();
- });
- }).catch(function(err) {
- console.log(err)
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement