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.
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')
);
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'));
}
Thanks, this will do for nowQphoria wrote:There are easy code hacks you can add to certain shipping modules that will basically "force" the payment module.

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.
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.
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
OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Check out: All my extensions | My FREE extensions

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.

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Check out: All my extensions | My FREE extensions
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;
}
}
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;
}
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
Check out: All my extensions | My FREE extensions
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
Check out: All my extensions | My FREE extensions
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',
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
Check out: All my extensions | My FREE extensions
OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Check out: All my extensions | My FREE extensions
That is because cod is a payment method.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...
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.
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
Check out: All my extensions | My FREE extensions
OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Check out: All my extensions | My FREE extensions
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.
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...
Users browsing this forum: No registered users and 9 guests