1/** 2 * Prestashop module : OpartDevis 3 * 4 * @author Olivier CLEMENCE <[email protected]> 5 * @copyright Op'art 6 * @license Tous droits réservés / Le droit d'auteur s'applique (All rights reserved / French copyright law applies) 7 */ 8 9$(document).ready(function () { 10 // Update "Order" button on payment page 11 var payment_button = $("#payment-confirmation button").html(); 12 13 $("#checkout-payment-step input").click(function (e) { 14 setTimeout(function() { 15 if ($("#opart-devis-payment").parent().css('display') == "block"){ 16 $("#payment-confirmation button").html(order_button_content); 17 } else { 18 $("#payment-confirmation button").html(payment_button); 19 } 20 }, 100); 21 }); 22 23 // Override ps_shopping_cart JS modal 24 prestashop.blockcart = prestashop.blockcart || {}; 25 26 // save classic modal 27 var blockCartModal = prestashop.blockcart.showModal; 28 29 // custom function for opartdevis-modal 30 prestashop.blockcart.showModal = function opartShowModal(modalHTML) { 31 var $body = $('body'); 32 33 $body.append(modalHTML); 34 35 var $modal = $('#opartdevis-modal'); 36 var $backDrop = $('.modal-backdrop'); 37 38 $backDrop.fadeTo('200', .4); 39 $modal.fadeIn(); 40 41 $body.one('click', '#opartdevis-modal', function (event) { 42 $modal.remove(); 43 $backDrop.remove(); 44 }); 45 }; 46 47 prestashop.on( 48 'updateCart', 49 function (event) { 50 // if freezed cart, display custom modal 51 if (event.resp) { 52 if (event.resp.hasError && event.resp.modal) { 53 prestashop.blockcart.showModal(event.resp.modal); 54 55 return; 56 } 57 } 58 59 var refreshURL = $('.blockcart').data('refresh-url'); 60 var requestData = {}; 61 62 if (event && event.reason) { 63 requestData = { 64 id_product_attribute: event.reason.idProductAttribute, 65 id_product: event.reason.idProduct, 66 action: event.reason.linkAction 67 }; 68 } 69 70 $.post(refreshURL, requestData).then(function (resp) { 71 $('.blockcart').replaceWith($(resp.preview).find('.blockcart')); 72 if (resp.modal) { 73 blockCartModal(resp.modal); 74 } 75 }).fail(function (resp) { 76 prestashop.emit('handleError', {eventType: 'updateShoppingCart', resp: resp}); 77 }); 78 } 79 ); 80});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.