We have somewhat of an unconventional use case, we sell "virtual gifts" that aren't shipped. We do, however, have the 'commerce_shipping' module installed because we have a feature of the checkout workflow that allows the donor to choose a greeting card to be mailed.

The issue is that the block of code in commerce_paypal_ec.module that starts on line 1048 with the comment "// If the shipping module is enabled..." assumes that if the module exists then the $order_wrapper->commerce_customer_shipping->commerce_customer_address object property also exist. This is causing a fatal error when the user clicks on the button to pay on PayPal. We hacked the code to first check if the $order_wrapper->commerce_customer_shipping property is set.

This...

if (!empty($order_wrapper->commerce_customer_shipping->commerce_customer_address)) {

... became this ...

if (isset($order_wrapper->commerce_customer_shipping) && !empty($order_wrapper->commerce_customer_shipping->commerce_customer_address)) {
CommentFileSizeAuthor
#1 cart_without_shipping-2480849-1.patch1.03 KBcapellic
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

capellic’s picture

Patch file attached.

rszrama’s picture

Version: 7.x-2.3 » 7.x-2.x-dev
Status: Active » Fixed

Thanks!

  • rszrama committed cc327f1 on 7.x-2.x authored by capellic
    Issue #2480849 by capellic: fix an "Unknown data property...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.