Search the Community
Showing results for tags 'radio button'.
-
What I am trying to do is make prestashop display front end shop as a list, which can be radio button checked and then everything added at once. I found this tutorial by NemoPS, which is for prestashop 1.5. Can someone tell me how this can be done in prestashop 1.7?
- 6 replies
-
- radio button
- multiple products
-
(and 1 more)
Tagged with:
-
Bonjour à tous, Je reprends un site prestashop et je souhaiterai mettre un default value sur un button radio ( titre civilité présent dans le formulaire checkout ). Version prestashop : 1.7.6.5 Thème : Warehouse Je pense que cela se trouve dans le fichier form-fields.tpl dont voici le code : {if $field.type == 'hidden'} {block name='form_field_item_hidden'} <input type="hidden" name="{$field.name}" value="{$field.value}"> {/block} {else} <div class="form-group row align-items-center {if !empty($field.errors)}has-error{/if}"> <label class="col-md-2 col-form-label{if $field.required} required{/if}"> {if $field.type !== 'checkbox'} {$field.label} {/if} </label> <div class="col-md-8{if ($field.type === 'radio-buttons')} form-control-valign{/if}"> {if $field.type === 'select'} {block name='form_field_item_select'} <div class="custom-select2"> <select class="form-control form-control-select" name="{$field.name}" {if $field.required}required{/if}> <option value disabled selected>{l s='-- please choose --' d='Shop.Forms.Labels'}</option> {foreach from=$field.availableValues item="label" key="value"} <option value="{$value}" {if $value eq $field.value} selected {/if}>{$label}</option> {/foreach} </select> </div> {/block} {elseif $field.type === 'countrySelect'} {block name='form_field_item_country'} <div class="custom-select2"> <select class="form-control form-control-select js-country" name="{$field.name}" {if $field.required}required{/if}> <option value disabled selected>{l s='-- please choose --' d='Shop.Forms.Labels'}</option> {foreach from=$field.availableValues item="label" key="value"} <option value="{$value}" {if $value eq $field.value} selected {/if}>{$label}</option> {/foreach} </select> </div> {/block} {elseif $field.type === 'radio-buttons'} {block name='form_field_item_radio'} {foreach from=$field.availableValues item="label" key="value"} <label class="radio-inline"> <span class="custom-radio"> <input name="{$field.name}" type="radio" value="{$value}" {if $field.required}required{/if} {if $value eq $field.value} checked {/if} > <span></span> </span> {$label} </label> {/foreach} {/block} {elseif $field.type === 'checkbox'} {block name='form_field_item_checkbox'} <span class="custom-checkbox"> <input name="{$field.name}" id="ff_{$field.name}" type="checkbox" value="1" {if $field.value}checked="checked"{/if} {if $field.required}required{/if}> <span><i class="fa fa-check rtl-no-flip checkbox-checked" aria-hidden="true"></i></span> <label for="ff_{$field.name}">{$field.label nofilter}</label > </span> {/block} {elseif $field.type === 'date'} {block name='form_field_item_date'} <input name="{$field.name}" class="form-control" type="date" value="{$field.value}" placeholder="{if isset($field.availableValues.placeholder)}{$field.availableValues.placeholder}{/if}"> {if isset($field.availableValues.comment)} <span class="form-control-comment"> {$field.availableValues.comment} </span> {/if} {/block} {elseif $field.type === 'birthday'} {block name='form_field_item_birthday'} <div class="js-parent-focus"> {html_select_date field_order=DMY time={$field.value} field_array={$field.name} prefix=false reverse_years=true field_separator='<br>' day_extra='class="form-control form-control-select"' month_extra='class="form-control form-control-select"' year_extra='class="form-control form-control-select"' day_empty={l s='-- day --' d='Shop.Forms.Labels'} month_empty={l s='-- month --' d='Shop.Forms.Labels'} year_empty={l s='-- year --' d='Shop.Forms.Labels'} start_year={'Y'|date}-100 end_year={'Y'|date} } </div> {/block} {elseif $field.type === 'password'} {block name='form_field_item_password'} <div class="input-group js-parent-focus"> <input class="form-control js-child-focus js-visible-password" name="{$field.name}" title="{l s='At least 5 characters long' d='Shop.Forms.Help'}" {if isset($wishlistModal)}autocomplete="new-password"{/if} type="password" value="" pattern=".{literal}{{/literal}5,{literal}}{/literal}" {if $field.required}required{/if} > <span class="input-group-append"> <button class="btn btn-outline-secondary" type="button" data-action="show-password" > <i class="fa fa-eye-slash" aria-hidden="true"></i> </button> </span> </div> {/block} {else} {block name='form_field_item_other'} <input class="form-control" name="{$field.name}" type="{$field.type}" value="{$field.value}" {if isset($field.availableValues.placeholder)}placeholder="{$field.availableValues.placeholder}"{/if} {if $field.maxLength}maxlength="{$field.maxLength}"{/if} {if $field.required}required{/if} > {if isset($field.availableValues.comment)} <span class="form-control-comment"> {$field.availableValues.comment} </span> {/if} {/block} {/if} {block name='form_field_errors'} {include file='_partials/form-errors.tpl' errors=$field.errors} {/block} </div> <div class="col-md-2 form-control-comment"> {block name='form_field_comment'} {if (!$field.required && !in_array($field.type, ['radio-buttons', 'checkbox']))} {l s='Optional' d='Shop.Forms.Labels'} {/if} {/block} </div> </div> {/if} Je vous remercie pour l'aide précieuse que vous pourriez m'apporter. nicolas
-
Hello, I would like to program a complete form with helperform on prestashop 1.7. with select, radio button and checkbox. My image attached. It would be an admin side module. And all the information will be stocked in an XML file. I’m in training course and I have 4 weeks to do it. I followed the tutorial at this address: http://doc.prestashop.com/display/PS17/Adding+a+configuration+page So I can just create inputs. Here is my code: <?php if (!defined('_PS_VERSION_')){ exit; } class ModulePresta extends Module { public function __construct() { $this->name = 'modulepresta'; $this->tab = 'front_office_features'; $this->version = '1.0.0'; $this->author = 'Prenom Nom'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_); $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Mon module presta'); $this->description = $this->l('Description of my module presta.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); if (!Configuration::get('MYMODULE_PRESTA')) $this->warning = $this->l('No name provided'); } public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() || !$this->registerHook('header') || !Configuration::updateValue('MYMODULE_PRESTA', 'Module presta') ) return false; return true; } public function uninstall() { if (!parent::uninstall() || !Configuration::deleteByName('MYMODULE_PRESTA') ) return false; return true; } public function getContent() { $output = null; if (Tools::isSubmit('submit'.$this->name)) { $my_module_name = strval(Tools::getValue('MYMODULE_PRESTA')); if (!$my_module_name || empty($my_module_name) || !Validate::isGenericName($my_module_name)) $output .= $this->displayError($this->l('Invalid Configuration value')); else { Configuration::updateValue('MYMODULE_PRESTA', $my_module_name); $output .= $this->displayConfirmation($this->l('Settings updated')); } Configuration::updateValue('MYMODULE_PRESTA1', Tools::getValue('MYMODULE_PRESTA1')); } return $output.$this->displayForm(); } public function displayForm() { // Get default language $default_lang = (int)Configuration::get('PS_LANG_DEFAULT'); // Init Fields form array $fields_form = array(); $fields_form[0]['form'] = array( 'legend' => array( 'title' => $this->l('Settings'), ), 'input' => array( array( 'type' => 'text', 'label' => $this->l('Configuration value : '), 'name' => 'MYMODULE_PRESTA', 'size' => 20, 'required' => true ), array( 'type' => 'text', 'label' => $this->l('Heure : '), 'name' => 'MYMODULE_PRESTA1', 'size' => 20, 'required' => true ) ), array( 'type' => 'select', 'label' => $this->l('Languages:'), 'name' => 'category', 'required' => true, 'options' => array( 'query' => $options = array( array( 'id_option' => 1, // The value of the 'value' attribute of the <option> tag. 'name' => 'EN', // The value of the text content of the <option> tag. ), array( 'id_option' => 2, 'name' => 'BG', ), ), 'id' => 'id_option', 'name' => 'name', ), ), 'submit' => array( 'title' => $this->l('Save'), 'class' => 'btn btn-default pull-right' ) ); $helper = new HelperForm(); // Module, token and currentIndex $helper->module = $this; $helper->name_controller = $this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; // Language $helper->default_form_language = $default_lang; $helper->allow_employee_form_lang = $default_lang; // Title and toolbar $helper->title = $this->displayName; $helper->show_toolbar = true; // false -> remove toolbar $helper->toolbar_scroll = true; // yes - > Toolbar is always visible on the top of the screen. $helper->submit_action = 'submit'.$this->name; $helper->toolbar_btn = array( 'save' => array( 'desc' => $this->l('Save'), 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name. '&token='.Tools::getAdminTokenLite('AdminModules'), ), 'back' => array( 'href' => AdminController::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->l('Back to list') ) ); // Load current value $helper->fields_value['MYMODULE_PRESTA'] = Configuration::get('MYMODULE_PRESTA'); $helper->fields_value['MYMODULE_PRESTA1'] = Configuration::get('MYMODULE_PRESTA1'); return $helper->generateForm($fields_form); } } Currently I managed to show that 2 inputs On the other hand I saw on other forums that it is necessary to use the following methods: public function renderForm () public function postProcess () while I only use the basic methods: public function getContent () public function displayForm () Your help would be precious to me.
- 5 replies
-
- prestashop 1.7
- radio button
-
(and 3 more)
Tagged with:
-
Hi. I'm selling some books on my site. And use 1.7.2.5 prestashop version So in product quick view I have I add attributes using radio button and its looks like this: (Pls see 1.jpg) Author Publisher Publication date Pages But I need something like this in product quick view: (See 2.jpg and 3.jpg) So how will by possible? Any module?
- 2 replies
-
- attributes
- v1.7.2.5
-
(and 4 more)
Tagged with:
-
Hi. And use 1.7.2.5 PS version So in product quick view I have: Author Publisher Publication date Pages But I need something like this in product quick view:
-
- prestashop
- radio button
-
(and 5 more)
Tagged with:
-
Hello, i am using PS 1.6 and I would like to change the "radio" buttons for variations in product.tpl to be a buttons like the ''add to cart" button, the code to change this is as per the following: {elseif ($group.group_type == 'radio')} <ul> {foreach from=$group.attributes key=id_attribute item=group_attribute} <li> <input type="radio" class="attribute_radio" name="{$groupName|escape:'html':'UTF-8'}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} /> <span>{$group_attribute|escape:'html':'UTF-8'}</span> </li> {/foreach} </ul> {/if} Wrapping it into a div did not work, I am new to html.
-
- radio button
- product.tpl
-
(and 2 more)
Tagged with:
-
Hi I am building my Store in Arabic Language, and I have some problems with the theme, in order page. the drop down menu for address book is not showing correctly also the radio button is not showing but they are there (clickable but not showing) screenshot attached, also here is the URL www.elektrojo.org, you could test the order page in Arabic language
- 2 replies
-
- drop down
- radio button
-
(and 2 more)
Tagged with:
-
I would like to customers (4 step checkout) you could choose carrier clicking anywhere in raw specific carrier. I choose the defaults by clicking on a relatively small radio button on the left. The ideal would be the possibility to change the color of the entire raw when choosing a carrier. Does anyone have experience with this styling step checkout?
-
I would like to customers (4 step checkout) you could choose carrier clicking anywhere in raw specific carrier. I choose the defaults by clicking on a relatively small radio button on the left. The ideal would be the possibility to change the color of the entire raw when choosing a carrier. Does anyone have experience with this styling step checkout?
-
Bom dia! Estou com uma dúvida... É possível uma loja ter dois layouts? Ou seja, se for um homem a entrar, já com o login, é detetado como masculino e o layout fica masculino; caso seja uma senhora a entrar, é detetado que é do sexo feminino e o layout fica mais feminino. Ou isso ou a pessoa selecionar, por exemplo, no canto superior direito, por um radio button se é M ou F e o layout mudar... É possivel? Já há algum módulo? Cumprimentos
- 1 reply
-
- layout
- radio button
-
(and 1 more)
Tagged with: