我是新來的php和opencart。但正打算設置我的網上商店。 我正在創建一個選項,用於在opencart的檢出頁面中選擇一個交付時段。 正如如下圖所示:opencart結賬頁面中的單選按鈕
於是,我開始寫vqmod牛逼實現這一目標,但停留在如何存儲在數據庫中的值: 我的XML看起來是這樣的:
<modification>
<id>Salutation Field Modification</id>
<version>1</version>
<vqmver>1.0.8</vqmver>
<author>maca</author>
<file name="catalog/view/theme/bigshop/template/checkout/shipping_method.tpl">
<operation>
<search position="before"><![CDATA[
<p><?php echo $text_shipping_method; ?></p>
]]></search>
<add><![CDATA[
<p><?php echo $text_shipping_timeslot; ?></p>
<table class="radio">
<tr>
<td colspan="3"><b><?php echo "Delivery time slot"; ?></b></td>
</tr>
<tr class="highlight">
<td>
<input type="radio" name="shipping_timeslot" value="><?php echo $ship_slot_one; ?></" id="morning?>" checked="checked"/><?php echo $ship_slot_one; ?></br>
<input type="radio" name="shipping_timeslot" value="><?php echo $ship_slot_two; ?></" id="afternoon?>"/><?php echo $ship_slot_two; ?></br>
<input type="radio" name="shipping_timeslot" value="><?php echo $ship_slot_three; ?></" id="evening?>"/><?php echo $ship_slot_three; ?></br>
<input type="radio" name="shipping_timeslot" value="><?php echo $ship_slot_four; ?></" id="night?>"/><?php echo $ship_slot_four; ?></br>
</td>
</tr>
<tr>
<td colspan="3"></td>
</tr>
</table>
]]></add>
</operation>
</file>
<file name="catalog/language/english/checkout/checkout.php">
<operation>
<search position="before"><![CDATA[
$_['text_shipping_method'] = 'Please select the preferred shipping method to use on this order.';
]]></search>
<add><![CDATA[
$_['text_shipping_timeslot'] = 'Please select the preferred shipping time slot.';
$_['ship_slot_one'] = 'Morning';
$_['ship_slot_two'] = 'Afternoon';
$_['ship_slot_three'] = 'Evening';
$_['ship_slot_four'] = 'Night';
]]></add>
</operation>
</file>
<file name="catalog/controller/checkout/shipping_method.php">
<operation>
<search position="before"><![CDATA[
$this->data['text_shipping_method'] = $this->language->get('text_shipping_method');
]]></search>
<add><![CDATA[
$this->data['text_shipping_timeslot'] = $this->language->get('text_shipping_timeslot');
$this->data['ship_slot_one'] = $this->language->get('ship_slot_one');
$this->data['ship_slot_two'] = $this->language->get('ship_slot_two');
$this->data['ship_slot_three'] = $this->language->get('ship_slot_three');
$this->data['ship_slot_four'] = $this->language->get('ship_slot_four');
]]></add>
</operation>
</file>
</modification>
請指導我。
對於初學者來說,看代碼(HTML),這產生的 - 它甚至編譯/解析?它看起來並不像你關閉你的''標籤......(你開始'value =「後有''' - 這應該如何工作?)你是如何設置變量' $ ship_slot_one'等? – Floris
您好弗洛里斯,我只是想做一些像在圖像中顯示。這看起來很好,在結帳頁面。現在我米卡住得到所選輸入的值,並存儲在分貝 –