Home › Forums › WoodMart support forum › Add Additional button
Add Additional button
- This topic has 9 replies, 2 voices, and was last updated 9 months, 3 weeks ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
September 25, 2024 at 1:45 pm #600016
barisayarrParticipantHello,
I am preparing a site where I plan to sell digital products. I need to create a “Live Demo” button on the page where the products are listed and within the product. How can I do this?
So actually what I want is to create another button like the “add to cart” button where I can enter a custom url
Thanks in advance.
September 25, 2024 at 3:33 pm #600081
Aizaz Imtiaz AwanKeymasterHello,
Try to create a HTML Block and add the custom button.
https://xtemos.com/docs-topic/html-blocks/Then navigate to the Theme Settings >> Single product >> Add to Cart >> Add the content in the form of HTML Block Before “Add to cart button” or After “Add to cart button”.
Best Regards
September 25, 2024 at 5:17 pm #600150
barisayarrParticipantHi there, thanks for your help.
But this is not a workable solution. Each product will have its own unique link.
September 26, 2024 at 10:53 am #600292
Aizaz Imtiaz AwanKeymasterHello,
Try to use the theme preset feature of our theme for a single product page.
Here is our documentation on how to use theme presets. https://xtemos.com/docs-topic/theme-settings-presets/Best Regards
September 26, 2024 at 11:07 am #600302
barisayarrParticipantThis question has been asked by many people. It has not been fully answered. They don’t exactly meet my needs.
First of all, I managed to create a demo button for each product with the code below.
add_action('woocommerce_product_options_advanced', 'product_data_metabox'); function product_data_metabox() { echo '<div class="options_group">'; woocommerce_wp_text_input(array( 'id' => 'demo_url', 'value' => get_post_meta(get_the_ID(), 'demo_url', true), 'label' => 'Demo URL', 'description' => 'The button link' )); echo '</div>'; } add_action('woocommerce_process_product_meta', 'save_field_on_update', 10, 2); function save_field_on_update($id, $post) { update_post_meta($id, 'demo_url', $_POST['demo_url']); } function content_after_add_to_cart_form() { global $product; $demo_url = $product->get_meta('demo_url'); if (!empty($demo_url)) { echo '<a class="single_add_to_cart_button button alt" href="' . esc_url($demo_url) . '" target="_blank">Demo</a>'; } } add_action('woocommerce_after_add_to_cart_form', 'content_after_add_to_cart_form', 10, 0);
using this code, I can create a custom live preview button for each product from the product page. But I am having trouble aligning the button I created.
I made the class of the “live preview” button the same as the class of the “add to cart” button. How can I get this button I created next to the “add to cart” button.
-
This reply was modified 9 months, 3 weeks ago by
barisayarr.
Attachments:
You must be logged in to view attached files.September 26, 2024 at 12:57 pm #600370
barisayarrParticipantAll the threads opened after me are answered, this thread is not answered. In which order are the answers given? If it is out of your scope of support, tell me and I will look for my answer on platforms like stackover.
September 26, 2024 at 2:30 pm #600408
Aizaz Imtiaz AwanKeymasterHello,
Sorry but Additional code customizations are out of our theme support scope. Please share the page URL so i will check and give you the custom css code of this demo button.
Best Regards
September 26, 2024 at 7:26 pm #600517
barisayarrParticipantI will turn off the “buy now” button in the settings, I turned it on to show it.
I want to get the “view demo” button instead of the “buy now” button. it would be much better if the “view demo” button could be shown instead of the “add to cart” button first
The page and login information is in the hidden section.
Attachments:
You must be logged in to view attached files.September 27, 2024 at 11:00 am #600652
barisayarrParticipantReminder
September 27, 2024 at 2:15 pm #600745
Aizaz Imtiaz AwanKeymasterHello,
Please try to use the below custom CSS code:
.wd-single-add-cart>div>*:last-child, .wd-single-add-cart>*:last-child { margin-bottom: 0; display: flex; margin-left: 2%; }
Best Regards.
-
This reply was modified 9 months, 3 weeks ago by
-
AuthorPosts
- You must be logged in to create new topics. Login / Register