Post by i2Paq » Wed Nov 11, 2009 7:50 pm

I have searched these forums but could not find anything related so here it goes:

In my shop I have several Paymend modules and Shipping modules. Now what I need is a way to have one Shipmend module use only one Paymend module.
In osCommerce and PrestaShop this is called "Ship2Pay"

You can configure the Paymend modules to be used by all Shipping modules or only to restricted ones.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Qphoria » Thu Nov 12, 2009 12:26 am

There are easy code hacks you can add to certain shipping modules that will basically "force" the payment module.

Example:
If you want to force "COD" when someone chooses the "free shipping" shipping method you can add this to the payment file

1. EDIT: catalog/model/payment/cod.php

2. FIND:

Code: Select all

$method_data = array( 
	'id'         => 'cod',
	'title'      => $this->language->get('text_title'),
	'sort_order' => $this->config->get('cod_sort_order')
);
3. AFTER, ADD:

Code: Select all

//Q: If free shipping is selected, override all other payment modules and force this one.
if ($this->session->data['shipping_method']['id'] == 'free.free') {
	$this->session->data['payment_method'] = $method_data;
	$this->session->data['comment'] = '';
	$this->response->redirect($this->url->https('checkout/confirm'));
}

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by i2Paq » Thu Nov 12, 2009 2:09 am

Qphoria wrote:There are easy code hacks you can add to certain shipping modules that will basically "force" the payment module.
Thanks, this will do for now ;)

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by jc-piazza » Sat Nov 14, 2009 4:51 am

seems to me I want the opposite - if the customer chooses in-store pickup, then shipping is by definition "free". the result you have here is to force in-store if free. Not exactly the same but why offer free shipping at all except for in-store pickup if that is what you want to happen?

New member

Posts

Joined
Mon Sep 07, 2009 3:23 am

Post by Qphoria » Sat Nov 14, 2009 5:28 am

First, it was just an example
Second... If Free shipping is chosen, then force Cash On Delivery... That seems feasible. Meaning you only offer COD if free shipping is chosen.
Third, it's still just an example.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jc-piazza » Sat Nov 14, 2009 6:46 am

agreed. I'm actually having a lot of trouble with these...here's what I'm shooting for:

shipping - allow either UPS or in-store pickup
payment - allow either credit card or in-store pickup
tax - only non-food is taxed, and only if delivered in-state (Maryland) or picked up

I have Geo Zones for All US, Maryland, and In-store Pickup
I have shipping for Weight-based and Free Shipping (but want UPS instead of weight based)

the tax seems to work but the shipping and payment combos are getting me all messed up.

any help is appreciated.

New member

Posts

Joined
Mon Sep 07, 2009 3:23 am

Post by lowlands » Tue Jan 05, 2010 9:33 am

I don't trust my coding capabilities enough to start fooling around with this stuff. Seems free shipping in connection with store pick-up has a lot of OC users puzzled. I too want to give the customer a choice to come pick-up his order at our wharehouse and then add zero shipping to his order.

I gather that up to this moment there is no mod or plugin for this? Is someone working on one?

My OC-shop: http://www.Soldeerpunt.nl


User avatar
Active Member

Posts

Joined
Sun Dec 20, 2009 8:49 am

Post by OC2PS » Sun Jan 24, 2010 11:51 pm

I need the opposite. If someone chooses COD shipping, then I don't want them to see any payment method except COD.

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by OC2PS » Sun Jan 24, 2010 11:53 pm

Oops... :P

I mean I do need what I said above.

But when I said I need the opposite, I meant the following, which is my most important need:
If someone selects any shipping method except COD, then they dont see COD payment method. O0

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by burniesb » Mon Feb 22, 2010 8:22 am

If you want customers to not see the COD payment option if they choose any shipping option except COD... (E.g. Show the COD payment option ONLY if they choose the COD shipping option), try the following:

1. EDIT cod.php in catalog/model/payment

2. BEFORE this line $method_data = array(); add the following code:

Code: Select all

if(isset($this->session->data['shipping_method']['id']))
{
     if ($this->session->data['shipping_method']['id'] != 'cod.cod') 
     {
            $status = false;
     }
}
3. SAVE the file and upload it.

Newbie

Posts

Joined
Wed Aug 26, 2009 3:07 pm

Post by OC2PS » Sun Feb 28, 2010 6:59 pm

burniesb, thanks!

i tried it, and it doesnt seem to work. when i select shipping method except cod, no cod payment option is shown, which is good. problem is that even when i select shipping method as cod, no cod payment option is shown :(

i tried adding this code to ensure that default status wasnt false etc

Code: Select all

elseif ($this->session->data['shipping_method']['id'] = 'cod.cod')
			{
				$status = true;
			}
but this didn't help either.

my suspicion is that your code is all good, only we need to get the correct shipping method id. perhaps it's something else, not cod.cod?

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by OC2PS » Sun Feb 28, 2010 7:29 pm

i think this might be pertinent information:

while on the shipping method checkout page cod shows up as a shipping method, in opencart admin, it is actually a geo zone for weight based shipping....

please, please, please, can you help? i can see your code is correct....we just need to plug in the right variable values...

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by burniesb » Mon Mar 01, 2010 8:20 pm

That seems a bit strange, it works A-OK on mine... It might be worth checking the cod shipping method's ID.

Have a look at catalog/model/shipping/cod.php

Find this line: $quote_data['cod'] = array(

Directly under it, what do you see? Is it this:

Code: Select all

'id'           => 'cod.cod',
Also, comment out all of the changes I've suggested above and in my last post and see if the COD payment option shows in the checkout (it should show up regardless of shipping method choice). If it fails to show, then it might just be your settings at fault.

Newbie

Posts

Joined
Wed Aug 26, 2009 3:07 pm

Post by OC2PS » Mon Mar 01, 2010 8:42 pm

There is no file by the name cod.php in the shipping folder.

I think that may be because when it comes to shipping, cod is only a geo zone for weight based shipping, the file for which is weight.php But I dont know what to look for there... ???

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by OC2PS » Fri Mar 05, 2010 9:34 am

Any ideas?

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by i2Paq » Fri Mar 05, 2010 11:23 pm

sooskriszta wrote:There is no file by the name cod.php in the shipping folder.

I think that may be because when it comes to shipping, cod is only a geo zone for weight based shipping, the file for which is weight.php But I dont know what to look for there... ???
That is because cod is a payment method.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by OC2PS » Fri Mar 05, 2010 11:38 pm

I seem to have finally made it work (fingers crossed). I used Firefox add-in Firebug to see the id of theshipping method on the checkout/shipping page, and used that.

Code: Select all

if(isset($this->session->data['shipping_method']['id']))
		{
			if ($this->session->data['shipping_method']['id'] != 'weight.weight_7') 
			{
				$status = false;	
			}
				
		}

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by OC2PS » Tue Jun 08, 2010 7:35 pm

Do you think that such functionality may be made available via the admin control panel in future versions of Opencart?

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by i2Paq » Sat Jan 15, 2011 3:16 am

There is a commercial mod: Shipping2Payment.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by fireatwire » Tue Mar 01, 2011 7:34 am

Does anyone have a working code for this modification vor 1.4.9.3?
Would like to have it that way that if someone chooses Free Shipping the Cash on Pickup (COP) payment method is selected. Maybe that it skips the choose-payment-method and directly goes to the order confirm page?
What do you think? Didn't got the code to work on my site...

New member

Posts

Joined
Wed Feb 03, 2010 5:21 am
Who is online

Users browsing this forum: No registered users and 9 guests