我需要一个简短的函数,它将在自定义单个产品页面中执行以下操作:
“立即预订”按钮的编程方式如下:(示例值)
<form method="post" action="add-to-cart-url">
<input type="hidden" name="add-to-cart" value="415"> <!--this is a product ID-->
<input type="hidden" name="wc_bookings_field_start_date_year" value="2018">
<input type="hidden" name="wc_bookings_field_start_date_month" value="10">
<input type="hidden" name="wc_bookings_field_start_date_day" value="30">
<input type="hidden" name="wc_bookings_field_resource" value="29"> <!--this is a resource ID-->
<input type="hidden" name="wc_bookings_field_start_date_time" id="wc_bookings_field_start_date" value="10:00">
<button type="submit">BOOK NOW</button>
</form>
如何做到这一点:
我从哪里开始?