How to solve ZenCart upgrading issues
Many of my customers ask me why after upgrade a new version, their online store is working fine but the Admin Login is broken. Some store has front-end broken due to heavy customization. It just displays a blank page. So, this is what you can do to check and re-config everytime you upgrade. It doesn’t guarantee that it’ll work but these are the minimal things you must check before modifying any codes and logic.
1) If you’ve heavily customized lot of codes and product attributes modules on your site, make sure all those codes don’t get overwritten by Zen-Cart upgrade.
2) Go to YOUR-ADMIN-DIR/includes/ directory. Open Read+Write permission to the file called configure.php. Open it in an editor and start changing some parameters/values that are applied to your server environment.
3) Add a new file called test.php in the root. Type this codes:
<?php echo $_SERVER['DOCUMENT_ROOT']; ?>
Run this file in browser. Then use this value to replace in your configure.php file. Make sure the store reads the correct path on your (new) server.
4) Make sure all tables in MySQL Database are not corrupted during data import by opening each table to review data and structure.
5) Run MySQL query to compare the old and new tables in Database. Make sure they both have the same number of tables. Some may get lost during data transfer, who knows.
SQL Query:
SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA='ZenCartStore'
If you found the mismatch, try to import data again or just import those missing tables.
6) Remove all sessions in database to make sure that all old sessions using old encryption method are gone.
7) Check configuration table in database to make sure all old & new config keys + values are there.
Finally, if it’s still not working, please DO NOT modify any codes if you don’t know the ZenCart functions and logic. I’d recommend to hire ZenCart or at least PHPMySQL developer to look at it and fix it. Once you upgrade, you can’t revert if you didn’t back up database and your file system before upgrading.
HOW TO USE the HTML Mail Template System
To customize ZenCart email template such as adding company logo, slogan, add border, background, images so that it can represent your business professionally, you’ll need to know the email structures of ZenCart. Open email folder to see all the email templates pre-defined by ZenCart, then you can start from there. The following info is from ZenCart docs that you can refer to when modifying all the codes that are related to email templates such as Welcome email, order processed email, contact-us, password forgotten, tell-a-friend,…
The email template system operates through the email_*.htm files in your /email folder.
Since HTML-based email standards are varied more widely than the shape of each cloud in the sky, it’s impossible to predict the behaviour of any email client’s output rendering. Thus, linked stylesheets are not recommended. Some clients will completely reject an email that has a stylesheet link ref in it.
In coding your HTML email message templates, it’s best to code to HTML 3.2 and CSS1 standards for optimum compatibility.
TEMPLATE SYSTEM KEYWORDS MATRIX
The following key words are replaced with active HTML by the various modules. Simply retain them in any revisions you make to your template structure, and all should come out just fine !!!
Note that all template tags should be prefixed with a $
All Modules
$EMAIL_FIRST_NAME (most modules supply the customer names)
$EMAIL_LAST_NAME
$EMAIL_TO_NAME
$EMAIL_TO_ADDRESS (TO: email address)
$EMAIL_FROM_NAME
$EMAIL_FROM_ADDRESS (FROM: email address…. default is EMAIL_FROM defined in Admin)
$EMAIL_STORE_NAME (Defined in Admin | My Store)
$EMAIL_STORE_OWNER (Store Owner’s NAME — defined in Admin)
$EMAIL_STORE_URL (Preformatted A HREF for your store’s URL, using STORE_NAME for the displayed text)
$EMAIL_DATE_LONG (ie: Monday June 14, 2004 11:28 am)
$EMAIL_DATE_SHORT (ie: 06/14/2004)
$BASE_HREF (store http root)
$EXTRA_INFO (this is the “office-use-only” section at the bottom of messages cc’d to Admin)
These 3 are defined in “languages/…./email_extras.php”:
$EMAIL_DISCLAIMER (general disclaimer)
$EMAIL_SPAM_DISCLAIMER (disclaimer re: SPAM — should be customized to your country’s laws…and of course you should abide by them!)
$EMAIL_FOOTER_COPYRIGHT
$EMAIL_MESSAGE_HTML (this is any composed text (via editors) that you plan to send)
ADMIN AREA:
Coupon
Dear $EMAIL_FIRST_NAME $EMAIL_LAST_NAME,
$EMAIL_MESSAGE_HTML (message composed in Admin)
$COUPON_TEXT_TO_REDEEM (“You’ve received a coupon”)
$COUPON_TEXT_VOUCHER_IS (The voucher number is:”)
$COUPON_CODE (Actual voucher number)
$COUPON_DESCRIPTION (Coupon description, if supplied in Admin area when coupon was created)
$COUPON_TEXT_REMEMBER (“Keep this number safe so you don’t forget it”)
$COUPON_REDEEM_STORENAME_URL (“To redeem, come visit us at our store: +URL”)
GV-Mail-From-Admin
Dear $EMAIL_FIRST_NAME $EMAIL_LAST_NAME
$EMAIL_MESSAGE_HTML (Message composed in Admin)
$GV_WORTH (“You’ve received a GV worth: ” )
$GV_AMOUNT (GV amount)
$GV_REDEEM (To redeem, goto our store, or click here:)
$GV_CODE_URL (URL to redeem GV)
GV-Queue in Admin (to release purchased GV’s after screening)
Dear $EMAIL_FIRST_NAME $EMAIL_LAST_NAME
$GV_NOTICE_INTRO (You purchased a GV from our store: URL) (optional)
$GV_NOTICE_AMOUNT_URL (You purchased a GV of $$$$ from our store: URL)
$GV_NOTICE_VALUE (Amount of GV purchased, and now being released)
$TEXT_REDEEM_COUPON_MESSAGE_BODY (null unless defined in lang file)
$TEXT_REDEEM_COUPON_MESSAGE_FOOTER (null unless defined in lang file)
Low Stock
– $EMAIL_SUBJECT
– $EMAIL_MESSAGE_HTML — contains the low-stock details generated by the checkout process
Newsletters & Product Notifications, and Admin Emails
Dear $EMAIL_FIRST_NAME $EMAIL_LAST_NAME,
$EMAIL_MESSAGE_HTML (composed by Admin)
Order Status Updates from Admin
$EMAIL_CUSTOMERS_NAME (extracted from Orders table — combines first/last names based on what’s in DB)
$EMAIL_STORE_NAME
$EMAIL_TEXT_ORDER_NUMBER (Order Number from database)
$EMAIL_TEXT_INVOICE_URL (URL to access “My Account History”)
$EMAIL_TEXT_DATE_ORDERED (Order Date)
$EMAIL_TEXT_STATUS_UPDATED (“Has been updated to:”)
$EMAIL_TEXT_STATUS_LABEL (“New Status:”)
$EMAIL_TEXT_NEW_STATUS (actual status description and comments)
$EMAIL_TEXT_STATUS_PLEASE_REPLY (“Please reply to this address if you have questions”)
Password Forgotten:
$EMAIL_SUBJECT (“password reset requested”)
$CUSTOMERS_NAME (Admin or customer’s name)
$EMAIL_MESSAGE_HTML (actual pwd reset info)
CATALOG AREA:
Contact-Us
$CONTACT_US_OFFICE_FROM (Office-Use: contains from email address & contact name)
$EMAIL_MESSAGE_HTML (message composed by customer to admin)
Welcome Email
$EMAIL_GREETING (Mr/Ms/Dear + first and/or last-names)
$EMAIL_WELCOME (“Welcome to ….storename….”)
$COUPON_BLOCK … this already CONTAINS the following, and is only displayed IF they have been set for new customers via the Admin | My Store | GV/Coupons.
…..$COUPON_TEXT_VOUCHER_IS
…..$COUPON_DESCRIPTION
…..$COUPON_TEXT_TO_REDEEM
…..$COUPON_CODE
$GV_BLOCK … this already contains the following, and is only displayed if GV’s have been set for new customers, see coupons above.
…..$GV_WORTH
…..$GV_REDEEM
…..$GV_CODE_URL
$EMAIL_MESSAGE_HTML (the actual welcome message: defined by the “EMAIL_TEXT” constant)
$EMAIL_CONTACT_OWNER
$EMAIL_CLOSURE
GV Send to a friend, after purchased and applied to my account
GV Pic is displayed, with these beside it:
……$EMAIL_GV_AMOUNT
……$GV_REDEEM_CODE
$EMAIL_STORE_NAME
$EMAIL_GV_TEXT_HEADER (I’m sending you a GV)
$EMAIL_GV_AMOUNT (Amount of)
$EMAIL_GV_FROM (From my name)
$EMAIL_GV_MESSAGE (“With a message from me”)
$EMAIL_GV_SEND_TO (Your name)
$EMAIL_MESSAGE_HTML (My message — entered before sending)
$GV_REDEEM_HOW (How to redeem the GV)
$GV_REDEEM_URL (URL to redeem)
$EMAIL_GV_FIXED_FOOTER (If you’re having problems redeeming, enter it during checkout, or contact storeowner)
$EMAIL_GV_SHOP_FOOTER (null at present)
Tell-A-Friend
$EMAIL_TEXT_HEADER (“Important Information”)
$EMAIL_GREET (“Hi _____”)
$EMAIL_INTRO (“Your friend thought you might like this. Here’s their message:”)
EMAIL_MESSAGE_HTML (Message composed by referrer)
$EMAIL_PRODUCT_LINK
$EMAIL_CONTACT_STORE
Order-Confirmation
$EMAIL_TEXT_HEADER (“Order Confirmation”)
$INTRO_STORE_NAME
$INTRO_ORDER_NUM_TITLE (“Order Number:”)
$INTRO_ORDER_NUMBER (actual order number)
$INTRO_DATE_TITLE (“Ordered on:”)
$INTRO_DATE_ORDERED (Date ordered)
$INTRO_URL_TITLE (Description in A HREF to My Account)
$INTRO_URL_VALUE (A HREF to My Account)
$ORDER_COMMENTS (Customer’s comments entered at order time)
$PRODUCTS_TITLE (“Product Details:”)
$PRODUCTS_LIST (Detailed list of products and attributes and prices)
$ORDER_TOTALS (Order totals)
$HEADING_ADDRESS_INFORMATION (“Address Info:”)
$ADDRESS_DELIVERY_TITLE (“Delivery address:”)
$ADDRESS_DELIVERY_ADDRESS (Actual delivery address on order)
$SHIPPING_METHOD_TEXT (“Shipping Method”)
$SHIPPING_METHOD_TITLE (Shipping method selected)
$ADDRESS_BILLING_TITLE (“Billing address:”)
$ADDRESS_BILLING_DETAIL (Billing address on order)
$PAYMENT_METHOD_TEXT (“Payment Method:”)
$PAYMENT_METHOD_TITLE (Payment method selected)
$PAYMENT_METHOD_FOOTER (Payment method footer, if any)
Displaying scrolling DIV box
Sample for scrolling DIV box. You can scroll horizontally or vertically using overflow-x or overflow-y
CSS stylesheet:
#preview{
color:#cc0000;
font-size:12px;
border:1px #ff0000 solid;
overflow: auto;
white-space: nowrap;
width: 300px;
}
.imgList{
max-height:150px;margin-left:5px;
border:1px solid #dedede;
padding:4px;
/* float:left; //not working in this case if you want div scrolling horizontally */
display: inline-block;
/* display:inline; not working in this case */
}
HTML page:
<div id='preview'></div> <form id="imageform" method="post" enctype="multipart/form-data" action='ajaxImageUpload.php' style="clear:both"> <h1>Upload your images</h1> <div id='imageloadstatus' style='display:none'><img src="loader.gif" alt="Uploading...."/></div> <div id='imageloadbutton'> <input type="file" name="photos[]" id="photoimg1" multiple="false" /> <p> </p> <input type="file" name="photos[]" id="photoimg2" multiple="false" /> <p> </p> <input type="file" name="photos[]" id="photoimg3" multiple="false" /> <p> </p> </div> </form> </div>
X-Cart Payment with AuthorizeNet CIM
My instruction here is for PHP/ X-Cart developer only. Some businesses may already have customer credit card information thru AuthorizeNet CIM system. All you’ll do is adding some files and functions to charge the existing credit card instead of asking customers to enter credit card information again on every purchase.
Here’re some steps to follow to integrate CIM in your X-Cart.
Step 1: Register with AuthorizeNet the CIM feature. It may cost a little monthly fee by Authorize.Net.
Step 2: FTP to your server. Go to X-Cart root directory. Look for these files
payment/payment_offline.php
include/cart_process.php =>check if user has credit card on file by
Step 3: Create a new file and write some new functions to charge customers from their existing credit cards. Remember, it’s illegal to store customer credit card number in your database. You must use AuthorizeNet CIM to store credit card information. Then AuthorizeNet will return a Profile IDs for next time usage:
New file: /payment/cc_authorizement_cim.php
function charge_existing_creditcard()
function func_get_ccard_type()
function get_authnet_payment_profile_id()
Step 4: Follow instruction to integrate with AuthorizeNet CIM payment method.
Step 5: Add a new payment called “AuthorizeNet CIM” and activate it thru X-Cart Store Admin interface. Check the Activate button for this payment method.
How to enable multiple products per row on front page
For some small retailers who have million online products, you can log in to Zencart Store Admin in the back-end, select Index Listing under Configuration menu, set how many products per row you’d like to be displayed on the front page. By default, it’s 3. 

