How Zen-Cart login and add to cart forms work

To login to Zen-Cart system either as a customer or a store Admin, Zen-Cart restricts access to a form that contains the securityToken value. This is a must. So if you need to build a log-in form in the outside of Zen-Cart framework, you must find a way to include this securityToken before you submit to data to the Zen-Cart login process. Beside the log-in mechanism, Zen-Cart has the cart functionality that require the securityToken also. Here’s all the data values that you need to…

Continue reading »

Modern PHP with Composer

For some of you who may not know about composer for PHP 5.3 and above, I’d like to summarize what I’ve discovered about this powerful tool so far. Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you. (composer.org). To use it, go to the website and download the Composer-Setup.exe for windows or run a terminal to get the latest Composer version by command curl…

Continue reading »

Coupon Admin fixes

This is the fix for Coupon Admin Zencart V1.5.3. If the option “All coupons” were selected, there’s no record display. This is incorrect. The coupons table has 5 valid coupons and in status “Y” and 1 coupon in status “N”. This option should display all records no matter what status it is. File changed: /admin/coupon_admin.php $status_array[] = array(‘id’ => ”, ‘text’ => TEXT_COUPON_ALL); Use this query instead: $cc_query_raw = “select coupon_id, coupon_code, coupon_amount, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_products, restrict_to_categories, date_created,date_modified, coupon_active, coupon_zone_restriction from ” . TABLE_COUPONS . “…

Continue reading »

How to debug Email in Zen-Cart

If you have an issue sending out an email from ZenCart such as order notification, regular marketing mails,… you may want to add this file into extra_datafiles, so that you’ll see the list of errors displayed on your browser. If you’re sending email from ZenCart Admin, place the file inside admin directory. – /myadmin/includes/extra_datafiles/email_debug.php If you’re sending email from Customer interface, place the file inside includes/extra_datafiles directory. The file contains this line of codes: define(‘EMAIL_SYSTEM_DEBUG’,’5′);// set to 0 to turn it off again

Continue reading »

Zen-cart email wasn’t sent thru SMTP Mail server

I hope my discovery can help some of you on Zen-Cart 1.5.3 running on Window XP. To send mail out successfully, your Windows server has to have Visual C++ 2008 redistribution package installed, OpenSSL for Windows, and some config in php.ini and Apache bin directory. 1. Enable php_openssl.dll and sockets from php.ini if phpinfo only displays “tcp, udp,” in Registered Stream Socket Transports. extension=php_openssl.dll extension=php_sockets.dll 2. Make sure that the extension_dir points to my extension directory, not the default ./ location. extension_dir = “c:/php53/ext” 3.…

Continue reading »