OSC-Sevilla Posted September 26, 2011 Share Posted September 26, 2011 is there a nice mod to allow customers to "PAY ON COLLECTION"- ?? - delivery...- Collect from store - payment - pay on collection. Many thanks Link to comment Share on other sites More sharing options...
NodsDorf Posted September 26, 2011 Share Posted September 26, 2011 For Delivery you'll want "In Store Pickup" For Payment you'll want to use "Cash On Delivery" which should be installed by default. Maybe just change the language to from "Cash On Delivery" to "Pay at Store". Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted September 26, 2011 Author Share Posted September 26, 2011 great thanks Link to comment Share on other sites More sharing options...
nobodyfamous Posted January 6, 2012 Share Posted January 6, 2012 I would like to take this one step further. . . Can you make the payment option "pay on collection" only show if you have chosen "In store Pick up" So, if some one chooses in store pickup, they will have regular payment options & pay on collection. Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted January 9, 2012 Author Share Posted January 9, 2012 will provide the code for this later today.. Link to comment Share on other sites More sharing options...
nobodyfamous Posted January 9, 2012 Share Posted January 9, 2012 looking at the cod.php (Cash On Delivery) payment module, Line 55-60 // disable the module if the order only contains virtual products if ($this->enabled == true) { if ($order->content_type == 'virtual') { $this->enabled = false; } } Can I not use this same code again, yet change the if statement to say something like if($order->shipping == 'in store pickup') { $this->enabled= false; } just change the if statement to use actual variables. . . what are they? Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted January 10, 2012 Author Share Posted January 10, 2012 I would like to take this one step further. . . Can you make the payment option "pay on collection" only show if you have chosen "In store Pick up" So, if some one chooses in store pickup, they will have regular payment options & pay on collection. I am looking at this and rightly ther are 2 senarios: 1. the client selects store pickup (checkout_shipping.php) -------all payment options are viable as the client can pay for the goods and collect later, or pay on collection. 2. the client wants the goods delivered (checkout_shipping.php) ---- Now, the option to collect pay on collection should not be used. just need to code in the log of the radio button for checkout_shipping.php which is stored in a variable (got to find it) and force out the pay on collection when store pickup is not chosen Link to comment Share on other sites More sharing options...
nobodyfamous Posted January 10, 2012 Share Posted January 10, 2012 I think I found out how to do this. checkout_shipping.php line 134-136 $shipping = array('id' => $shipping, 'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'), 'cost' => $quote[0]['methods'][0]['cost']); I think all you need to do is add this code to your "In Store" payment module // disable this module unless In Store Pickup is selected as shipping type if ($this->enabled == true) { if ($shipping->id == 'in_store') { $this->enabled = true; } else { $this->enabled = false; } } Link to comment Share on other sites More sharing options...
nobodyfamous Posted January 10, 2012 Share Posted January 10, 2012 or better yet; // disable this module unless In Store Pickup is selected as shipping type if ($this->enabled == true) { if ($shipping->id !== 'in_store') { $this->enabled = false; } The variable $shipping->id might not be 'in_store' but will be something specific to the shipping module you use for the in store pick up. Link to comment Share on other sites More sharing options...
nobodyfamous Posted January 11, 2012 Share Posted January 11, 2012 still working on this, I have figured a bit out. If you echo $shipping['id'] on checkout_payment.php you get 'spu_spu' when you choose "In Store Pickup" With that, I am trying to DISABLE the payment module, cod unless the $shipping['id'] == 'spu_spu' I can find where to put the conditional statement if ($shipping['id'] !== 'spu_spu') { $this->enabled = false; } Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted January 13, 2012 Author Share Posted January 13, 2012 Very close to the solution, im having a go.... Link to comment Share on other sites More sharing options...
nobodyfamous Posted January 13, 2012 Share Posted January 13, 2012 I think what needs to be done is find where osc checks the database for the "enabled" value, and just after it, overwrite it with the above code and change "this" to whatever the database variable is. If that makes sense. Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted January 13, 2012 Author Share Posted January 13, 2012 to help, edit checkout_shipping and checkout_payment. add this on both pages (in red) <h3><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></h3> <?php echo $shipping['id'];?> now on checout_payment add this above (in red) if ($shipping['id'] == 'flat_flat') { echo $selection[$i]['id']; } if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) { echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n"; now you can see when going back and forth the variables Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted January 13, 2012 Author Share Posted January 13, 2012 the key here is to drop out the COD from the $selection[$i]['id'] == $payment array Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted January 13, 2012 Author Share Posted January 13, 2012 on cheeckout_payment find: <?php $selection = $payment_modules->selection(); //if ($shipping['id'] == 'flat_flat') { print_r($selection); //} if (sizeof($selection) > 1) { ?> this will show the full array, no we muct remove the cod instance form the array if $shipping['id'] == 'flat_flat' Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted January 13, 2012 Author Share Posted January 13, 2012 OK CRACKED IT: JUST DO THIS: checkout_payment.php FIND: $selection = $payment_modules->selection(); add below: if ($shipping['id'] == 'flat_flat') { unset($selection[0]); } NOTE: Make sure in admin that the payment option SORT ORDER for COD is "0" - now when the user clicks for shipping they will not have the option "Payment on Collection" as they have selected to ship the product. Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted January 13, 2012 Author Share Posted January 13, 2012 sorry missed a line if ($shipping['id'] == 'flat_flat') { unset($selection[0]); $selection = array_values($selection); } Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted January 16, 2012 Author Share Posted January 16, 2012 OK this is work well, i ahve added other modules and found issues wqith the above now it works fine use this dont use the above use this one: // PAYMENT ON COLLECTION if ($shipping['id'] !== 'spu_spu') { unset($selection[0]); $selection = array_values($selection); } Link to comment Share on other sites More sharing options...
nobodyfamous Posted February 27, 2012 Share Posted February 27, 2012 Thanks for your work on this gfasal. I went a slightly different rout, maybe more complicated but it is working for me. The scenario goes like this. I have 2 payment options, Pay now with PayPal, or expect an invoice/money request from PayPal (Pay Later) I have 4 shipping options, out of provence (manual shipping) In province custom delivery (city shipping, no city match) In province standard delivery (city shipping, from list) In Store Pickup What I wanted was options 1 and 2 to pay later, as shipping/delivery charges needed to be manually calculated, and options 3 & 4 have to pay via PayPal right away as charges are already calculated. How did I do it? By adding a "payWhen" variable to each shipping module. in desired shipping module [catalog/includes/modules/shipping] find this array/code; $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_PRE_DEFINED_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_PRE_DEFINED_TEXT, 'cost' => MODULE_SHIPPING_PRE_DEFINED_TEXT))); and add 'payWhen' => 'now' (or 'later') to the methods array so it looks like this $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_PRE_DEFINED_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_PRE_DEFINED_TEXT, 'payWhen' => 'now', 'cost' => MODULE_SHIPPING_PRE_DEFINED_TEXT))); This needs to be done in each shipping method to determine what payment option will be used, pay now or later. Then in catalog/checkout_shipping.php find around line 135 $shipping = array('id' => $shipping, 'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'), 'cost' => $quote[0]['methods'][0]['cost']); and add the 'payWhen' so it looks like this $shipping = array('id' => $shipping, 'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'), 'payWhen' => $quote[0]['methods'][0]['payWhen'], 'cost' => $quote[0]['methods'][0]['cost']); Next edit catalog/checkout_payment.php around line 190 find $selection = $payment_modules->selection(); and add after if ($shipping['payWhen'] == 'now') { unset($selection[1]); $selection = array_values($selection); } elseif ($shipping['payWhen'] == 'later') { unset($selection[0]); $selection = array_values($selection); } The key to removing payment modules is to know what order they are in. From the admin side, make sure you set the sort order for each payment module. That way they will sort the same each time. (any zones set will also affect this so test test test) you can add the line print_r($selection); just after $selection = $payment_modules->selection(); to see the whole array. Link to comment Share on other sites More sharing options...
nobodyfamous Posted February 27, 2012 Share Posted February 27, 2012 another option would be to create a loop to search the $selection array for the id and then unset that value. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.