簡體   English   中英

除了productdetails之外,刪除所有Virtuemart視圖上的“添加到購物車”按鈕

[英]Remove 'add to cart' button on all Virtuemart views except in productdetails

我創建了一個自定義插件。 我希望買家只能使用這些創建的字段“添加到購物車”,只能在productdetails視圖中使用。 在此之前,不應顯示添加到購物車按鈕。 我也通過系統插件使用javascript實現了這一點,雖然我正在尋找更好的解決方案,因為通過某些功能刪除它 - 如plgVmOnDisplayProductFEVM3或其他東西。 因為'addtocart-bar'可能會有不同的級別

我還想知道,無論如何我們只能從'addtocart-bar'刪除'quantity-box'和'quantity-control'

我能夠取代virtuemart'添加到購物車'按鈕。 我可以通過在美德智論壇上的Studio42幫助實現它,討論這個網址

以下一組代碼,只有php才能工作:

//this will remove 'addtocart' button, but show 'choose a variant', 
// and also show quantity selector
$product->orderable = false;

//this along with above line of code will totally replace it 
//with your own button
$product->addToCartButton = '<div>my own button</div>';

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM