Showing posts with label Update Product. Show all posts
Showing posts with label Update Product. Show all posts

Saturday, 23 November 2019

How to add/update multiple products in cart in shopify

jQuery(function () {
   
jQuery('body').find(".couponproduct .gf_add-to-cart").click(function (e) {
e.preventDefault();
values = {}
                values[30370850865245] = 0;
                values[31289364840541] = 1;
                jQuery.ajax({
                      type: 'POST',
                      url: '/cart/update.js',
                      data: { updates: values},
                      dataType: 'json',
                      success: function() {
                        location.href = '/checkout';
                     }
               });
});
   
});

Monday, 25 June 2018

Product image roles randomly disappear when update product through the Rest API

I think its issue on Magento 2.2.3 or below version

Open root/app/code/Magento/Catalog/Model/ProductRepository.php

protected function processMediaGallery(ProductInterface $product, $mediaGalleryEntries)
{

find : if (isset($entry['value_id']) // near line no : 499 TO
if (isset($entry['value_id']) && $entry['value_id'] != '') {

}