Woocommerce buy sample button, next to "add to cart" button

I need a button that works the same as the "buy now" button works, but when clicked adds the word "Sample" before the product name and charges a flat $10 charge for each sample added to the cart. no shipping is to apply to this button.

The button will sit next to the "buy now" button on the single product page.

I can add the code to the templates, I just need it coded up. This is where i am up to but it obviously needs to be tweeked.

<form class="cart" method="post" enctype='multipart/form-data'>

<input type="hidden" name="add-to-cart" value="<?php echo esc_attr( $product->id ); ?>" />

<button type="submit" class="single_add_to_cart_button button alt"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>


Kemahiran: CSS, HTML, HTML5, MySQL, PHP

Lihat lagi: templates buy, sample word form, buy php templates

Tentang Majikan:
( 0 ulasan ) Bilambil, Australia

ID Projek: #10119608

Dianugerahkan kepada:


Hello We are in team having different-2 Years of experience in the mention field such as [login to view URL] (Apps) Android,Ios [login to view URL] Based (Website) Html,Html5,Css,Css3,Php,WordPress,Magento,API creation,Theme Lagi

$34 AUD dalam 3 hari
(43 Ulasan)

6 pekerja bebas membida secara purata $122 untuk pekerjaan ini


Dear Sir/Madam, I am wordpress,WooCommerce ,eCommerce, Shopping cart , PHP, Ajax, CMS ,JQuery,JavaScript, CSS, BootStrap ,HTML5,XML, MYSQL, responsive, Android, iPhone, Mobile, Ipad , Iphone Graphic Design,expert. I Lagi

$155 AUD dalam 3 hari
(177 Ulasan)

Hi there..!! I have gone through your requirement and I am ready to work on this project. First have a look at our previous WordPress work samples: ============================================= http://koncep Lagi

$147 AUD dalam 3 hari
(89 Ulasan)

Hi, Please give me opportunity to work for you. I have review your project description. I can fix button, next to "add to cart" button for you as per your requirement. I will sure give you high qu Lagi

$206 AUD dalam 3 hari
(51 Ulasan)
$147 AUD dalam 3 hari
(28 Ulasan)

Your code is missing out something so i can fix the problem. i already have fixed many woocommerce problems in just last 2 days so here is my 3rd one. let's discuss

$45 AUD dalam 3 hari
(8 Ulasan)