1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Showing posts with label Zen Cart. Show all posts
Showing posts with label Zen Cart. Show all posts

Friday, April 1, 2011

Debug Logging - PayPal

http://www.zen-cart.com/forum/showthread.php?t=61199

In Zen Cart v1.3.7 and newer you can enable debug logging of PayPal transaction activity.

The debug logs do NOT contain your PayPal password or API certificate information. This sensitive information is masked so that it cannot be stolen and used unscrupulously.
Further, in the default configuration, there are protections in place to prevent snoops from finding and obtaining your log files, as they are named with some degree of randomness, making it virtually impossible to guess.

1. Ensure you are using Zen Cart v1.3.7 or newer, and any published PayPal patches are installed.
2. Go to Admin->Modules->Payment ... and choose your PayPal module (either IPN or Express Checkout, Payments Pro, etc). Click Edit.
3. Choose "Log to File" for your debug option. (recommend to NOT use log-to-email option)
4. Use your FTP program to mark the /includes/modules/payment/paypal/logs folder writable (ie: chmod 777). If given a "recursive" option, select "no". If asked about altering files "and" folders, say "no".
5. do some test transactions to simulate the problems you're encountering or reporting.
6. Once you've duplicated a problem with logging enabled, grab the log files related to that transaction (ie: look at the date/time on the files) and download and zip them for analysis ... ie: you may be asked to provide a link to where the zip file can be downloaded from when talking to DrByte, Ajeh, Kim or wilt. You might alternatively post the link directly in the support thread where you're discussing a reported problem.

Sunday, March 27, 2011

How do I Upgrade My Zen Cart site?

http://tutorials.zen-cart.com/index.php?article=108

3 EASY STEPS TO UPGRADE ZEN CART™


NOTE: For each new release, there are important documents in the /docs folder of the Zen Cart ZIP file. Please check the /docs/2.readme_how_to_upgrade.html file for any special notes about the version you are upgrading from/to.

Getting Started ...


This is a basic guide to upgrading Zen Cart™. If you have not yet installed Zen Cart™, please see the /docs/1.readme_installation.html file for installation instructions.

To upgrade Zen Cart™, you'll need the same basic tools you used to install and customize it in the first place: An FTP program, a text editor friendly to HTML/PHP code, phpMyAdmin or equivalent access to your MySQL database, and your Control Panel for managing your webspace.

Additionally, you will find a file-comparison tool (see here for a list of recommended tools: http://www.zen-cart.com/wiki/index.php/Useful_Tools ) is invaluable. (The free tools offer 2-way comparison. The more advanced paid-for tools offer 3-way comparisons which can be very handy, but costly.)

Upgrading follows 3 easy steps. We suggest you take your time going through each stage carefully and methodically. Don't rush the process. And as always, be sure you keep good backups first.

We highly recommend you pay special attention to getting familiar with the demo data in the new version, so that you can become comfortable with the many new features contained in the new release.

1. Preparation


Unzip a copy of the new version of Zen Cart™, upload it to your webserver into a "demo" folder, and install the new version into a separate database, and include the Demo products. This is just for a place for you to play with the new version and get used to its new features. These can be deleted after conversion is complete.

Study the new features, and the documented changes to the template structures, as well as the "changelog". Use the demo products in the demo shop as examples. See also the supporting documentation provided with the new release.

Make a full backup of your database (dump to SQL file). Store this file on your PC for later reference.

Make a full backup of your site files (ftp to your PC and zip it up for safe-keeping).
Keep the backup on your PC to use in next steps. Perhaps call this folder "\zen_backup".

Now let's find out the differences/customizations details between your site and the original Zen Cart™ files. (You can find older versions here:http://sourceforge.net/projects/zencart/files/ )

Unzip a copy of the original Zen Cart™ files for the version you originally installed or last upgraded from (ie: perhaps v1.1.3 or even 1.2.0). This should be placed in a separate working folder on your PC (perhaps "\zen_orig").

Make a list of any add-ons you have installed, for later reference.

Run a tool like WinMerge to compare the "Original" Zen Cart™ files in "\zen_orig" against your working backup files in "\zen_backup".
Note all the files that are "different". In WinMerge, double-click on each file and note what the differences are.
If the differences are just language defines for display text, those will be simple to carry forward.
If the differences are actual programming/code differences, you will need to make detailed notes in order to carry over those changes to the new new new version.
Any mods/add-ons you've installed will likely contain many programming changes, and may not be fully compatible with the newer Zen Cart™ release.

Your list of add-on's may help you narrow down the source of any differences you're finding between versions. You may have to download the add-on again to take a look at the readme or code contained in it. You may have to contact the author to ask for an updated version.

As you make your list of changed files, etc, at this stage, you may want to move things into the Zen Cart™ template-override structure, if you haven't already done so. See the Template System Documentation for help on the template system.

2. Execution


Download and unzip the latest Zen Cart™ version to your PC. This will be in a 3rd directory (perhaps "\zen_new"), separate from the other two folders compared above.

Using the list of files you made earlier, go through each "changed" file, and make your changes from the old version into the new version.
Simple language edits will be just a matter of copy-and-paste.
Programming changes to core components will be more difficult and require significant testing.
You may find WinMerge handy at this stage to apply edits as well. However, you will see many extra differences that may not be related to your own customizations, or that may conflict. Be careful making changes to program code.

Note that there will be several changes you will have to make to files that you have overridden using the template overrides system. Thus, you'll want to compare files from /includes/templates/MYTEMPLATE/* to /includes/template/template_default/* ... and the same with language file overrides, sideboxes, etc.

3. Testing


Make a NEW database to install the new version of Zen Cart™ into.

If the last backup you made of your data is older than the last order that might have been processed or customer registration, make a fresh database backup.
Restore your database from the backup in step #1 earlier into your NEW database just created.

If your /zen_new folder doesn't have "/includes/configure.php" and "/admin/includes/configure.php" files, copy them from your old store folder.

EDIT your "/zen_new/includes/configure.php" file and ensure that the DIR_FS_CATALOG and DIR_WS_CATALOG and DIR_FS_SQL_CACHE (and other path settings too) correctly match your NEW directory structure on the server.

EDIT your "/zen_new/includes/configure.php" file and ensure that your DATABASE_NAME matches your NEW database. Also verify database username and password in case that information has changed. Save this file, and be sure to upload it as part of the next step:

Upload the files from your modified "new version" (created in step 2) to your server, into an alternate folder, perhaps called "/store_new".

Run /zc_install/index.php and choose "Upgrade" when prompted. (Don't select "Install", or you will overwrite your database.) (If "Upgrade" is not offered, then the installer was unable to connect to your database to confirm what version its structure is at. Check your configure.php settings.)

Test your customizations. Edit as needed. Compare with the test/demo install performed earlier, as needed.

When satisfied that all is OK, go live.
If significant time has passed since you did your last backup, you may want to repeat the steps in this "Testing" section again, using a fresh backup from your live shop. You don't need to re-upload files again ... simply do the database restore, and run the installer to do the database upgrade again.

To go live, put your shop into "Down for Maintenance" mode in the admin area. Be sure to add your IP address to the list of allowed addresses to get into the site for previewing.
This can be done easiest by renaming "store_new" to "store". (You'll have to rename "store" to something else first.)
Test it to be sure that things are operating as desired. If you have small problems to repair, turn "Down for maintenance" on and off again as necessary.

NOTES

Remember that your "configure.php" files on your server are typically set to read-only, and thus in order to upload them will require that you mark those files read-write before uploading. Be sure to put them back to read-only after uploading.

Saturday, March 26, 2011

升级到 Zen Cart v1.3 的步骤

http://www.zen-cart.cn/forum/topic967.html
: Zen Cart 中文支持 : 新手上路

Jack » 2006-04-06 2:14

假设现有的商店安装在/shop

1 新建目录/new_shop

2 复制文件
/shop/includes/configure.php 到 /new_shop/includes/configure.php
/shop/admin/includes/configure.php 到 /new_shop/admin/includes/configure.php

如果是从1.3.8 以下版本升级 ,这两个文件中需要增加一行 define('DB_CHARSET', 'utf8');

3 备份现有的商店数据库

4 新建一个数据库

5 将备份的商店数据库导入新建的数据库中

6 修改新建目录中的两个 configure.php 文件, 设置好新的数据库名、用户名、密码等

7 将所有Zen Cart v1.3的文件上传到 /new_shop

8 运行 /new_shop/zc_install

注意: 当提示升级时,从最早版本开始升级,一次选中一个升级选项

测试新的 /new_shop v1.3 商店 ...

接着,备份你的现有商店中的模板文件以及替代文件,上传到 /new_shop 下的相应目录 ...

用文件比较工具,例如WinMerge,来比较你的替代文件与zen cart新版本中文件的不同,并做修改

这要花一些时间了 ...

一切都正常后,测试各种功能 ...

1 新建帐号
2 添加商品到购物车
3 结帐
4 电子邮件
5 购物记录
6 订单
等等

一切正常,那么可以切换现有的商店了 ...

1 将现有商店设置为“商店维护中” ...

2 备份现有商店数据库 (在你开始安装/new_shop后,也许现有的商店数据库内容已经有了变化)

3 清空新建的数据库内容,导入刚备份的最新数据库

4 运行 /new_shop/zc_install

说明: 因为刚导入了新的数据库,所以要再执行一次升级过程 ...

升级后,再次检查网站正常

说明: 升级后,使用的是新建的数据库,你可以保留旧的数据库作为备份

修改两个 configure.php 文件,将 /new_shop 改为 /shop

再次说明,不要改动这两个文件中新的数据库的设置。

将现有商店 /shop 改名为 /old_shop

将新商店 /new_shop 改名为 /shop

测试新的商店 ...

关闭“商店维护中” 的设置 ...

升级结束!

Wednesday, February 10, 2010

The Zen Cart Execution Process

以:http://192.168.0.161/lightbox/index.php?main_page=account 为例

We know $main_page=account

index.php will do the following:

1. it loads 'includes/application_top.php'

This file will load in all of general definitions used site-wide, initialize some site-wide classes ($template, $db) and do other general stuff.

2. it loads all of the files starting with 'header_php' in 'includes/modules/pages/account'

'header_php.php'

3. now it loads from includes/templates/mytemplate/common/

'html_header.php'

The default html_header.php file will simply create all of the HTML up to the </head> tag

It loads 'includes/modules/meta_tags.php',

It loads 'includes/templates/mytemplate/css/style*.css'

It loads 'includes/templates/mytemplate/js/jscript_*.js'

'main_template_vars.php'

set $body_code to: includes/templates/mytemplate/templates/tpl_{$main_page}_default.php (tpl_account_default.php)

Here all of the program logic and variables will be mixed up with the actual displayed HTML code

'tpl_main_page.php'

this file lays out the basic page.

1. <body>

2. loads the 'includes/modules/header.php' file

3. if the left column is enabled, it loads 'includes/modules/column_left.php'

4. it loads the file set in $body_code (tpl_{$main_page}_default.php &#20063;&#23601;&#26159;: tpl_account_default.php)

5. if the right column is enabled, it loads 'includes/modules/column_right.php'

6. loads 'includes/modules/footer.php'

7. </body>

Reference: The Zen Cart Execution Process

Wednesday, December 2, 2009

The Zen Cart Execution Process

The Zen Cart Execution Process

Zen Cart, like most open-source code, is a largly undocumented. Luckily for us, it also has a habit of mixing in much of it's program/application logic with it's actual HTML design, so it's not only undocumented, it's also hard to browse the HTML code. To top it off, it also has a dynamic template loader, which means that the program logic and HTML templates could be in any one of four different directories. Also undocumented, and of dubious usefullness.

The result is that it's not only difficult to browse through the program logic and HTML code, but you often don't even know which files are going to get loaded.

This document is an attempt to sort through the overarching structure of how Zen Cart tends to work.

index.php steps:

Here's where all of action begins.
  1. it loads 'includes/application_top.php'
  2. if $main_page isn't set, it gets set to 'index'
  3. if the directory 'includes/modules/pages/$main_page' doesn't exist, $main_page gets set to 'index'
  4. it loads all of the files starting with 'header_php' in 'includes/modules/pages/$main_page'
  5. now it loads 'html_header.php' from the first first place it finds it from the following directories
    1. includes/templates/mytemplate/$main_page/
    2. includes/templates/template_default/$main_page/
    3. includes/templates/mytemplate/common/
    4. includes/templates/template_default/common/
  6. now it does the same thing for finding and loading 'main_template_vars.php'
  7. now it does the same thing for finding and loading 'tpl_main_page.php'
  8. Finally it displays the '</html>' tag. Why display it here when the '<html>' tag is displayed somewhere else? Who knows.

application_top.php steps:

This file will load in all of general definitions used site-wide, initialize some site-wide classes ($template, $db) and do other general stuff.

html_header.php steps:

The default html_header.php file will simply create all of the HTML up to the </head> tag It loads 'includes/modules/meta_tags.php', which uses a bloated switch statement to figure out what the site's title, meta-keywords, and meta-description should be. It tries to find the css directory, and loads in it all stylesheets that begin with 'style' and end with '.css' It does the same thing for the jscript directory, and tries to load all files that begin with 'jscript_' and end with '.js'

main_template_vars.php steps:

it simply sets $body_code to the first of:
  1. includes/modules/pages/$main_page/main_template_vars.php
  2. includes/templates/mytemplate/$main_page/tpl_{$main_page}_default.php
  3. includes/templates/template_default/$main_page/tpl_{$main_page}_default.php
  4. includes/templates/mytemplate/templates/tpl_{$main_page}_default.php
  5. includes/templates/template_default/templates/tpl_{$main_page}_default.php
that's it.

tpl_main_page.php steps:

this file lays out the basic page.
  1. <body>
  2. loads the 'includes/modules/header.php' file
  3. if the left column is enabled, it loads 'includes/modules/column_left.php'
  4. it loads the file set in $body_code
  5. if the right column is enabled, it loads 'includes/modules/column_right.php'
  6. loads 'includes/modules/footer.php'
  7. </body>

includes/modules/pages/$main_page/main_template_vars.php steps:

this is where the meat of the actual content if loaded and displayed. it typically does all of the program logic first, sets all of the necessary variables, and then loads the template file. As usual, the template file is loaded from the first of the following:
  1. includes/templates/mytemplate/$main_page/
  2. includes/templates/template_default/$main_page/
  3. includes/templates/mytemplate/templates/
  4. includes/templates/template_default/templates/
The standard is that the template file will be named 'tpl_SOMENAME.php'. Note that it doesn't end with '_default.php'. The undocumented naming convention is that files that end with '_default.php' are files that get loaded with it can't find the 'includes/modules/pages/$main_page/main_template_vars.php' file.

tpl_{$main_page}_default.php steps:

If it doesn't find the above file and it instead finds a tpl_*_default.php file, then it means that all of the program logic and variables will be mixed up with the actual displayed HTML code. In Zen-Cart's defense, this generally means that there's not a lot of program logic to be had here, hardly any really, but it's still damn annoying to be mixing the program logic with design. No sir, I don't like it one bit.

Future Updates

Eventually this document will also cover the process by which the program loads in the language files, such as "english.php" and the content files like "privacy.php" and "conditions.php." The Zen Cart creators actually created these files with the idea that they would be a part of your custom template, which is a clear violation of the content/design seperation.

This document will also cover sideboxes (which requires a whole nother custom template directory). As an interesting sidenote, when you switch to a new template, all of the sideboxes get turned off. The level of user-unfriendliness of Zen Cart is amazing to me sometimes.

Monday, November 16, 2009

What's the difference between PayPal Standard, Express, and Pro?

Zen Cart(tm) Tutorials and FAQs - What's the difference between PayPal Standard,...

PayPal Express Checkout gives the customer two options: They can jump over to the PayPal site to login to their account BEFORE completing checkout on your store (which allows them to select their address information there and never have to re-type their address details on YOUR site, thus the "express" part of the transaction) and then choosing shipping choices and discounts/coupons etc before completing the order ....... OR they can go to the PayPal site to login to their account AFTER making shipping/payment/coupon selections on your site (and creating an account on your store and typing their address info on your store), much like they do with Standard.
With Express Checkout, the customer can pay without having a PayPal account (as long as you have "PayPal Account Optional" enabled inside your PayPal merchant account settings: Profile->Hosted Payment Settings->Website Payments Preferences->PayPal Account Optional = ON), except for merchants/customers in China.
One important benefit is that Express Checkout does not rely entirely on the IPN communications to your store in order to release the order. Instead, it stores the order immediately when payment is completed. It doesn't have to rely on the PayPal server to talk to your server in order to store the order. Granted, you will still want PayPal's server to be able to send IPN updates to you for any orders, in case you do refunds or adjustments to the order... so that those updates are reflected in your store's order history.
Express Checkout has all the same features as Website Payments Standard, but is more reliable because it completes the transaction directly while the customer is actively engaged on your site. It supports all the currencies, payment methods, etc, just the same, but more efficiently.

PayPal sees Express Checkout as a payment option that's offered in addition to other payment choices such as a credit card gateway, and that adding Express is a way to allow PayPal members a very quick and easy way to pay using their PayPal account. Many merchants do use Express Checkout as their sole payment processing option, even without a credit card gateway.

Many merchants also add Website Payments Pro:

Website Payments Pro appears to the customer only as a couple fields to enter their credit card number directly on your website. They have no idea that in the background you're processing their card via PayPal. They have to make an account on your site, and supply the address details, but once they confirm the order, the payment is collected immediately and the order saved. It doesn't rely on IPN to release the order. However, it does store any transaction updates done on the PayPal end such as refunds etc as long as IPNs can be received by your server. Website Payments Pro is currently only offered in the USA, UK, and Canada. A monthly service charge applies, and there is an account application process and credit check to complete before the feature can be activated on your account. PayPal Express Checkout must be enabled in order for Website Payments Pro to be offered on your site.

PayPal sees Website Payments Pro as a payment gateway for handling credit cards. That's exactly what it is. Coupled with Express Checkout, it gives your customers the maximum amount of choice about how to pay: either by credit card directly on your site, or by using their PayPal account to submit payment.

PayPal Website Payments Standard (formerly referred to as "PayPal IPN" in older versions of Zen Cart) takes the customer to PayPal's site AFTER the ENTIRE checkout in order to make payment. The customer can pay without having a PayPal account (depending on what country YOU are in ... PayPal limits that feature for some countries). After the payment is completed, your store is notified of the completed payment, after which time the order is stored in your database. If the customer pays without making a PayPal account and closes their browser when presented with the invitation to make one, your store sits in limbo and never gets the order (due to a bug in PayPal's logic, which they've not fixed yet). If they DO have OR make a PayPal account, you get the notification and the order is stored in your database.
**IF there is any problem in PayPal's ability to communicate to your server, you will never see the order in your store (or receive the confirmation email from your store), because it relies entirely on PayPal's server being able to talk to your server in order to store the order.

PayPal sees Website Payments Standard as a solution for merchants wanting to collect payments on their site easily, especially if they have no other payment method available.
Zen Cart recommends using Express Checkout instead of Website Payments Standard.


More information about the various PayPal services can be found on the PayPal website.


Another much-less-commonly-asked-about PayPal service is:

Payflow Pro is essentially *only* a merchant account. Transactions conducted via Payflow Pro (for US Merchants) do not appear in your PayPal account ... instead, they are forwarded directly to your merchant bank account. Basically, Payflow Pro is just like any other traditional payment gateway (akin to Authorize.net etc). In North America you can connect the Payflow Pro service to your own merchant bank account. In the UK, the Payflow Pro service is actually bundled as a hybrid service with Website Payments Pro, connecting all the transactions to your UK PayPal account, and all monies are deposited to your PayPal account, instead of directly to your bank account.
Zen Cart does not have built-in support for the US Payflow Pro service. However, there is a free addon which can be used for this purpose if required.

Please see PayPal's website for more Payflow and PayPal information.

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...