Jump to content

Virtual cart and hiding address


Recommended Posts


in paypal (express checkout, plugin for version 1.6) there is a option that allows to hide (during payment) customer address for virtual products. It is working but after checking the code I'm not sure if it is done right. In function _setPaymentDetails there is:

$fields['NOSHIPPING'] = '1';


if ($id_address && method_exists($this->context->cart, 'isVirtualCart') && !$this->context->cart->isVirtualCart()) {
	$this->setShippingAddress($fields, $id_address);
} else {
            $fields['NOSHIPPING'] = '0';

So default no shipping is set to 1 and this means to hide. But when cart is virtual then in else there is $fields['NOSHIPPING'] = '0'; So address is set to show but on virutal carts should be hidden. Like in the paypal documentation:



Determines whether PayPal displays shipping address fields on the PayPal pages. For digital goods, this field is required, and you must set it to 1. Value is:

0 — PayPal displays the shipping address on the PayPal pages.

1 — PayPal does not display shipping address fields and removes shipping information from the transaction.

2 — If you do not pass the shipping address, PayPal obtains it from the buyer's account profile.

So if should be opposite at start $fields['NOSHIPPING'] = '1'; and in else $fields['NOSHIPPING'] = '0';

But as I mentioned above it works. And I think it is working cause when there is virtual cart no address data are set so on paypal address data are not visible (even if $fields['NOSHIPPING'] = '1')

I'm I right?

Link to comment
Share on other sites




thank you for your message and this suggestion.

We checked the code and added some fixes in the new version of the module (v3.16.3). This version will be available on prestashop addons by the end of the month.

Thank you for your help  !


Have a nice day !


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...