Forums / General Questions / COD does not appear during the checkout, is downloadable product the reason?

COD does not appear during the checkout, is downloadable product the reason?

Started by rajoo_sharma on 6 Sep 2012, 5:55 AM · Views: 577

Results 1 to 4 of 4
6 Sep 2012, 5:55 AM
#1
rajoo_sharma avatar

rajoo_sharma

Zen Follower

Join Date:
Aug 2009
Posts:
137
Plugin Contributions:
0

COD does not appear during the checkout, is downloadable product the reason?

Hello,

PayPal IPN, Check/Money Order and Cash On Delivery are enabled payment modules on our site. I noticed that COD does not appear during the checkout when there is a downloadable product in the cart. I understand that COD shouldn't be offered when there is a downloadable file in the cart. Am I getting it right?

What if I want to tell the same my user during the checkout, display that either remove the downloadable product from your cart and you'll get COD or chose one of the two other options.

Thanks

6 Sep 2012, 3:12 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: COD does not appear during the checkout, is downloadable product the reason?

You got it right ... the default behavior of the COD payment module is to disable itself if there are "virtual" products (like downloads) present in the customer's cart.

You could modify your shippinginfo page to identify both shipping and payment information for your site and let the customers know that the COD payment method is not available if they have one or more downloadable products in their cart.

6 Sep 2012, 6:42 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: COD does not appear during the checkout, is downloadable product the reason?

lat9 is correct.

Something like the following may work:```
// disable the module if the order only contains virtual products
if ($this->enabled == true) {
if ($order->content_type != 'physical') {
[B] global $messageStack;
if ($order->content_type == 'mixed')
$messageStack->add('checkout_payment', 'NOTE: COD option not shown, because COD is not available to downloadable/virtual products', 'caution');
[/B]
$this->enabled = false;
}
}
}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Sep 2012, 2:05 PM
#4
rajoo_sharma avatar

rajoo_sharma

Zen Follower

Join Date:
Aug 2009
Posts:
137
Plugin Contributions:
0

Re: COD does not appear during the checkout, is downloadable product the reason?

Thanks lat9 and Dr. Byte
Regards