View Issue Details

IDProjectCategoryView StatusLast Update
0004639module PayPal1.03. Basket, checkout processpublic2013-01-28 18:54
Reportermartinwegele Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version2.0.4 
Summary0004639: delivery option oxidstandard does not work in subshops
DescriptionPayPal 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 ReproduceInstall 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 InformationThe 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.
TagsDelivery, Subshops
Attached Files
paypal (1).PNG (65,859 bytes)   
paypal (1).PNG (65,859 bytes)   
screen_paypal_delivery_0.png (49,486 bytes)   
screen_paypal_delivery_0.png (49,486 bytes)   

Activities

rimvydas_paskevicius

2012-11-09 15:53

reporter   ~0007811

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;
}

martinwegele

2012-11-23 11:30

reporter   ~0007958

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."

tomas_liubinas

2012-11-23 16:51

reporter   ~0007975

After a short research , this problem should be fixed from shop side AND oepaypal moduole side.

rimvydas_paskevicius

2013-01-04 09:42

reporter   ~0008213

Updated module code to fix this problem.