jleuthard Posted March 1, 2007 Share Posted March 1, 2007 Hi, I'm trying to add a free "workshop/product" to my store and I can't figure out what to use as the payment method for "free." I don't really want to use the COD as that may confuse our students. The only Payment Method that it will give me as my choice is Cybersource. I know it can be done because I saw it on the oscommerceguides.com site. The Payment Method correctly says "This is the only payment method available for this order" and it lists none. You can continue on and make the purchase without credit card. Thanks so much for any help. Julie Arizona State University Quote Link to comment Share on other sites More sharing options...
Bill Langlais Posted March 2, 2007 Share Posted March 2, 2007 What I did was make a copy of the COD module and change it to be a no charge module. Then I put logic in the module to turn it off if the order total was > 0. I put the oposite logic in the other payment modules so that they turned off if the order was = 0. Here is the lines I added to the PayPal Module in the constructor: class paypal { var $code, $title, $description, $enabled; // class constructor function paypal() { global $order; $this->code = 'paypal'; $this->title = MODULE_PAYMENT_PAYPAL_TEXT_TITLE; $this->description = MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_PAYPAL_SORT_ORDER; $this->enabled = ((MODULE_PAYMENT_PAYPAL_STATUS == 'True') ? true : false); if ((int)MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID; } // The folowing if is what I added to turn off this module if the total is 0. // Turn off this module if the order amount is $0.00 if ( (is_object($order)) && ( $order->info['total' ] == 0) ) { $this->enabled = false; } if (is_object($order)) $this->update_status(); $this->form_action_url = 'https://secure.paypal.com/cgi-bin/webscr'; } Quote Link to comment Share on other sites More sharing options...
Guest Posted March 2, 2007 Share Posted March 2, 2007 What I did was make a copy of the COD module and change it to be a no charge module. Then I put logic in the module to turn it off if the order total was > 0. I put the oposite logic in the other payment modules so that they turned off if the order was = 0. Here is the lines I added to the PayPal Module in the constructor: class paypal { var $code, $title, $description, $enabled; // class constructor function paypal() { global $order; $this->code = 'paypal'; $this->title = MODULE_PAYMENT_PAYPAL_TEXT_TITLE; $this->description = MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_PAYPAL_SORT_ORDER; $this->enabled = ((MODULE_PAYMENT_PAYPAL_STATUS == 'True') ? true : false); if ((int)MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID; } // The folowing if is what I added to turn off this module if the total is 0. // Turn off this module if the order amount is $0.00 if ( (is_object($order)) && ( $order->info['total' ] == 0) ) { $this->enabled = false; } if (is_object($order)) $this->update_status(); $this->form_action_url = 'https://secure.paypal.com/cgi-bin/webscr'; } Or this might be what you want http://www.oscommerce.com/community/contri...earch,free+gift or http://www.oscommerce.com/community/contri...earch,free+gift Quote Link to comment Share on other sites More sharing options...
bkellum Posted March 3, 2007 Share Posted March 3, 2007 Hi, I'm trying to add a free "workshop/product" to my store and I can't figure out what to use as the payment method for "free." I don't really want to use the COD as that may confuse our students. The only Payment Method that it will give me as my choice is Cybersource. I know it can be done because I saw it on the oscommerceguides.com site. The Payment Method correctly says "This is the only payment method available for this order" and it lists none. You can continue on and make the purchase without credit card. Thanks so much for any help. Julie Arizona State University Julie, I like to use the simple "Free of Charge" contribution. It works great and does not upset any other products in your shop which the user must pay for. http://www.oscommerce.com/community/contributions,3342 Quote Bill Kellum Sounds Good Productions STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.