collotcorp Posted January 28, 2009 Share Posted January 28, 2009 I wish to know if anybody knows of a method or contribution so that I can assign different payment options to different products...that is, product A can only be paid with PayPal, product B can be paid with both PayPal and 2CO, etc. Suggestions are appreciated. Quote Link to comment Share on other sites More sharing options...
zopeuser Posted February 9, 2009 Share Posted February 9, 2009 I also have this request. Maybe this thread can help you: http://www.oscommerce.com/forums/index.php?showtopic=324732 Quote Link to comment Share on other sites More sharing options...
zopeuser Posted February 10, 2009 Share Posted February 10, 2009 (edited) What I found out so far: I can disable the payment option "invoice" by adding $cart; and if($cart->total <200) $this->enabled = false; in includes/modules/payment/invoice.php: class invoice { var $code, $title, $description, $enabled; // class constructor function invoice() { global $order, $bt_array; [b]$cart;[/b] $this->code = 'invoice'; $this->title = MODULE_PAYMENT_INVOICE_TEXT_TITLE; $this->description = MODULE_PAYMENT_INVOICE_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_INVOICE_SORT_ORDER; $this->enabled = ((MODULE_PAYMENT_INVOICE_STATUS == 'True') ? true : false); // invoice is only available if total in shoppping cart < 200 [b] if ($cart->total <200) $this->enabled = false;[/b] if ((int)MODULE_PAYMENT_INVOICE_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_INVOICE_ORDER_STATUS_ID; } if (is_object($order)) $this->update_status(); } Now I would like to disable the payment option "invoice" if product id "119" is in shopping cart. I tried: if (($cart->in_cart(119)) $this->enabled = false; Unfortunately, this leads to the following error: PHP Fatal error: Call to a member function in_cart() on a non-object in /www/htdocs/eshop/includes/mne 28, referer: http://mydomain/eshop/checkout_shipping.ph...ahccuif6ovlqmo1 Any idea what I did wrong? Edited February 10, 2009 by zopeuser Quote 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.