goyan Posted May 6, 2017 Share Posted May 6, 2017 How can I disable COD (Cache on Delivery) payment module if shipping is not equal SPU (Store Pickup) or Total is greater then $500 for example? Link to comment Share on other sites More sharing options...
♥raiwa Posted May 6, 2017 Share Posted May 6, 2017 @@goyan, first condition can be achieved with the ship2pay add-on: http://addons.oscommerce.com/info/8419 Or could be custom coded into the COD module. The second condition would need to be custom coded to the COD module. Have a look into the module. You could define the additional conditions in this section: // disable the module if the order only contains virtual products if ($this->enabled == true) { if ($order->content_type == 'virtual') { $this->enabled = false; } } rgds Rainer About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
goyan Posted May 7, 2017 Author Share Posted May 7, 2017 Thanks @@raiwa, I know that condition should look something like this: if ($total > 500) or ($shipping_id != spu_id) $this->enabled = false; but I have a problem in locating those variables. I have found: $order->info['shipping_method'] - which contain a string with description of shipping module; $shipping['id'] - contains a string "spu_spu" for Store Pickup, "flat_flat" for Flat Rate shipping. but I don't think they are appropriate for this condition. Which variables should I use instead? Link to comment Share on other sites More sharing options...
♥raiwa Posted May 7, 2017 Share Posted May 7, 2017 Dobar dan @@goyan, First you need to add $shipping to the global list: function update_status() { global $order, $shipping; Then the conditions looks like this: if ($this->enabled == true) { if ($order->content_type == 'virtual' || $shipping['id'] != 'spu_spu' || $order->info['subtotal'] > 500 ) { $this->enabled = false; pozdrav Rainer About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
goyan Posted May 8, 2017 Author Share Posted May 8, 2017 Moltes gràcies @@raiwa, That's it. Best regards. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.