Skip to content

Commit

Permalink
several fixes / refinements for sw4
Browse files Browse the repository at this point in the history
  • Loading branch information
netzkollektiv committed Sep 21, 2023
1 parent 15f6813 commit 733014d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Frontend/NetzkollektivEasyCredit/Api/QuoteBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct() {
}

public function getId() {
return \mb_substr(Shopware()->Session()->get('sessionId'), 0, 50);
return \mb_substr(Shopware()->Session()->offsetGet('sessionId'), 0, 50);
}

public function getShippingMethod() {
Expand Down
4 changes: 2 additions & 2 deletions src/Frontend/NetzkollektivEasyCredit/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getLabel()

public function getVersion()
{
return '1.9.0';
return '1.9.1';
}

public function getInfo()
Expand Down Expand Up @@ -491,7 +491,7 @@ public function removeInterest($refresh = true)
Shopware()->Db()->delete(
's_order_basket',
array(
'sessionID = ?' => $session->get('sessionId'),
'sessionID = ?' => $session->offsetGet('sessionId'),
'ordernumber = ?' => self::INTEREST_ORDERNUM
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public function addInterestSurcharge() {
$this->container->get('db')->delete(
's_order_basket',
array(
'sessionID = ?' => $this->session->get('sessionId'),
'sessionID = ?' => $this->session->offsetGet('sessionId'),
'ordernumber = ?' => $interest_order_name
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public function onFrontendAddressPostDispatch($args) {
}
Shopware()->Session()->offsetSet('EasyCredit', $data);

$data = Shopware()->Session()->get('sOrderVariables')['sUserData'];
$data = Shopware()->Session()->offsetGet('sOrderVariables')['sUserData'];
if (isset($data['sUserData'])) {
unset($data['sUserData']);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected function onCheckoutConfirm($action, $view) {
$checkout = $this->container->get('easyCreditCheckout');

if (!$checkout->isInitialized()) {
$this->helper->getPlugin()->getStorage()->set('apiError', $this->helper->getPlugin()->getLabel(). ' wurde nicht initialisiert.');
$this->helper->getPlugin()->getStorage()->set('apiError', 'Bitte klicken Sie auf "Weiter zum Ratenkauf" um die Raten für Ihre Bestellung zu berechnen.');
return $this->_redirToPaymentSelection($action);
}

Expand Down Expand Up @@ -174,4 +174,4 @@ protected function onCheckoutConfirm($action, $view) {
return $this->_redirToPaymentSelection($action);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jQuery(function($) {

var handleShippingPaymentConfirm = function () {
onHydrated('easycredit-checkout', function (easyCreditCheckout) {
$(easyCreditCheckout, 'form.payment').submit(function(e){
var form = $('form.payment')
$(easyCreditCheckout, "form.payment[action*='savePayment']").submit(function(e){
var form = $("form.payment[action*='savePayment']")
form.append('<input type="hidden" name="easycredit[submit]" value="1" />')
if (e.detail && e.detail.numberOfInstallments) {
form.append('<input type="hidden" name="easycredit[number-of-installments]" value="'+ e.detail.numberOfInstallments +'" />')
Expand Down Expand Up @@ -69,4 +69,4 @@ jQuery(function($) {
});
}
handleShippingPaymentConfirm();
});
});

0 comments on commit 733014d

Please sign in to comment.