What database information did you checked?piyushvisaria wrote: ↑Sat Mar 19, 2022 6:50 pmCorrection !.. the custom field under affiliate --- under personal information -- the data gets saved, but custom field -- under affiliate information -- the data does not get saved. i checked the database, there is no information stored...
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
i tried all the possible outcomes -- links you shared but not able to see any data...
I request you to kindly look into this as priority. and if possible revert it as soon as possible, there are lot of activity I need to perform on my site with respect to affiliates..
Thank you & Regards.
In the public function edit affiliate UPDATE query it is entirely missing and there is no way the data can be saved from a custom field.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Code: Select all
$this->db->query("UPDATE " . DB_PREFIX . "customer_affiliate SET `company` = '" . $this->db->escape($data['company']) . "', `website` = '" . $this->db->escape($data['website']) . "', `commission` = '" . (float)$this->config->get('config_affiliate_commission') . "', `tax` = '" . $this->db->escape($data['tax']) . "', `payment` = '" . $this->db->escape($data['payment']) . "', `cheque` = '" . $this->db->escape($data['cheque']) . "', `paypal` = '" . $this->db->escape($data['paypal']) . "', `bank_name` = '" . $this->db->escape($data['bank_name']) . "', `bank_branch_number` = '" . $this->db->escape($data['bank_branch_number']) . "', `bank_swift_code` = '" . $this->db->escape($data['bank_swift_code']) . "', `bank_account_name` = '" . $this->db->escape($data['bank_account_name']) . "', `bank_account_number` = '" . $this->db->escape($data['bank_account_number']) . "' WHERE `customer_id` = '" . (int)$customer_id . "'");
With
Code: Select all
$this->db->query("UPDATE " . DB_PREFIX . "customer_affiliate SET `company` = '" . $this->db->escape($data['company']) . "', `website` = '" . $this->db->escape($data['website']) . "', `commission` = '" . (float)$this->config->get('config_affiliate_commission') . "', `tax` = '" . $this->db->escape($data['tax']) . "', `payment` = '" . $this->db->escape($data['payment']) . "', `cheque` = '" . $this->db->escape($data['cheque']) . "', `paypal` = '" . $this->db->escape($data['paypal']) . "', `bank_name` = '" . $this->db->escape($data['bank_name']) . "', `bank_branch_number` = '" . $this->db->escape($data['bank_branch_number']) . "', `bank_swift_code` = '" . $this->db->escape($data['bank_swift_code']) . "', `bank_account_name` = '" . $this->db->escape($data['bank_account_name']) . "', `bank_account_number` = '" . $this->db->escape($data['bank_account_number']) . "', custom_field = '" . $this->db->escape(isset($data['custom_field']['affiliate']) ? json_encode($data['custom_field']['affiliate']) : json_encode(array())) . "' WHERE `customer_id` = '" . (int)$customer_id . "'");
Everything else re custom fields is in place and working. So if you replace this code its fixed and your good to go :-)
I forgot about edit function when I made pull requestmikeinterserv wrote: ↑Sun Mar 20, 2022 3:35 amIt seems code was added to affiliate add function on maintenance branch but NOT affiliate EDIT.

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
[youtube]https://www.youtube.com/watch?v=w6nwSzoqqHY[/youtube]
Let me know if you have any queries on this.. i will be happy to share with you.
https://github.com/opencart/opencart/bl ... .twig#L580
Then this (file updated after I saw many typo's)
https://github.com/opencart/opencart/pull/10492/files
And this
https://github.com/opencart/opencart/pull/10493/files
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Yeah I saw the links you gave and they hit every target except edit affilliate. Just bad luck :-)xxvirusxx wrote: ↑Sun Mar 20, 2022 4:02 pmI forgot about edit function when I made pull requestmikeinterserv wrote: ↑Sun Mar 20, 2022 3:35 amIt seems code was added to affiliate add function on maintenance branch but NOT affiliate EDIT.![]()
I imagine the OP has messed something else up as the custom fields now work perfectly changing that line.
Yes and you have now been provided with the fix. If it doesn't work you have messed something else up.piyushvisaria wrote: ↑Sun Mar 20, 2022 4:41 pmTill Now no success.. The problem lies when entering the data in the custom fields under affiliate information [front end]--- this data does not get stored in the database.
And more bugsmikeinterserv wrote: ↑Sun Mar 20, 2022 10:53 pmYeah I saw the links you gave and they hit every target except edit affilliate. Just bad luck :-)

xxvirusxx wrote: ↑Sun Mar 20, 2022 9:15 pmYes, is a bug....
https://github.com/opencart/opencart/bl ... .twig#L580
Then this (file updated after I saw many typo's)
https://github.com/opencart/opencart/pull/10492/files
And this
https://github.com/opencart/opencart/pull/10493/files
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
The ADMIN does NOT pick up the affiliate field as shown in the OP video. I can confirm that also.
It could be line 49 of admin/model/customer/customer.php - Not sure if that is one of the fixes given.
Updating customer_form.twig and changed in model (line 49)
Code: Select all
custom_field = '" . $this->db->escape(isset($data['custom_field']['affiliate']) ? json_encode($data['custom_field']['affiliate']) : json_encode(array())) . "'
Code: Select all
`custom_field` = '" . $this->db->escape(isset($data['custom_field']) ? json_encode($data['custom_field']) : json_encode(array())) . "'
But strange thing is if you edit a customer, Affiliate tab and change value from afilliate custom field in database is inserted
Code: Select all
{"2":"","1":"value_for"}
Code: Select all
{1":"value_for"}
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Yes that's right. I thought it was fixed because the OP said FRONT END so I only looked at front end. that WORKS NOW. I didn't check the admin edit.xxvirusxx wrote: ↑Sun Mar 20, 2022 11:55 pmBut strange thing is if you edit a customer, Affiliate tab and change value from afilliate custom field in database is insertedWhen should beCode: Select all
{"2":"","1":"value_for"}
Code: Select all
{1":"value_for"}
Line 631 in admin/view/template/customer/customer_form.twig is getting the WRONG VALUE Its getting its value from the custom field table and NOT CUSTOMER AFFILIATE TABLE which it should no ?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Yes, by looking at this code, it should.mikeinterserv wrote: ↑Mon Mar 21, 2022 12:33 amYes that's right. I thought it was fixed because the OP said FRONT END so I only looked at front end. that WORKS NOW. I didn't check the admin edit.xxvirusxx wrote: ↑Sun Mar 20, 2022 11:55 pmBut strange thing is if you edit a customer, Affiliate tab and change value from afilliate custom field in database is insertedWhen should beCode: Select all
{"2":"","1":"value_for"}
Code: Select all
{1":"value_for"}
Line 631 in admin/view/template/customer/customer_form.twig is getting the WRONG VALUE Its getting its value from the custom field table and NOT CUSTOMER AFFILIATE TABLE which it should no ?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
When you save in CUSTOMER affiliate EDIT in front end it saves custom field to DB in CUSTOMER AFFILIATE TABLE.
When you save from ADMIN it saves custom field VALUE in the CUSTOMER table.
NEITHER can be READ in ADMIN EDIT.
It is hard to follow code and might drive you mad.
To the customer all appears well and the custom field is READ and SAVED as expected.
However in ADMIN the NEW VALUE is NOT read and the same occurs, you can edit in admin and the data is saved and all appears well, until you go to FRONT END and see the DATA are now COMPLETELY DIFFERENT - ADMIN saves ADMIN and customer SAVES CUSTOMER with NO interaction between.
Users browsing this forum: Google [Bot] and 18 guests