简体   繁体   中英

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. 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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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