Post by sandraolt » Mon Jul 13, 2015 5:30 pm

Hello,
I am working from a clean install of OpenCart 2.0.3.1 and the VQMod 2.5.1.6
Please help. I am having a problem finishing a vqmod that I am creating (my first time ever) to add 3 fields to the shipping address. (I did this successfully (hacking individual pages) in OC 1.5+ but we are upgrading our servers, and the office likes the new backend.)

I have these fields added to the order table (shipping_stelephone, shipping_semail, and shipping_plaintext), and to the address table (stelephone, semail, plaintext) in the database. I mostly succeeded in the catalog. - when making a purchase the fields appear, and react as expected. (I am still getting errors in catalog when reviewing orders).

I am now working on the admin section. I have the fields appearing in both the orders and the customer/address sections, but when I attempt to edit an order, I get this error message:

Code: Select all

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

OK

<b>Notice</b>: Undefined index: shipping_stelephone in <b>/home/floridaschool/public_html/shoppingcart/system/modification/catalog/model/checkout/order.php</b> on line <b>58</b><b>Notice</b>: Undefined index: shipping_semail in <b>/home/floridaschool/public_html/shoppingcart/system/modification/catalog/model/checkout/order.php</b> on line <b>58</b><b>Notice</b>: Undefined index: shipping_plaintext in <b>/home/floridaschool/public_html/shoppingcart/system/modification/catalog/model/checkout/order.php</b> on line <b>58</b>{"success":"Success: You have modified orders!"}
and if I check the database after trying to edit the order I discover that the 3 fields are now empty.

This is the reported area of the model that is being modified by this vqmod operation:

Code: Select all

		  <operation error="log">
	 
      
      <search position="replace"><![CDATA[ shipping_lastname = '" . $this->db->escape($data['shipping_lastname']) . "', ]]></search>
 

      <add><![CDATA[ shipping_lastname = '" . $this->db->escape($data['shipping_lastname']) . "', shipping_stelephone = '" . $this->db->escape($data['shipping_stelephone']) . "',shipping_semail = '" . $this->db->escape($data['shipping_semail']) . "',shipping_plaintext = '" . $this->db->escape($data['shipping_plaintext']) . "', 
	]]></add>
    </operation>
If I change that code i start getting errors when I place an order. I am attaching my vqmod files (one for catalog one for admin). Please help me find the problem. The controller files for this version of Open Cart are very different from the earlier version and I wonder if I am missing something there.

Sandra King.

Attachments

latest copy of admin side.

latest copy of 1st xml file I created


Newbie

Posts

Joined
Thu Aug 01, 2013 2:51 am

Post by sandraolt » Tue Jul 14, 2015 12:27 am

Hello,
I am posting my partial solution... I created a vqmod file for the api language and controller files...

I can now edit the order in the admin section.

I still get errors when I try to view the order as a student (I had modified the view to try to show the 3 new fields in the shipping address, and I still get an error when I try to edit a customer address tab.

Warning: Please check the form carefully for errors!

Code: Select all

Notice: Undefined index: stelephone in /home/floridaschool/public_html/shoppingcart/system/modification/admin/controller/sale/customer.php on line 1027Notice: Undefined index: semail in /home/floridaschool/public_html/shoppingcart/system/modification/admin/controller/sale/customer.php on line 1030Notice: Undefined index: semail in /home/floridaschool/public_html/shoppingcart/system/modification/admin/controller/sale/customer.php on line 1030Notice: Undefined index: plaintext in /home/floridaschool/public_html/shoppingcart/system/modification/admin/controller/sale/customer.php on line 1033
I know there is probably a simple solution that I am missing, but I will keep working on it until I figure it out. Any help would be appreciated.

Attachments

These are the API modifications... Once I have everything working I will merge the files so that I have one clean modification.


Newbie

Posts

Joined
Thu Aug 01, 2013 2:51 am
Who is online

Users browsing this forum: No registered users and 6 guests