From 0b51c9bdc87bc1a8f6c859858e853fd47bb0a87c Mon Sep 17 00:00:00 2001 From: Daniel Schmitzer Date: Wed, 5 Sep 2018 09:06:46 +0000 Subject: - Warenkorbwidget aktualisiert sich automatisch git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7136 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/js/frontend.js | 25 +++++++++++++++++++++++++ views/produkttemplates/standard.phtml | 2 ++ 2 files changed, 27 insertions(+) diff --git a/views/js/frontend.js b/views/js/frontend.js index 67b69f5..487007a 100644 --- a/views/js/frontend.js +++ b/views/js/frontend.js @@ -16,6 +16,31 @@ } // wpsg_mod_basketteaser_add(produkt_id) + /** + * Aktualisiert ein eventuell eingebundenes Warenkorbwidget + */ + function wpsg_refreshBasketWidget() + { + + if (jQuery('.wpsg_basket_widget').length <= 0) return; + + jQuery('.wpsg_basket_widget').html('' + wpsg_ajax.label_pleasewait + ''); + + jQuery.ajax( { + url: wpsg_ajax.url_basket, + data: { + 'wpsg[ajax]': 1, + 'wpsg[action]': 'widget' + }, + success: function(data) { + + jQuery('.wpsg_basket_widget').html(data); + + } + } ); + + } // function wpsg_refreshBasketWidget() + function wpsg_customerquestion(url_redirect) { diff --git a/views/produkttemplates/standard.phtml b/views/produkttemplates/standard.phtml index 3d63b63..0da35d4 100644 --- a/views/produkttemplates/standard.phtml +++ b/views/produkttemplates/standard.phtml @@ -310,6 +310,8 @@ success: function(data) { + wpsg_refreshBasketWidget(); + get_option('wpsg_afterinsert') == '2') { ?> tb_show('', 'getURL(wpsg_ShopController::URL_BASKET_AJAX); ?>&height=500'); -- cgit v1.2.3