Woocommerce:单个产品页面中的HTML表输入值保存在订单和电子邮件通知中

问题描述 投票:0回答:2

我想在单个产品页面woocommerce中添加html表,其中包含镜片处方选项带有下拉列表的表格,如图像链接所示https://gulfoptic.com/wp-content/uploads/2020/06/table.jpg

1-在单个产品页面或某些产品类别中添加表

2-从列表中选择值

3-所选值将保存在新订单和电子邮件通知中

https://gulfoptic.com/wp-content/uploads/2020/06/table.jpg

HTML代码

<div>
<h2 data-fontsize="19" data-lineheight="29">&nbsp;RX Information</h2>
<table cellspacing="0">
<tbody>
<tr>
<th>&nbsp;eye&nbsp;</th>
<th>Sphere(SPH) <a title="sphere are the diopter values ​​on which your nearsightedness or farsightedness can be corrected. They always exist in quarter Dioptiren-scale eg 0.25 / 0.50 / 0.75 ... 1.25 ... etc" href="#" data-toggle="tooltip" data-placement="top"> ? </a></th>
<th>Cylinder(CYL) <a title="The cylinderValue is always second in your spectacle and returns the value of your astigmatism in. As the pupil is a little wavy, creates an image distortion. Image distortions are compensated by means of cylinder values ​​that may have values ​​in both minus and plus. Astigmatism does not have any mandatory." href="#" data-toggle="tooltip" data-placement="top"> ? </a></th>
<th>Axis <a title="The axis is the third in the spectacle pass and returns the position of the cylinder at from 1 to 180 degrees." href="#" data-toggle="tooltip" data-placement="top"> ? </a></th>
<th>PD <a title="The pupillary distance is easy in front of the mirror with a ruler, measure from the center of the nose to the middle of the pupil. The value is in
mm specified. Particularly important in progressive lenses because otherwise an optimum visual acuity is guaranteed, as bifocals contains different viewing zones. In that case, we recommend the pupil to be measured distance from an eye doctor and perform equal to a check-up." href="#" data-toggle="tooltip" data-placement="top"> ? </a></th>
<th>ADD <a title="" href="#" data-toggle="tooltip" data-placement="top" data-original-title="ADD are the addition values, and is only required for progressive lenses, compared presbyopia (presbyopia). This is the value between the near and far values ​​or the difference."> ? </a></th>
</tr>
<tr>
<th>OD - Right</th>
<td><select name="SPH_ODRight">
<option selected="selected" value="">Select</option>
<option value="-9.25">-9.25dpd</option>
<option value="-9.00">-9.00dpd</option>
<option value="-8.75">-8.75dpd</option>
<option value="-8.50">-8.50dpd</option>
</select></td>
<td><select name="CYL_ODRight">
<option selected="selected" value="">Select</option>
<option value="+3.75">+3.75dpt</option>
<option value="+4.00">+4.00dpt</option>
<option value="+4.25">+4.25dpt</option>
<option value="+4.50">+4.50dpt</option>
<option value="+4.75">+4.75dpt</option>
</select></td>
<td><select name="AXIS_ODRight">
<option selected="selected" value="">Select</option>
<option value="176&deg;">176&deg;</option>
<option value="177&deg;">177&deg;</option>
<option value="178&deg;">178&deg;</option>
<option value="179&deg;">179&deg;</option>
<option value="180&deg;">180&deg;</option>
</select></td>
<td><select name="PD_ODRight">
<option selected="selected" value="">Select</option>
<option value="25.00">25.00</option>
<option value="25.50">25.50</option>
<option value="26.00">26.00</option>
<option value="26.50">26.50</option>
<option value="27.00">27.00</option>
<option value="27.50">27.50</option>
<option value="28.00">28.00</option>
<option value="28.50">28.50</option>
<option value="29.00">29.00</option>
<option value="29.50">29.50</option>
<option value="30.00">30.00</option>
<option value="30.50">30.50</option>
<option value="31.00">31.00</option>
<option selected="selected" value="31.50">31.50</option>
<option value="32.00">32.00</option>
<option value="32.50">32.50</option>
<option value="33.00">33.00</option>
<option value="33.50">33.50</option>
<option value="34.00">34.00</option>
<option value="34.50">34.50</option>
<option value="35.00">35.00</option>
<option value="35.50">35.50</option>
<option value="36.00">36.00</option>
<option value="36.50">36.50</option>
<option value="37.00">37.00</option>
<option value="37.50">37.50</option>
<option value="38.00">38.00</option>
</select></td>
<td><select name="ADD_ODRight">
<option selected="selected" value="">Select</option>
<option value="0.50">0.50</option>
<option value="0.75">0.75</option>
<option value="1.00">1.00</option>
<option value="1.25">1.25</option>
<option value="1.50">1.50</option>
<option value="1.75">1.75</option>
<option value="2.00">2.00</option>
<option value="2.25">2.25</option>
<option value="2.50">2.50</option>
<option value="2.75">2.75</option>
<option value="3.00">3.00</option>
<option value="3.25">3.25</option>
<option value="3.50">3.50</option>
</select></td>
</tr>
<tr>
<th>OS - Left</th>
<td><select name="SPH_OSLeft">
<option selected="selected" value="">Select</option>
<option value="+7.75">+7.75dpd</option>
<option value="+8.00">+8.00dpd</option>
<option value="+8.25">+8.25dpd</option>
<option value="+8.50">+8.50dpd</option>
<option value="+8.75">+8.75dpd</option>
<option value="+9.00">+9.00dpd</option>
<option value="+9.25">+9.25dpd</option>
</select></td>
<td><select name="CYL_OSLeft">
<option selected="selected" value="">Select</option>
<option value="+2.25">+2.25dpt</option>
<option value="+2.50">+2.50dpt</option>
<option value="+2.75">+2.75dpt</option>
<option value="+3.00">+3.00dpt</option>
<option value="+3.25">+3.25dpt</option>
<option value="+3.50">+3.50dpt</option>
<option value="+3.75">+3.75dpt</option>
<option value="+4.00">+4.00dpt</option>
<option value="+4.25">+4.25dpt</option>
<option value="+4.50">+4.50dpt</option>
<option value="+4.75">+4.75dpt</option>
</select></td>
<td><select name="AXIS_OSLeft">
<option value="43&deg;">43&deg;</option>
<option value="44&deg;">44&deg;</option>
<option value="45&deg;">45&deg;</option>
<option value="46&deg;">46&deg;</option>
<option value="47&deg;">47&deg;</option>
<option value="48&deg;">48&deg;</option>
<option value="180&deg;">180&deg;</option>
</select></td>
<td><select name="PD_OSLeft">
<option selected="selected" value="">Select</option>
<option selected="selected" value="">Select</option>
<option value="25.00">25.00</option>
<option value="25.50">25.50</option>
<option value="26.00">26.00</option>
<option value="26.50">26.50</option>
<option value="27.00">27.00</option>
<option value="27.50">27.50</option>
<option value="31.00">31.00</option>
<option selected="selected" value="31.50">31.50</option>
<option value="32.00">32.00</option>
<option value="32.50">32.50</option>
<option value="33.00">33.00</option>
<option value="33.50">33.50</option>
<option value="34.00">34.00</option>
</select></td>
<td><select name="ADD_OSLeft">
<option selected="selected" value="">Select</option>
<option value="0.50">0.50</option>
<option value="0.75">0.75</option>
<option value="1.00">1.00</option>
<option value="1.25">1.25</option>
<option value="1.50">1.50</option>
</select></td>
</tr>
</tbody>
</table>
</div>

php html wordpress woocommerce
2个回答
0
投票

添加表格method= POST,输入所需的所有详细信息并使用mail()功能发送电子邮件。


0
投票

我已将html代码转换为PHP添加代码1-如何在订单和电子邮件中保存选择值

add_action( 'woocommerce_single_product_summary', 'bbloomer_continue_shopping_button', 31 );

function bbloomer_continue_shopping_button() 
{
  if ( is_product() && has_term( array( 'cat1', 'cat2' ), 'product_cat' ) )
    {
echo '<div>';
echo '<h2 data-fontsize="19" data-lineheight="29">&nbsp;RX Information</h2>';
echo '<table cellspacing="0">';
echo '<tbody>';
echo '<tr>';
echo '<th>&nbsp;eye&nbsp;</th>';
echo '<th>Sphere(SPH) <a title="sphere are the diopter values ​​on which your nearsightedness or farsightedness can be corrected. They always exist in quarter Dioptiren-scale eg 0.25 / 0.50 / 0.75 ... 1.25 ... etc" href="#" data-toggle="tooltip" data-placement="top"> ? </a></th>';
echo '<th>Cylinder(CYL) <a title="The cylinderValue is always second in your spectacle and returns the value of your astigmatism in. As the pupil is a little wavy, creates an image distortion. Image distortions are compensated by means of cylinder values ​​that may have values ​​in both minus and plus. Astigmatism does not have any mandatory." href="#" data-toggle="tooltip" data-placement="top"> ? </a></th>';
echo '<th>Axis <a title="The axis is the third in the spectacle pass and returns the position of the cylinder at from 1 to 180 degrees." href="#" data-toggle="tooltip" data-placement="top"> ? </a></th>';
echo '<th>PD <a title="The pupillary distance is easy in front of the mirror with a ruler, measure from the center of the nose to the middle of the pupil. The value is in';
echo 'mm specified. Particularly important in progressive lenses because otherwise an optimum visual acuity is guaranteed, as bifocals contains different viewing zones. In that case, we recommend the pupil to be measured distance from an eye doctor and perform equal to a check-up." href="#" data-toggle="tooltip" data-placement="top"> ? </a></th>';
echo '<th>ADD <a title="" href="#" data-toggle="tooltip" data-placement="top" data-original-title="ADD are the addition values, and is only required for progressive lenses, compared presbyopia (presbyopia). This is the value between the near and far values ​​or the difference."> ? </a></th>';
echo '</tr>';
echo '<tr>';
echo '<th>OD - Right</th>';
echo '<td><select name="SPH_ODRight">';
echo '<option selected="selected" value="">Select</option>';
echo '<option value="-9.25">-9.25dpd</option>';
echo '<option value="-9.00">-9.00dpd</option>';
echo '<option value="-8.75">-8.75dpd</option>';
echo '<option value="-8.50">-8.50dpd</option>';
echo '</select></td>';
echo '<td><select name="CYL_ODRight">';
echo '<option selected="selected" value="">Select</option>';
echo '<option value="+3.75">+3.75dpt</option>';
echo '<option value="+4.00">+4.00dpt</option>';
echo '<option value="+4.25">+4.25dpt</option>';
echo '<option value="+4.50">+4.50dpt</option>';
echo '<option value="+4.75">+4.75dpt</option>';
echo '</select></td>';
echo '<td><select name="AXIS_ODRight">';
echo '<option selected="selected" value="">Select</option>';
echo '<option value="176&deg;">176&deg;</option>';
echo '<option value="177&deg;">177&deg;</option>';
echo '<option value="178&deg;">178&deg;</option>';
echo '<option value="179&deg;">179&deg;</option>';
echo '<option value="180&deg;">180&deg;</option>';
echo '</select></td>';
echo '<td><select name="PD_ODRight">';
echo '<option selected="selected" value="">Select</option>';
echo '<option value="25.00">25.00</option>';
echo '<option value="25.50">25.50</option>';
echo '<option value="26.00">26.00</option>';
echo '<option value="26.50">26.50</option>';
echo '<option value="27.00">27.00</option>';
echo '<option value="27.50">27.50</option>';
echo '<option value="28.00">28.00</option>';
echo '<option value="28.50">28.50</option>';
echo '<option value="29.00">29.00</option>';
echo '<option value="29.50">29.50</option>';
echo '<option value="30.00">30.00</option>';
echo '<option value="30.50">30.50</option>';
echo '<option value="31.00">31.00</option>';
echo '<option selected="selected" value="31.50">31.50</option>';
echo '<option value="32.00">32.00</option>';
echo '<option value="32.50">32.50</option>';
echo '<option value="33.00">33.00</option>';
echo '<option value="33.50">33.50</option>';
echo '<option value="34.00">34.00</option>';
echo '<option value="34.50">34.50</option>';
echo '<option value="35.00">35.00</option>';
echo '<option value="35.50">35.50</option>';
echo '<option value="36.00">36.00</option>';
echo '<option value="36.50">36.50</option>';
echo '<option value="37.00">37.00</option>';
echo '<option value="37.50">37.50</option>';
echo '<option value="38.00">38.00</option>';
echo '</select></td>';
echo '<td><select name="ADD_ODRight">';
echo '<option selected="selected" value="">Select</option>';
echo '<option value="0.50">0.50</option>';
echo '<option value="0.75">0.75</option>';
echo '<option value="1.00">1.00</option>';
echo '<option value="1.25">1.25</option>';
echo '<option value="1.50">1.50</option>';
echo '<option value="1.75">1.75</option>';
echo '<option value="2.00">2.00</option>';
echo '<option value="2.25">2.25</option>';
echo '<option value="2.50">2.50</option>';
echo '<option value="2.75">2.75</option>';
echo '<option value="3.00">3.00</option>';
echo '<option value="3.25">3.25</option>';
echo '<option value="3.50">3.50</option>';
echo '</select></td>';
echo '</tr>';
echo '<tr>';
echo '<th>OS - Left</th>';
echo '<td><select name="SPH_OSLeft">';
echo '<option selected="selected" value="">Select</option>';
echo '<option value="+7.75">+7.75dpd</option>';
echo '<option value="+8.00">+8.00dpd</option>';
echo '<option value="+8.25">+8.25dpd</option>';
echo '<option value="+8.50">+8.50dpd</option>';
echo '<option value="+8.75">+8.75dpd</option>';
echo '<option value="+9.00">+9.00dpd</option>';
echo '<option value="+9.25">+9.25dpd</option>';
echo '</select></td>';
echo '<td><select name="CYL_OSLeft">';
echo '<option selected="selected" value="">Select</option>';
echo '<option value="+2.25">+2.25dpt</option>';
echo '<option value="+2.50">+2.50dpt</option>';
echo '<option value="+2.75">+2.75dpt</option>';
echo '<option value="+3.00">+3.00dpt</option>';
echo '<option value="+3.25">+3.25dpt</option>';
echo '<option value="+3.50">+3.50dpt</option>';
echo '<option value="+3.75">+3.75dpt</option>';
echo '<option value="+4.00">+4.00dpt</option>';
echo '<option value="+4.25">+4.25dpt</option>';
echo '<option value="+4.50">+4.50dpt</option>';
echo '<option value="+4.75">+4.75dpt</option>';
echo '</select></td>';
echo '<td><select name="AXIS_OSLeft">';
echo '<option value="43&deg;">43&deg;</option>';
echo '<option value="44&deg;">44&deg;</option>';
echo '<option value="45&deg;">45&deg;</option>';
echo '<option value="46&deg;">46&deg;</option>';
echo '<option value="47&deg;">47&deg;</option>';
echo '<option value="48&deg;">48&deg;</option>';
echo '<option value="180&deg;">180&deg;</option>';
echo '</select></td>';
echo '<td><select name="PD_OSLeft">';
echo '<option selected="selected" value="">Select</option>';
echo '<option selected="selected" value="">Select</option>';
echo '<option value="25.00">25.00</option>';
echo '<option value="25.50">25.50</option>';
echo '<option value="26.00">26.00</option>';
echo '<option value="26.50">26.50</option>';
echo '<option value="27.00">27.00</option>';
echo '<option value="27.50">27.50</option>';
echo '<option value="31.00">31.00</option>';
echo '<option selected="selected" value="31.50">31.50</option>';
echo '<option value="32.00">32.00</option>';
echo '<option value="32.50">32.50</option>';
echo '<option value="33.00">33.00</option>';
echo '<option value="33.50">33.50</option>';
echo '<option value="34.00">34.00</option>';
echo '</select></td>';
echo '<td><select name="ADD_OSLeft">';
echo '<option selected="selected" value="">Select</option>';
echo '<option value="0.50">0.50</option>';
echo '<option value="0.75">0.75</option>';
echo '<option value="1.00">1.00</option>';
echo '<option value="1.25">1.25</option>';
echo '<option value="1.50">1.50</option>';
echo '</select></td>';
echo '</tr>';
echo '</tbody>';
echo '</table>';
echo '</div>';
}}
热门问题
推荐问题
最新问题