2

The store that I am working on is a Pick-up store, which means that customers can order the things on-line but collection of orders has to be done from the store itself; the customers have to go to the store to collect order items.

Hence, there is nothing like shipping for this online store. So we donot collect shipping information from the user during registration as instructed by the client.

Now at the same time, the client insists to use Paypal Express Checkout for the payment.

Which means that if the user is registered but his shipping information is not available, and if he tries to checkout, the following error appears :

"PayPal gateway has rejected request. The field Shipping Address1 is required (#10727: Shipping Address1 Empty). The field Shipping Address City is required (#10728: Shipping Address City Empty)."

Is there anyway to handle the situation??

I mean, can I do something so that the above fields for Paypal do not remain compulsory or else pass some random static value for them along with other parameters to Paypal?

Any help would be appreciated.

Thanks in advance

4
  • If PayPal cannot offer a solution, the set the shipping address to the store address. You may want to add a default comment informing the customer. It's probably best to set it to the address of the store the customer had to go to to pick up the item, but the store address of the site works to.
    – user4351
    Nov 25, 2014 at 8:30
  • that would do fine.. but the client does not want the customer to enter the address details at all.. so i will have to look for smthing else
    – Helly
    Nov 25, 2014 at 8:55
  • In this case you mean your client or the customer at the store? Where are the address details entered? At the site or PayPal?
    – user4351
    Nov 25, 2014 at 8:58
  • address details are not collected at all.. Even if they would b collected, i dnt want the shipping address to go to paypal..i want to completely ignore the shipping thing in paypal
    – Helly
    Nov 25, 2014 at 9:02

2 Answers 2

3

Have a look at class Mage_Paypal_Model_Api_Nvp and method callSetExpressCheckout(). Right above this you will see a link to https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout. If you visit this page you will find you can pass the argument NOSHIPPING with 1 of three values, 0, 1 or 2. 1 is described as:

PayPal does not display shipping address fields whatsoever

It also says in the description:

For digital goods, this field is required, and you must set it to 1

You effectively have digital goods as you have no shipping address, so you need to pass NOSHIPPING with a value of 1 to the SetExpressCheckout call which you can do in the callSetExpressCheckout() method. So rewrite this class in your own module and add the extra paramater into the method, something like the following:

public function callSetExpressCheckout()
{
    // rest of the method here

    $request['NOSHIPPING'] = 1; // add this line

    $response = $this->call(self::SET_EXPRESS_CHECKOUT, $request);
    $this->_importFromResponse($this->_setExpressCheckoutResponse, $response);
}
1
  • thanks.. actually read about this but did not implement it properly
    – Helly
    Nov 25, 2014 at 9:56
0

This is configurable, just hidden under advanced settings: Advanced Paypal Express Checkout Settings

See: Require Customer's Billing Address.

Edit:

So after review of comments and other answers, there's no need to modify the core code. Simply use $quote->setIsVirtual() in your checkout template or block.

Observe around line 331 in Mage/Paypal/Model/Checkout/Express.php in a 1.9.0.1 install:

    // supress or export shipping address
    if ($this->_quote->getIsVirtual()) {
        if ($this->_config->requireBillingAddress == Mage_Paypal_Model_Config::REQUIRE_BILLING_ADDRESS_VIRTUAL) {
            $this->_api->setRequireBillingAddress(1);
        }
        $this->_api->setSuppressShipping(true);
2
  • OP need's to disable the requirement for shipping, not billing address. Nov 25, 2014 at 9:45
  • OP explicitly stated "no address filled out at all".
    – user4351
    Nov 25, 2014 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.