I am creating a plugin which just show some custome price of the behalf of my calculation. I only want to hide woocommerce add to cart button and price. instead of this i just put the HTML of add to cart form, and want to add my custom price in cart.
like: if my calculation show 100 then when i click on add to cart button then it just add only 100 and when any other price then add that price only.
MY HTML form code:
<form class="variations_form cart" method="post" enctype="multipart/form-data" style="display: block;">
<div class="quantity">Cantidad: <input type="text" step="1" min="1"readonly name="quantity" value="<?php echo $total_ply2;?>" title="Cantidad" class="input-text qty text" size="4"><span> <?php echo 'Precio :' . $total_price;?> € </span></div>
<input id="Grosor de tablero" type="hidden" name="attribute_pa_grosor-tablero" value="<?php echo $_POST['var-slug']; ?>" />
<input type="hidden" name="add-to-cart" value="<?php global $product; echo $product->id; ?>">
<input type="hidden" name="product_id" value="<?php global $product; echo $product->id; ?>">
<input type="hidden" name="border_price" value="<?php echo $total_border_price; ?>">
<input type="hidden" name="row" value="<?php echo $prod_str; ?> " id="prod_str">
<input type="hidden" name="variation_id" class="variation_id" value="<?php echo $_POST['curr_variation_id']; //echo $variation_id; ?>">
<input type="submit" name="my_price" class="single_add_to_cart_button button alt" value ="Añadir al carrito" >
<?php include STYLESHEETPATH . "/custom-files/envio-link.php"; ?>
</form>
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire