Hello, first of all here are my instance details:
1. OpenCart version 3.0.3.6
2. Interio Theme
3. Multiple Extensions and some modifications of my own without which the problem still persists.
4. Greek language only e-shop
5. PHP 7.4.33
6. Browser: Irrelevant (tried on both Chrome and Firefox, used private session, cleared cache etc.)
I'll try to be as thorough as I can in order to speed things up.
Customer Groups and Custom Fields:
The instance I am working on has 2 customer_group types 1 and 2.
There are 5 custom fields of text type defined out of which only 1 applies to address while the rest 4 apply to the account.
The customer_group 1 has only one of those assigned and required, it's the address custom field.
The customer_group 2 has all custom_fields assigned and required.
In order to reproduce it I simply add a product to cart as a guest (not logged in) and browse to the checkout page.
If I choose to place order as a guest I face no issues whatsoever regardless of what I choose afterwards provided that I insert valid information.
If I choose to also create an account I get to choose the customer group.
If I choose customer_group 1 I am able to place the order regardless of what I choose afterwards provided that I insert valid information.
If I choose customer_group 2 and fill in all fields with valid values that pass all validations successfully I get this error in a popup window:
Chrome:
SyntaxError: Unexpected token'<', "<b>Notice<"... is not valid JSON
parseerror
<b>Notice</b>: Undefined property: Proxy::getCustomFieldValue in <b>storage/modification/system/engine/loader.php</b> on line <b>X</b>
Firefox:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
parsererror
<b>Notice</b>: Undefined property: Proxy::getCustomFieldValue in <b>storage/modification/system/engine/loader.php</b> on line <b>X</b>
The line they point to is here:
if (is_callable($callable)) {
$output = call_user_func_array($callable, $args); //<- this is the X line
}
I've tried removing all my modifications just to see if I messed something up with my own code but the problem persists. There are many modifications installed and it's not easy to disable one by one, so I've started tracking the issue and I am close to figuring out where exactly it occurs.
In the file: catalog/controller/checkout/register.php
There is the line: $customer_id = $this->model_account_customer->addCustomer($this->request->post);
The execution goes smooth up to this point , I've set up logs before and after it and it doesn't proceed further than this.
In the file: catalog/model/account/customer.php
The addCustomer() method that the line above calls gets executed properly from start to finish and $customer_id returned contains the valid newly created ID of the customer. But somehow it does not return to the previous command that called it.
I looked further and found that right after the addCustomer() method is followed by this event: catalog/controller/event/activity.php
The addCustomer() method in it gets triggered and has full input parameters:
$route contains: account/customer/addCustomer
$args contains all form fields including the custom_field array() that contains all custom fields values for both account and address.
$output contains the newly created customer ID both before and after it completes its execution.
The part within the: if ($this->config->get('config_customer_activity')) { } does not get executed as the condition is not fulfilled which I guess is correct as the customer is new and has no activity entries so far.
I've checked for more events that hook on the addCustomer() method but couldn't find any.
I've also checked a lot of calls to getCustomFieldValue() methods but so far I can't find which one is called.
The error only occurs in this specific case, if a user has already created an account and logs in or continues to checkout as guest there are no issues.
Can you point me as to where to continue debugging this?
I've been cornering this for days now and I have to figure it out or disable account creation on checkout completely which is an unwanted solution.
Any help would be much appreciated!
Check system folder for ocmod extensions
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
It sounds like you might be better off just paying a developer to take a look such as ourselves or post a job in the Commercial Support Forum.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Legendary Member
There is no getCustomFieldValue method in any of the catalog models, so that code must of been added by an extension. You could try to work out what extension is adding the call to it.
Who is online
Users browsing this forum: No registered users and 13 guests