add additional button on product page for woocommerce

旧巷老猫 提交于 2019-12-21 05:31:15

问题


I have spent the majority of the day trying to figure out how to adjust the single product page using woocommerce.

I would like to add a custom button next to the "Add to cart" button that would be a custom link that says "Next". I am working on an invitation website where there are numerous components to an invitation, so after a user adds a product to their cart, I want there to be an option that says "Next" so they can go ahead and customize the next piece of the invitation. (I will have custom fields for each). The next button won't be on all products, and the link will be different for each. I don't think this is the best way to do it, but don't have another solution right now.

I also was researching bundles products or "composite products" - however, composite products are all on one page and I will need to add variations for each for quantities of 25/50/75/100 etc...

See link below: http://blisspaperboutique.com/product/retro-romance-wedding-invitation-template/

Could someone please provide any feedback or suggestions!! PLEASEEE. Thank you

Here is a site that is doing something similar to what I am trying to do: http://www.weddingpaperdivas.com/product/16445/signature_white_wedding_invitations_enchanting_forever.html#color/04


回答1:


Add below code in your theme's function.php file.

add_action( 'woocommerce_single_product_summary', 'my_extra_button_on_product_page', 30 );

function my_extra_button_on_product_page() {
  global $product;
  echo '<a href="URL">Extra Button</a>';
}

Cheers!!!



来源:https://stackoverflow.com/questions/26225696/add-additional-button-on-product-page-for-woocommerce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!