Answer the question
In order to leave comments, you need to log in
How to add a button in the product card near "add to cart" on woocommerce?
Hello! I have form code
<form action=”https://loans-qa.tcsbank.ru/api/partners/v1/lightweight/create” method=”post”>
<input name=”shopId” value=”test_online” type=”hidden”/>
<input name=”showcaseId” value=”test_online” type=”hidden”/>
<input name=”sum” value=”99000.00” type=”hidden”>
<input name=”itemName_0” value=”НАЗВАНИЕ ТОВАРА” type=”hidden”/>
<input name=”itemQuantity_0” value=”1” type=”hidden”/>
<input name=”itemPrice_0” value=”СТОИМОСТЬ ТОВАРА” type=”hidden”/>
<input name=”itemCategory_0” value=”КАТЕГОРИЯ” type=”hidden”/>
<input type=”submit” value=”рассмотреть”/>
</form>
Answer the question
In order to leave comments, you need to log in
Here are the product card hooks
The hook is right after the "woocommerce_after_add_to_cart_button" button. Only this hook outputs data to the woocommerce form, so you should not insert your form there. You can simply add the button you need there, and process it in your js script.
In general, the task with the form is not clear. Why don't you do ajax? Why the extra page reload?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question