View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004639 | module PayPal | 1.03. Basket, checkout process | public | 2012-10-18 11:58 | 2013-01-28 18:54 |
Reporter | martinwegele | Assigned To | |||
Priority | low | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Fixed in Version | 2.0.4 | ||||
Summary | 0004639: delivery option oxidstandard does not work in subshops | ||||
Description | PayPal ExpressCheckout does not work if "Calculate default Shipping costs when User is not logged in yet" is enabled and shipping method "oxidstandard" is not available. See screenshot of the error message. Obviously the shipping method "oxidstandard" has to be inherited to all subshops to make this option work. In the customer's scenario this is not possible. | ||||
Steps To Reproduce | Install EE 4.5.11 and PayPal module 2.02 Rename "oxidstandard" shipping method Activate option "Calculate default Shipping costs when User is not logged in yet" (Master settings -> core settings -> settings -> other settings) Step through checkout process using PayPal Express as payment method | ||||
Additional Information | The method oxbasket::getShippingId() is accessing shipping method "oxidstandard": /** * Get basket shipping set, if shipping set id is not set, try to get it from session * * @return string oxDeliverySet */ public function getShippingId() { if ( !$this->_sShippingSetId ) { $this->_sShippingSetId = oxSession::getVar( 'sShipSet' ); } $sActPaymentId = $this->getPaymentId(); // setting default if none is set if ( !$this->_sShippingSetId && $sActPaymentId != 'oxempty' ) { $oUser = $this->getUser(); // choosing first preferred delivery set list( , $sActShipSet ) = oxDeliverySetList::getInstance()->getDeliverySetData( null, $oUser, $this ); // in case nothing was found and no user set - choosing default $this->_sShippingSetId = $sActShipSet ? $sActShipSet : ( $oUser ? null : 'oxidstandard' ); } elseif ( !$this->isAdmin() && $sActPaymentId == 'oxempty' ) { // in case 'oxempty' is payment id - delivery set must be reset $this->_sShippingSetId = null; } return $this->_sShippingSetId; } There is no differentiation between the subshops so this shipping method has got a "global" validity. Therefore there is probably a need for something like this to differentiate between the subshops: if (subShop == 1) { $this->_sShippingSetId = $sActShipSet ? $sActShipSet : ( $oUser ? null : 'oxidstandard1' ); } else if (subShop == 2) { $this->_sShippingSetId = $sActShipSet ? $sActShipSet : ( $oUser ? null : 'oxidstandard2' ); } etc. However I am unsure if this really solves the problem since I cannot foresee the impact on further calculations within the basket. | ||||
Tags | Delivery, Subshops | ||||
Attached Files | |||||
|
I guess the problem is when PayPal tries to load not existing "oxidstandart" shipping method. PayPal is expecting valid shipping ID value. So oxbasket::getShippingId() always must return valid shipping ID. And this place should be updated using module for oxbasket class (as this is not standard shop and this solution is needed only for them). My suggest example for this module: function getShippinId() { $sShippingId = parent::getShippingId(); if ( $sShippingId == "oxidstandart" ) { // if this shipping method is returned that means that // no shipping is selected and we are using shop default one $sShippingId = new valid shipping ID; } return $sShippingId; } |
|
Can someone verify that the error message from PayPal changed to this: "Invalid shipping options; you must specify a name and amount for each shipping option type." |
|
After a short research , this problem should be fixed from shop side AND oepaypal moduole side. |
|
Updated module code to fix this problem. |