If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Shipping Modules / Shipstation Tweak for v156 - Updated By

Shipstation Tweak for v156 - Updated By

Locked

Started by apollowilcox on 20 Jan 2020, 7:19 PM · Views: 5,335

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
20 Jan 2020, 7:19 PM
#1
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Post #1 by apollowilcox

ZC 1.5.6 has a new field in the table zen_orders_status_history which is titled 'Updated_by' and shows the username of the person creating the update.

For a very minor update, you can make the following change to the shipstation_zc.php file so that any updates by Shipstation will show the username instead of just a blank.

Around line 346, find the section that looks similar to this and replace it with this code:

$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
                          (orders_id, orders_status_id, date_added, customer_notified, comments, updated_by)
                          values ('" . (int) $_GET['order_number'] . "',
                          '" . zen_db_input($status) . "',
                          now(),
                          '" . zen_db_input($customer_notified) . "',
                          '" . zen_db_input($comments) . "',
                  '" . zen_db_input($_GET['SS-UserName']) . "')");

Again, quite minor, but thought we would share it.

20 Jan 2020, 8:07 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,146
Plugin Contributions:
56

Post #2 by lat9

Yep, I've been applying that change to the sites I manage that use shipstation and have the 'updated_by' field (whether via the plugin or zc156).

Update: Just make sure to wrap that $_GET value with zen_db_input ... just in case there are single-quotes in the shipstation-admin's name. I usually just hardcode the updated_by field as 'shipstation'.

20 Jan 2020, 8:53 PM
#3
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Post #3 by apollowilcox

Thank you lat9. Both valid points. :smile:

14 May 2021, 6:37 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #4 by drbyte

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.