Hello!
Yes, i know there are extentions that will do what i need, but they cover everything when i need a specific thing, and am trying to get the hang of coding stuff for myself!
Anyway, I am trying to customise a cash on delivery payment.
All I need it to do is not take payment straight away (which it does) but only be accessible to a specific customer group.
No matter what I try, it mostly does not work, or occasionally, works but is not hidden.... so i am missing something.
I spat the dummy last night, and must have deleted it, so am starting again from scratch! Anyway, if i figure it out i will update here, any pointers would be great.
Yes, i know there are extentions that will do what i need, but they cover everything when i need a specific thing, and am trying to get the hang of coding stuff for myself!
Anyway, I am trying to customise a cash on delivery payment.
All I need it to do is not take payment straight away (which it does) but only be accessible to a specific customer group.
No matter what I try, it mostly does not work, or occasionally, works but is not hidden.... so i am missing something.
I spat the dummy last night, and must have deleted it, so am starting again from scratch! Anyway, if i figure it out i will update here, any pointers would be great.
I have been trying this
1. EDIT: catalog/model/payment/cod.php
2. FIND:
Code: Select all
$method_data = array();
3. AFTER, ADD:
Code: Select all
if ($this->customer->getCustomerGroupId() != '2') {
$status = false;
}
Change "2" to the id of the customer group you want to allow.
But i think its for an older version, i cannot find the corresponding code on my OC 3.
1. EDIT: catalog/model/payment/cod.php
2. FIND:
Code: Select all
$method_data = array();
3. AFTER, ADD:
Code: Select all
if ($this->customer->getCustomerGroupId() != '2') {
$status = false;
}
Change "2" to the id of the customer group you want to allow.
But i think its for an older version, i cannot find the corresponding code on my OC 3.
I am not sure what you mean ... catalog/model/extension/payment/cod.php file:But i think its for an older version, i cannot find the corresponding code on my OC 3.
Code: Select all
$method_data = array();
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
DOH!
I could not see it for looking for it!!
Now....
I get internal server error if i add that code snippet..... need to check whats going on
I could not see it for looking for it!!
Now....
I get internal server error if i add that code snippet..... need to check whats going on
Look at your access logs on your host console's most recent lines for index 500. What do the details provide?I get internal server error if i add that code snippet..... need to check whats going on
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: Baidu [Spider] and 8 guests