Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

add additional button on product page for woocommerce

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

like image 582
user3715275 Avatar asked Oct 06 '14 22:10

user3715275


People also ask

How do I add an extra button to a single product page?

If you wish to have a different button setting of the products in the shop, you can do it in the editing page or by using “Custom Button Url List” section. Click on “Add products” button you find on top of the page to add new configurations to the button.

How do I add more options to my products in WooCommerce?

Navigate to the Plugins menu, and click “Add New”. Search and locate 'Extra Product Options (Product Addons) for WooCommerce' plugin. Click 'Install Now', and WordPress will take it from there.

How do I add a button to my WooCommerce shop?

PRO TIP: Adding a button to your shop page in WooCommerce can be done by adding a simple line of code to your functions. php file. However, it is important to note that this will only work if your theme supports it. Additionally, your button will only appear on the shop page, and not on any other pages on your site.


1 Answers

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!!!

like image 84
Prashant Kanse Avatar answered Sep 27 '22 00:09

Prashant Kanse