2013年5月14日星期二

zen cart call for price 价格面议如何把商品信息加到contact us=?UTF-8?B?6aG16Z2i?=

经过不断的google,参考了zen cart 中文论坛 关于“价格面议”的文章,及 ask a question 模块 终于把 商品相关信息成功的添加到 contact  us 页面,并且提交后,收到的咨询邮件也有商品信息,方面卖家回复客人相关问题。

4个需要更改的文件,改之前最好先备份

1./includes/languages/您的模板/english.php (或者是 /includes/languages/english.php)

增加一个定义  define(‘PROD_NAME’, ‘Product  Name: ‘);

2./includes/functions/funcitons_general.php

修改 case ($button_check->fields['product_is_call'] == ’1′):
$return_button = ‘’ . TEXT_CALL_FOR_PRICE . ‘’;
break;

为:case ($button_check->fields['product_is_call'] == ’1′):
$return_button = ‘’ . TEXT_CALL_FOR_PRICE . ‘’;
break;

这样点击call for price 按钮跳转到 contact us 页面时,你会看到 url多了 产品的id。 有了id 后面才能判断这个产品详细信息。

接下来就是编辑contact us的相关文件了。

文件3:E:butihair.comincludesmodulespagescontact_usheader_php.php

3个地方更改

1.找到$zco_notifier->notify(‘NOTIFY_HEADER_START_CONTACT_US’);  在这句下面添加以下代码:

$valid_product = false;
if (isset($_GET['products_id'])) {
$product_info_query = “select pd.products_name, p.products_image, p.products_model
from ” . TABLE_PRODUCTS . ” p, ” . TABLE_PRODUCTS_DESCRIPTION . ” pd
where p.products_status = ’1′
and p.products_id = ‘” . (int)$_GET['products_id'] . “‘
and p.products_id = pd.products_id
and pd.language_id = ‘” . (int)$_SESSION['languages_id'] . “‘”;

$product_info = $db->Execute($product_info_query);

if ($product_info->RecordCount() > 0) {
$valid_product = true;
}
}

这些代码就是判断产品id,调用产品的相关信息显示在contact us页面上。

2.继续这个页面查找 // Prepare Text-only portion of message

添加

PROD_NAME . “t” . $product_info->fields['products_name'] . “n” .
zen_href_link(FILENAME_PRODUCT_INFO, ‘products_id=’ . $_GET['products_id']) .
“nn” .

3.继续查找 $html_msg['EMAIL_MESSAGE_HTML'] = strip_tags($_POST['enquiry']);

更改为:$html_msg['EMAIL_MESSAGE_HTML'] = ‘<b>Product: </b>’ . $product_info->fields['products_name'] . ‘<br />’ . strip_tags($_POST['enquiry']);

(这些代码就是把产品信息显示在发送的邮件里)

文件4:E:butihair.comincludestemplatestemplate_default(或你的模板)templatestpl_contact_us_default.php

添加下面代码:

<?php echo ‘’ . zen_image(DIR_WS_IMAGES . $product_info->fields['products_image'], $product_info->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT) . ‘’; ?>

这段代码就是产品的相关信息模块,你可以自己选择看加在contact us页面的哪个地方

如果有有ulimate seo url 的要取消对contact us 页面url的重写.不然会没办法判断。

 

 

 

------------------------------------------------ Original from:杜岚虾米 zen cart call for price 价格面议如何把商品信息加到contact us页面

没有评论:

发表评论