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>
6 pekerja bebas membida secara purata $122 untuk pekerjaan ini
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