when we remove the item from save later then the Shopping Cart Not Scrolling in mobile

when we remove the item from save later then the Shopping Cart Not Scrolling in mobile

In some cases, mobile users encounter an issue where their Cart ceases to scroll after removing an item from the Saved for Later product list. This issue can occur in the following scenario:

  • The user adds more than one item to their Cart.
  • The user adds items to their Saved for Later product list.
  • The user later removes an item from the Saved for Later product list and returns to their Cart.
  • The user can no longer scroll their Cart.

If you experience this issue on your SCA site, perform the following steps to correct. Best practices require customizing the existing source code using the .extend method, as detailed below.Note: 

Step 1: Extend the ProductList.DetailsLater.View.js File

  1. To extend the ProductList.DetailsLater.View.js file, which is located in the ProductList module, create a directory to store your custom module.
  2. Open this directory and create a subdirectory to maintain your customizations.Give this directory a name similar to the module being customized. For example:Modules/extensions/ProductListExtension@1.0.0
  3. In your new ProductListExtension@1.0.0 module, create a subdirectory called JavaScript.Modules/extensions/ProductListExtension@1.0.0/JavaScript
  4. In your new JavaScript subdirectory, create a JavaScript file to extend ProductList.DetailsLater.View.js.Name this file according to best practices. For example:ProductList.DetailsLater.View.Extension.js
  5. Open this file and extend the deleteListItemHandler method to include the following line:
 self.$('[data-action="pushable"]').scPush(); 
then add this code in the js file 


  define('ProductList.DetailsLater.View.Extension'
 ,   [
       'ProductList.DetailsLater.View'
    ,   'underscore'
    ,   'jQuery'   
    ]
 ,   function (
       ProductListDetailsLaterView
    ,   _
    ,   jQuery
    )
 {
    'use strict';
 
      _.extend(ProductListDetailsLaterView.prototype,
       {
          deleteListItemHandler: function (target)
          {
             var self = this
             ,   itemid = jQuery(target).closest('article').data('id')
             ,   product_list_item = this.model.get('items').findWhere({
                   internalid: itemid + ''
                })
             ,   success = function ()
             {
                if (self.application.getLayout().updateMenuItemsUI)
                {
                   self.application.getLayout().updateMenuItemsUI();
                }
 
               self.deleteConfirmationView.$containerModal.modal('hide');
                self.render();
                self.$('[data-action="pushable"]').scPush();
                self.showConfirmationMessage(_('The item was removed from your product list').translate(), true);
             };
 
            self.model.get('items').remove(product_list_item);      
             self.deleteListItem(product_list_item, success);
          }
       });
 }
 );
and check for result

Leave a comment

Your email address will not be published. Required fields are marked *