How to show view pdf in cart page with which all items have personalized and not to shown which item does not have personailized

//This view is extended to display pdf when there is 5 or more options in cart item
                _.extend(CartItemActionsView.prototype, {
                    getContext: _.wrap(CartItemActionsView.prototype.getContext, function (fn) {
                     var originalRet = fn.apply(this, _.toArray(arguments).slice(1));
                     var options = originalRet.line.attributes.options.models;
                     var havepersonalization = _.filter(options, function (list) {
                        return list.get("cartOptionId") == "custcol_ag_havepersonalization";
                    });

                    var personalisationValue = havepersonalization.map(function (a) {
                      return a.get("value").internalid;
                    });
                    var displayViewPdf;
                    if (personalisationValue[0] == "T") {
                        displayViewPdf = true;
                    } else {
                        displayViewPdf = false;
                    }
                    originalRet.displaypdf = displayViewPdf;
                    return originalRet;
                  }),
                });

Leave a comment

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