簡體   English   中英

添加到購物車按鈕在viemart中不可見

[英]add to cart button invisible in virtuemart

我使用的是virtuemart 2.0.16 ,我virtuemart 2.0.16一些與add to cart按鈕相關的問題,沒有登錄我們就無法顯示添加到購物車按鈕。 登錄后添加到購物車按鈕顯示。 但我想顯示“添加到購物車按鈕”用戶是否登錄。

這是我的鏈接

有人可以幫我解決這個問題嗎?

首先,檢查“ VM配置”選項卡與此相關的任何設置。

例如“添加到購物車”按鈕僅對已登錄用戶或類似用戶顯示。

如果找不到。

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

可能正在檢查用戶登錄的文件。

就像是

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

該代碼與上面的代碼不完全相同,但可能會對您有所幫助。

你發現

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

找到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