簡體   English   中英

在產品頁面上輸入文本字段,而不是下拉列表中的組合

[英]Input text field instead of drop down for combinations on product page

在prestashop 1.6中,只有2個選項可顯示要選擇的組合。 單選按鈕或下拉列表。 我有2個屬性,寬度和長度。 值從50到300 b 1 cm。 它太大,無法顯示在下拉列表中。 我真的需要一個souliton來更改下拉列表以輸入文本字段。

來自product.tpl的代碼段(此代碼顯示在產品頁面的前端):

   <!-- attributes -->
            <div id="attributes">
            {foreach from=$groups key=id_attribute_group item=group}
                {if $group.attributes|@count}
                    <fieldset class="attribute_fieldset form-group">
                        <label class="attribute_label" for="group_{$id_attribute_group|intval}">     {$group.name|escape:'htmlall':'UTF-8'} :&nbsp;</label>
                        {assign var="groupName" value="group_$id_attribute_group"}
                        <div class="attribute_list">
                        {if ($group.group_type == 'select')}
                            <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="attribute_select form-control" onchange="findCombination();getProductAttribute();">
                                {foreach from=$group.attributes key=id_attribute item=group_attribute}
                                    <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option>
                                {/foreach}
                            </select>

可能也必須在js中進行一些更改。

您可以使用以下jQuery number-updown插件,該插件對您的情況有用,並且有很多選項。

github中的插件鏈接

范例連結

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM