Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

No Charge products


jleuthard

Recommended Posts

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

Link to comment
Share on other sites

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';

}

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...