douchao5864 2015-07-21 15:51 采纳率: 100%
浏览 165
已采纳

OpenCart - 如何删除/禁用添加到购物车功能,直到此人登录?

I need to disable the add to cart button only when a person is not logged in like the hide price is hid until log in, where is the code for this so that can i hide the add to cart button same way until log in?

I am using opencart version 2.0.3.1

  • 写回答

2条回答 默认 最新

  • duanji1610 2015-07-22 06:56
    关注

    Opencart is not providing a default functionality. so you will using following condition on every add to cart button.

    Eg.

    <?php if ($logged) { ?> <button type="button" id="button-cart" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary btn-lg btn-block"><?php echo $button_cart; ?> </button><?php } ?>
    

    and assign logged variable in controller file

    $data['logged'] = $this->customer->isLogged();
    

    Good Luck

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

报告相同问题?

悬赏问题

  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写