我对wordpress,woocommerce和elementor有非常初级的理解 . 我还在学习很多东西 . 我相信最好的学习方法就是模仿 . 所以,我经历了各种主题,并尝试使用Elementor模仿他们的行为和外观 . 但是,这个特别的主题引起了我的注意 . 当有人将鼠标悬停在产品图片上而不是始终在那里时,会出现“添加到购物车”按钮 . 你能帮我解决这个问题,或者至少指出我正确的方向吗?
This is how it should look when someone hovers over the images
1 回答
此代码按预期解决了我的问题 .
WooCommerce documentation reference
add_action('woocommerce_single_product_summary','my_extra_button_on_product_page',30);
function my_extra_button_on_product_page(){global $ product; echo'加入购物车'; }
Custom WooCommerce Add to Cart Plugin
custom add to cart button
或者在您自己的模板中为WooCommerce文件创建覆盖