{"id":1966,"date":"2018-10-11T08:52:38","date_gmt":"2018-10-11T12:52:38","guid":{"rendered":"http:\/\/www.thatsoftwareguy.com\/blog\/?p=1966"},"modified":"2018-10-11T08:52:38","modified_gmt":"2018-10-11T12:52:38","slug":"showing-zen-cart-customer-updates-needed-by-salesforce","status":"publish","type":"post","link":"https:\/\/www.thatsoftwareguy.com\/blog\/2018\/10\/11\/showing-zen-cart-customer-updates-needed-by-salesforce\/","title":{"rendered":"Showing Zen Cart Customer Updates needed by Salesforce"},"content":{"rendered":"<p>If you&#8217;ve installed my <a href=\"https:\/\/www.thatsoftwareguy.com\/zencart_to_salesforce_customers.html\">Zen Cart to Salesforce Customer Import<\/a> tool, and done a few exports of customers from your admin, you&#8217;d probably like an easy way to see how many updates (if any) are outstanding when you login to your Zen Admin.<\/p>\n<p>I have made a small modification to the admin dashboard (in Zen Cart 1.5.5) to do this, which is described below.\u00a0 Steps:<\/p>\n<p>a) Add the define <code>BOX_ENTRY_UPDATES_TO_SALESFORCE<\/code> to <code>admin\/includes\/languages\/english\/index.php<\/code>.<\/p>\n<pre>define('BOX_ENTRY_UPDATES_TO_SALESFORCE','New\/Updated records for Salesforce');<\/pre>\n<p>b) Add the logic to calculate and display the number of new\/updated records to admin\/index_dashboard.php.<\/p>\n<p>Calculate it below the salemaker query on line 31:<\/p>\n<pre>$last_export = $db-&gt;Execute(\"SELECT * FROM \" . TABLE_SFDC_CONFIG);\r\n$last_customers_export = $last_export-&gt;fields['last_customers_export'];\r\n$salesforce_customers_query = \"SELECT count(*) AS count FROM \" . \r\n   TABLE_CUSTOMERS . \" c, \" . TABLE_ADDRESS_BOOK . \" a, \" . \r\n   TABLE_CUSTOMERS_INFO . \" ci WHERE a.customers_id = c.customers_id \r\n   AND a.address_book_id = c.customers_default_address_id AND \r\n   ci.customers_info_id = c.customers_id AND \r\n   (ci.customers_info_date_account_created &gt; '\" . \r\n   $last_customers_export . \"' OR \r\n   ci.customers_info_date_account_last_modified &gt; '\" . \r\n   $last_customers_export . \"')\";\r\n$salesforce = $db-&gt;Execute($salesforce_customers_query);<\/pre>\n<p>Now display it below the customers count display on line 72:<\/p>\n<pre> \r\necho '&lt;div class=\"row\"&gt;&lt;span class=\"left\"&gt;\r\n   &lt;a href=\"' . zen_href_link(FILENAME_SFDC_EXPORT_CUSTOMERS) . '\"&gt;' . \r\n   BOX_ENTRY_UPDATES_TO_SALESFORCE . '&lt;\/a&gt;&lt;\/span&gt;\r\n   &lt;span class=\"rigth\"&gt; ' . $salesforce-&gt;fields['count'] . '&lt;\/span&gt;&lt;\/div&gt;';<\/pre>\n<p>The typo in the class name <em>right<\/em> is required in Zen Cart 1.5.5; it has been fixed in Zen Cart 1.5.6.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve installed my Zen Cart to Salesforce Customer Import tool, and done a few exports of customers from your admin, you&#8217;d probably like an easy way to see how many updates (if any) are outstanding when you login to your Zen Admin. I have made a small modification to the admin dashboard (in Zen &hellip; <a href=\"https:\/\/www.thatsoftwareguy.com\/blog\/2018\/10\/11\/showing-zen-cart-customer-updates-needed-by-salesforce\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Showing Zen Cart Customer Updates needed by Salesforce<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90,58,78],"tags":[],"class_list":["post-1966","post","type-post","status-publish","format-standard","hentry","category-salesforce","category-that-software-guy","category-zen-cart"],"_links":{"self":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/comments?post=1966"}],"version-history":[{"count":4,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1966\/revisions"}],"predecessor-version":[{"id":1970,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1966\/revisions\/1970"}],"wp:attachment":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/media?parent=1966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/categories?post=1966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/tags?post=1966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}