duanmoen784988 2014-10-30 09:39
浏览 45
已采纳

在zencart注册/结帐中禁用Zipcode字段

Please help with this little zen-cart challenge.

Some fields especially the zip code is/are not required for the running of my online store as not all area where shipping covers has for example zip codes. The question is therefore how to disable those fields that are not necessary for signup/check in zen-cart. Can anyone help please

  • 写回答

2条回答 默认 最新

  • duanquyong8164 2014-10-31 09:16
    关注

    To make the field not required, you have to do 2 things.

    Go to includes/languages/YOUR_TEMPLATE_NAME/english.php (or your specific language file) and remove the *

    example, for Post Code:

    In english.php, it says (around line 200):

    define('ENTRY_POST_CODE', 'Post/Zip Code:');
    define('ENTRY_POST_CODE_ERROR', 'Your Post/ZIP Code must contain a minimum of ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.');
    define('ENTRY_POST_CODE_TEXT', '*');
    

    and change it to:

    define('ENTRY_POST_CODE', 'Post/Zip Code:');
    define('ENTRY_POST_CODE_ERROR', 'Your Post/ZIP Code must contain a minimum of ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.');
    define('ENTRY_POST_CODE_TEXT', ''); // *removed
    

    then, go to your www.yourshop.com/YOURadmin and in configuration> minimum values clear out the number for Post/Zip Code.

    to completely remove it from your page, you have to go to includes/templates/YOUR_TEMPLATE_NAME/tpl_modules_create_account.php and remove the code block for this specific entry. Something really similar to this:

    <label class="inputLabel" for="postcode"><?php echo ENTRY_POST_CODE; ?></label>
    <?php echo zen_draw_input_field('postcode', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', '40') . ' id="postcode"') .
    (zen_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="alert">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?>
    <br class="clearBoth" />
    

    You can start reading something about customization for zencart on zencart wiki at http://www.zen-cart.com/wiki/index.php/Customisation_-_Templates

    Hope this help.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等