Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Restrict download products to payment using only paypal


14steve14

Recommended Posts

I am hoping that someone can give a bit of advice on how to restrict the payment methods for downloadable products to only PayPal.

 

I have searched and not really found anything apart from an older addon that means that every product can have the payment method set, which is sort of what I want to do, but entails a lot of mods. There is also something that lists all the product ids in an array, but the list is ever expanding and currently nearing 300.

 

As downloads are virtual products is there any way to select a virtual product and only allow say paypal standard for the payment method. Any other products purchased at the same time will also be payable using paypal.

 

Any help welcome

 

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

Hi,

 

you probably have to alter the payment-modules. Not sure if you can do this outside with a header_tag-module.

 

There's a function in the shoppingCart-class: function get_content_type()

You let the payment-modules check, if there's a download in the cart and if yes, the payment-module get's disabled.

global $cart;

if($cart->get_content_type() != 'physical'){
  $this->enabled = false;
} // disable payment-module if there's a download in the order (function update_status())

Not sure if this would work, didn't test it. You'd have to add it to every payment-module you use, except the PayPal-module.

 

 

AD

Link to comment
Share on other sites

On 16/05/2017 at 1:29 PM, beerbee said:

 

Many thanks fir the help. Seems to work like a charm. If an order now contains only downloads most payment modules are disabled which stops people paying using cheques and bank transfers.

 

I am looking at the PWA addon where that allows users to select which payments are used so it might get improved and turned into a module yet if I can fathom out which bits of the code to use.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...