admin管理员组文章数量:1429089
I am using Woocommerce.
I want to add a custom page in between the cart and checkout page. In this custom page, I want to show a file upload field per product item in the cart. This has to tie into the order page in the admin.
Additionally, I also want to add some HTML depending on the product variation in the cart.
If product variation ID147 is in cart, show HTML "Link for ID147". If product variation ID236 is in cart, show HTML "Link for ID236".
I have somewhat managed to complete the first part which is to add a custom page in between the cart and checkout.
add_action('woocommerce_proceed_to_checkout', 'change_proceed_to_checkout');
function change_proceed_to_checkout() {
remove_action('woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20);
add_action('woocommerce_proceed_to_checkout', 'stan_button_proceed_to_upload_artwork_page', 20);
}
function stan_button_proceed_to_upload_artwork_page() {
$button_name = esc_html__('Custom page step', 'woocommerce');
$button_link = get_permalink(1636);
?>
<a href="<?php echo $button_link;?>" class="btn">
<?php echo $button_name; ?>
</a>
<?php
}
Any help would be much appreciated.
Thanks.
本文标签:
版权声明:本文标题:(Woocommerce) How to add a custom page between cart and checkout with a file upload field per product item in the cart? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745417187a2657737.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论