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

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 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)
  • ¥15 机器人轨迹规划相关问题
  • ¥15 word样式右侧翻页键消失