Skip to content

Commit

Permalink
Take over Changes from OXID6.3 Branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mariolorenz committed Aug 15, 2024
1 parent d6c77c0 commit cd8972e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.3.10] - 2024-08-15

- [0007666](https://bugs.oxid-esales.com/view.php?id=7666): Fix: Price surcharges on the detail page for selection lists are not taken into account

## [1.3.9] - 2024-06-21

- [0007661](https://bugs.oxid-esales.com/view.php?id=7661): Error in the order process the total value did not match the total of the items and shipping cost of the order
Expand Down
2 changes: 1 addition & 1 deletion metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
'en' => 'Use of the online payment service from PayPal. Documentation: <a href="https://docs.oxid-esales.com/modules/paypal-checkout/en/latest/" target="_blank">PayPal Checkout</a>'
],
'thumbnail' => 'out/img/paypal.png',
'version' => '1.3.9',
'version' => '1.3.10',
'author' => 'OXID eSales AG',
'url' => 'https://www.oxid-esales.com',
'email' => 'info@oxid-esales.com',
Expand Down
7 changes: 4 additions & 3 deletions src/Controller/ProxyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ public function approveOrder()

public function cancelPayPalPayment()
{
PayPalSession::unsetPayPalOrderId();
Registry::getSession()->getBasket()->setPayment(null);
PayPalSession::unsetPayPalSession();
Registry::getSession()->getBasket()->deleteBasket();
Registry::getUtils()->redirect(Registry::getConfig()->getShopSecureHomeURL() . 'cl=payment', false, 301);
}

Expand All @@ -175,9 +175,10 @@ protected function addToBasket($qty = 1)
$basket = Registry::getSession()->getBasket();
$utilsView = Registry::getUtilsView();

$aSel = Registry::getRequest()->getRequestParameter('sel');
if ($aid = (string)Registry::getRequest()->getRequestEscapedParameter('aid')) {
try {
$basket->addToBasket($aid, $qty);
$basket->addToBasket($aid, $qty, $aSel);
// Remove flag of "new item added" to not show "Item added" popup when returning to checkout from paypal
$basket->isNewItemAdded();
} catch (OutOfStockException $exception) {
Expand Down
13 changes: 12 additions & 1 deletion views/tpl/shared/paymentbuttons.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,18 @@
},
[{/if}]
createOrder: function (data, actions) {
return fetch('[{$sSelfLink|cat:"cl=oscpaypalproxy&fnc=createOrder&context=continue&aid="|cat:$aid|cat:"&stoken="|cat:$sToken}]', {
let selElements = document.querySelectorAll('input[name^="sel"]');
let params = new URLSearchParams();
if (selElements.length > 0) {
selElements.forEach(function(element) {
if (element && element.value !== undefined && element.value !== null) {
params.append(element.name, element.value);
}
});
}
let baseUrl = '[{$sSelfLink|cat:"cl=oscpaypalproxy&fnc=createOrder&context=continue&aid="|cat:$aid|cat:"&stoken="|cat:$sToken}]';
let url = baseUrl + (params.toString() ? '&' + params.toString() : '');
return fetch(url , {
method: 'post',
headers: {
'content-type': 'application/json'
Expand Down

0 comments on commit cd8972e

Please sign in to comment.