[英]how to separate views on the same page in virtuemart productdetails and related products
我有一個頁面productdetails.php,下面顯示了相關產品,我想為相關產品設置一些條件,但是由於視圖相同,我添加到相關產品中的更改也反映在產品詳細信息頁面上
就像我想顯示產品詳細信息價格單選按鈕並選擇相關產品的列表有什么幫助嗎?
嘗試這個,
在layout
頁面( productdetails/tmpl
內的任何頁面)中,相關產品變量可用$this->product->customfieldsRelatedProducts
因此您可以簡單地進行檢查。
if(sizeof($this->product->customfieldsRelatedProducts) >0){
// the current viewing product have related products
}else{
//the current product have no related products
}
希望能幫助到你..
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.