summaryrefslogtreecommitdiff
path: root/views/mods/mod_amazon/basket_inner_prebutton.phtml
diff options
context:
space:
mode:
authordaniel <noreply@maennchen1.de>2026-09-30 13:12:16 +0200
committerdaniel <noreply@maennchen1.de>2026-09-30 13:12:37 +0200
commitea77830018e15ab662fb0cfb2958857e3b3de532 (patch)
tree9634013e7a45c0f9da6891dd6bf0541801f6e3a2 /views/mods/mod_amazon/basket_inner_prebutton.phtml
parentee163b01c6bdf3da7c2a8f3ee1be25b02cb760b4 (diff)
- Amazon Modul vereinheitlicht und moderniesiert
Diffstat (limited to 'views/mods/mod_amazon/basket_inner_prebutton.phtml')
-rw-r--r--views/mods/mod_amazon/basket_inner_prebutton.phtml145
1 files changed, 11 insertions, 134 deletions
diff --git a/views/mods/mod_amazon/basket_inner_prebutton.phtml b/views/mods/mod_amazon/basket_inner_prebutton.phtml
index 5a1afcf..6b01b78 100644
--- a/views/mods/mod_amazon/basket_inner_prebutton.phtml
+++ b/views/mods/mod_amazon/basket_inner_prebutton.phtml
@@ -1,139 +1,16 @@
<?php
- /**
- * Template für die Integration von "Bezahlen mit Amazon" in den Warenkorb
- */
+ /**
+ * Button "Amazon Pay" im Warenkorb
+ *
+ * Den Button zeichnet checkout.js von Amazon in das Element #AmazonPayButton, die Konfiguration bindet
+ * wpsg_mod_amazon::basket_inner_prebutton() ein.
+ */
-?>
-
-<div id="LoginWithAmazon"></div>
-
-<div class="wpsg_amazonhandler" id="addressBookWidgetDiv"></div>
-<div class="wpsg_amazonhandler" id="walletWidgetDiv"></div>
-
-<style type="text/css">
-
- #addressBookWidgetDiv{ width:auto; height:228px; margin:15px 0; }
- #walletWidgetDiv { width:100%; height:228px; margin:15px 0; }
- #walletWidgetDiv iframe,
- #addressBookWidgetDiv iframe { max-width:100%; border:0px !important; }
- #LoginWithAmazon { float:right; }
- .wpsg_mod_paypalapi_button_wrap { float:left; }
-
-</style>
-
-<input type="hidden" name="amazon[OrderReference]" id="wpsg_mod_amazon_OrderReference" value="" />
-
-<div class="wpsg_clear"></div>
-
-<script>
-
- var authRequest;
-
- OffAmazonPayments.Button('LoginWithAmazon', '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>', {
-
- type: "PwA",
- color: "Gold",
- size: "small",
- language: "de-DE",
-
- authorization: function() {
-
- loginOptions = {
- scope: "profile payments:widget payments:shipping_address payments:billing_address",
- popup: true
- };
-
- authRequest = amazon.Login.authorize(loginOptions, "<?php echo $this->view['wpsg_mod_amazon']['redirectURL']; ?>");
-
- },
-
- onError: function(error) {
-
- //console.log("Login: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
- alert("Login: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
-
- }
-
- } );
-
- <?php if (wpsg_isSizedString($this->view['wpsg_mod_amazon']['amazon_last_authorization_reference_id']) && $this->view['basket']['checkout']['payment'] == 3140) { ?>
-
- jQuery(document).ready(function() {
-
- jQuery('.wpsg_checkoutbutton').hide();
- jQuery('.wpsg_amazonhandler').show();
- jQuery('#LoginWithAmazon').hide();
-
- new OffAmazonPayments.Widgets.AddressBook( {
-
- sellerId: '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>',
-
- onOrderReferenceCreate: function(orderReference) {
-
- var oID = orderReference.getAmazonOrderReferenceId();
+ if (!defined('ABSPATH')) exit;
- jQuery('#wpsg_mod_amazon_OrderReference').val(oID);
- jQuery('.wpsg_checkoutbutton').show();
-
- },
-
- onAddressSelect: function(orderReference) {
-
- // Replace the following code with the action that you want to perform
- // after the address is selected.
- // The amazonOrderReferenceId can be used to retrieve
- // the address details by calling the GetOrderReferenceDetails
- // operation. If rendering the AddressBook and Wallet widgets on the
- // same page, you should wait for this event before you render the
- // Wallet widget for the first time.
- // The Wallet widget will re-render itself on all subsequent
- // onAddressSelect events, without any action from you. It is not
- // recommended that you explicitly refresh it.
-
- new OffAmazonPayments.Widgets.Wallet({
-
- sellerId: '<?php echo $this->get_option('wpsg_mod_amazon_seller_id'); ?>',
-
- onPaymentSelect: function(orderReference) {
-
- // Replace this code with the action that you want to perform
- // after the payment method is selected.
-
- },
-
- design: {
-
- designMode: 'responsive'
-
- },
-
- onError: function(error) {
-
- alert("Wallet: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
-
- }
-
- }).bind("walletWidgetDiv");
-
- },
-
- design: {
-
- designMode: 'responsive'
-
- },
-
- onError: function(error) {
-
- alert("Payment: Es ist folgender Fehler aufgetreten: " + error.getErrorCode() + ' - ' + error.getErrorMessage());
-
- }
-
- } ).bind("addressBookWidgetDiv");
-
- });
-
- <?php } ?>
+?>
-</script> \ No newline at end of file
+<div id="AmazonPayButton_wrap">
+ <div id="AmazonPayButton"></div>
+</div>