繁体   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