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

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条)

报告相同问题?