简体   繁体   English

添加到购物车按钮在viemart中不可见

[英]add to cart button invisible in virtuemart

I am using virtuemart 2.0.16 , I am facing some problem related add to cart button,without login we can't show add to cart button. 我使用的是virtuemart 2.0.16 ,我virtuemart 2.0.16一些与add to cart按钮相关的问题,没有登录我们就无法显示添加到购物车按钮。 after login add to cart button display. 登录后添加到购物车按钮显示。 but I want to display Add to Cart Button user is login or not. 但我想显示“添加到购物车按钮”用户是否登录。

Here is my link 这是我的链接

Can anybody help me to solve this ? 有人可以帮我解决这个问题吗?

First of all check the VM Configuration tab any setting related to this. 首先,检查“ VM配置”选项卡与此相关的任何设置。

like the add to cart button only display for logged users or something like that. 例如“添加到购物车”按钮仅对已登录用户或类似用户显示。

If you can't find that. 如果找不到。

components/com_virtuemart/view/productdetails/tmpl/default.php and default_addtocart.php

file in that may be checking user logged or not . 可能正在检查用户登录的文件。

something like 就像是

if($user->id){
     <a href="#"><button>add to cart</button></a>
}

the code is not exactly like above but it may help you. 该代码与上面的代码不完全相同,但可能会对您有所帮助。

you find that 你发现

    components/com_virtuemart/views/productdetails/tmpl/default.php

find the addtocart button code then put 找到addtocart按钮代码,然后放入

    $user =& JFactory::getUser();
    if($user->id){
       // add to cart button code here
    }else{
       // your message here
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM