Add extra button on product page for woocommerce

I spent most of the day trying to figure out how to customize a single product page using woocommerce.

I would like to add a custom button next to the Add to Cart button, which will be a custom link that says Next. I work on an invitation website that has a lot of components for an invitation, so after a user adds a product to their cart, I want them to have an option that says "Next" so they can proceed and set up the next fragment of the invitation. (I will have custom fields for each). The next button will not appear on all products and the link will be different for each. I don't think this is the best way to do it, but you have no other solution right now.

I also looked into package products or "compound products", however compound products are on the same page and I will need to add variations for each of 25/50/75/100, etc.

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

Can anyone ask for any feedback or suggestions! PLEASEEE. Thanks you

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

+3


source to share


1 answer


Add the code below to your theme file function.php.

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>';
}

      



Hooray!!!

+12


source







All Articles