Search the Community
Showing results for tags 'Value'.
-
I need to set a Feature without value. The reason for that is that I use the features to display flags in product-flags.tpl (like this) {foreach from=$product.features item=vlastnost} <li class="product-flag fl-{$vlastnost.id_feature}">{$vlastnost.name}</li> {/foreach} and the feature name is enough for me. At the same time I need the process to be simple for a person who will add product and features (in another words, avoid two SELECT menus). When I use the feature without value in product and save it, it is not there after refresh and also it is not available in the $product.features array. Do I have any options here? Thanks
-
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 devs, How to add custom (not-predefined) product feature to feature group in already existing product? For example I have: Product = Pretty furniture; and Feature group = Furniture material How to add to this Furniture material group custom value like "asdasdasd" in PHP? I tried with Product::addFeaturesToDB and Product::addFeatureProductImport but with no luck Can anyone provide step by step solution how to add custom value to feature?
-
Hi there, Currently in Romania is mandatory to show the Tax value per each product on the invoice. I can't achieve this in any matter. Can somebody help me? Thank you!
-
Dummy question but I cannot seem to find a straightforward answer. I am building a form using the HelperForm class and I want to pass a hidden field with it for which I use: array( 'type' => 'hidden', 'value' => 43, 'name' => 'id_product' ), ) ); Where value seems to invalid key in the array and doesn`t work. I saw the values array but it is said that it is used for radio buttons only. How am I suppose to assign value to the input field? EDIT: Found the solution myself. Inserted this when configuring the helper: $helper->fields_value['id_product'] = Tools::getValue('id_product');
-
Hi prestashopers. I write a module in which I save information in a complex form - serialized. The display of such information is illegible and unedited, which is why I want to display the input form. I just wanted to insert a value: public function renderForm() { $ unserializedArray = unserialize (AdParameters :: getParametersValue (Tools :: getValue ('id_ad_parameters'))); $ Result = ''; foreach ($ unserializedArray as $ key => $ row) { foreach ($ row as $ element) { $ Result. = '['. $ Element. ']'; } if (isset ($ unserializedArray [$ key + 1])) $ MyValue. = "\ R \ n"; } $ helper-> fields_value ['parameters_value'] = $ MyValue; ................ Form return parent::renderForm(); } AdParameters :: getParametersValue() is function quering DB When I list MyValue everythink is ok but in my list is not ok. However, it does not change the value. I need to replace it in the table and when editing in the form. Can anyone help me with this? Please. if you need a broader explanation, let me know, I'll send them.
-
- helperlist
- backoffice
- (and 10 more)
-
Good evening to everyone, I apologize if I ask the question in the wrong forum but in fact I could not understand who to turn to, I'm trying to create and manage my first store in prestashop and I ran into a difficulty that at the moment I can not overcome so I hope to receive some advice / suggestion here Premise: The shop is for a fast food, the current menu already operating in the fast food has several categories of dishes that I have already reported in the online store in the Catalog> Products for example: pasta with sauce, meatballs, breaded slices etc. etc. but for the product "salad" instead I have a big difficulty because this dish can be composed using only 4 ingredients on a list of 15 available. The choice is obviously at the discretion of the customer but once chosen the 4 ingredients he can not add others. Now I had created the dish named "Insalatone" and among the Attributes I had put the various ingredients: potatoes, tomatoes, bocconcini etc. etc. the value of these Attributes I set it using a Radio Box and are therefore two value in all Attributes: YES and NO After that I went to the Combinations where on the left I find YES / NO potatoes, YES / NO tomatoes, YES / NO tidbits, etc. and there I entered the Combinations and then I Generated the combinations: for example I can make it this dish: insalatone with: potatoes SI, tomatoes SI, tuna SI, cheese SI or insalatone with: tomatoes Si, lattuce SI, tuna SI, olives Si etc. But I meet some difficulties: 1) I do not know how to limit the customer to select just 4 ingredients (attribute). At the moment I can practically select them all and it's not good 2) Considering that I now have 8 ingredients (attribute) , the combinations that have been generated are many, but if I wanted to add another new ingredient (attribute) to the already created combinations, I first have to delete them all and recreate them again adding the last ingredient / attribute? I looked at some addons on the combinations of products but there are various prices and skills for this I confess to have difficulty understanding which one is suitable for my needs, I hope I have explained as clearly as possible and to receive some advice, if needed I can attach a few screens to see how the customer shop looks. Thank you in advance for any suggestions.
-
Hello, I am trying define a minimum order value of 10€ without VAT (8.13) (would like for products only, not shipping fees), but PS 1.7.2.4 allow finish the order with 5€ (for example). If I activate debug mode, Front Page don't work and shows the error below. I tryed with default template and with a purchased template on Prestashop Market Place (addons.prestashop.com) Thansk in advance. Error: Whoops, looks like something went wrong. 1/1 ContextErrorException in CartPresenter.php line 445: Warning: sprintf(): Too few arguments in CartPresenter.php line 445 at ErrorHandler->handleError('2', 'sprintf(): Too few arguments', '/home/printmix/public_html/loja/src/Adapter/Cart/CartPresenter.php', '445', array('cart' => object(Cart), 'shouldSeparateGifts' => false, 'rawProducts' => array(), 'products' => array(), 'this' => object(CartPresenter), 'subtotals' => array('products' => array('type' => 'products', 'label' => 'Subtotal', 'amount' => '0', 'value' => '0,00 €'), 'discounts' => null, 'shipping' => array('type' => 'shipping', 'label' => 'Envio', 'amount' => '0', 'value' => 'Grátis'), 'tax' => null), 'productsTotalExcludingTax' => '0', 'total_excluding_tax' => '0', 'total_including_tax' => '0', 'total_discount' => '0', 'totalCartAmount' => '0', 'shippingCost' => '0', 'totals' => array('total' => array('type' => 'total', 'label' => 'Total', 'amount' => '0', 'value' => '0,00 €'), 'total_including_tax' => array('type' => 'total', 'label' => 'Total (com IVA)', 'amount' => '0', 'value' => '0,00 €'), 'total_excluding_tax' => array('type' => 'total', 'label' => 'Total (sem IVA)', 'amount' => '0', 'value' => '0,00 €')), 'products_count' => '0', 'summary_string' => '0 artigos', 'minimalPurchase' => '8.13', 'labels' => array('tax_short' => '(com IVA)', 'tax_long' => '(com IVA)'), 'discounts' => array(), 'vouchers' => array('allowed' => '0', 'added' => array()), 'cartRulesIds' => array())) at sprintf('É necessária uma compra total mínima de %1s (sem IVA) para validar a sua encomenda. O total atual da compra é de %2s (sem IVA).') in CartPresenter.php line 445 at CartPresenter->present(object(Cart)) in FrontController.php line 500 at FrontControllerCore->assignGeneralPurposeVariables() in FrontController.php line 536 at FrontControllerCore->initContent() in IndexController.php line 37 at IndexControllerCore->initContent() in Controller.php line 205 at ControllerCore->run() in Dispatcher.php line 379 at DispatcherCore->dispatch() in index.php line 28
-
Hi All, I have make a module to add one field in class cart. I have add the input in the form.tpl only for backoffice. Now I must get it in a hook (hookActionCartSave) but nothnig work. I have try Tools::getValue nothing, how to get this input text ? maye there an hidden hook ?? Thanks a lot,
- 1 reply
-
- adminorders
- addorder
-
(and 3 more)
Tagged with:
-
Hello to everyone, I want to ask if it is possible to increase the limit of the input value for the weight field ? Prestashop strips down long numbers. For example, i want to enter 0.0018 Kg but Prestashop will save the value as 0.002 Kg Thank you, John
-
Hi!! I would like to show choosen features on product-list.tpl I want to show it on line 120 of product-list.tpl For instance if free shiping or not with an image. Here is part of product.tpl code that works on my web: <td>{if $feature.id_feature==32} {if $feature.value=='Free Shipping'}{html_image file='https://www.web.com/freeshipping.gif'} I want to do something in product-list.tpl. I think I must load the product id to show feature.value with an image. I don't know how to do this... Thank you so much!
-
Hi, I cant save value of textarea public function getContent() { if (Tools::isSubmit('submitSomeModule')) { Configuration::updateValue('some_text', Tools::getValue('some_text'), true); } return $this->renderForm(); } protected function renderForm() array( 'type' => 'textarea', 'label' => $this->l('Text field content'), 'name' => 'some_text', 'lang' => true, 'autoload_rte' => true, 'cols' => 60, 'rows' => 30, ), $helper->tpl_vars = array( 'fields_value' => $this->getConfigFieldsValues(), /* Add values for your inputs */ 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id, ); public function getConfigFieldsValues() { return array( 'some_text' => Tools::getValue('some_text', Configuration::get('some_text')), ); } protected function postProcess() { $form_values = $this->getConfigFieldsValues(); foreach (array_keys($form_values) as $key) Configuration::updateValue($key, Tools::getValue($key)); }
-
Hello, How I can get feature value by feature ID on blockcontact.php? Thanks.
-
I am very new to all this. Last week I found a page that listed all my stock, quantity, price of each unit and total value of each item adding to a grand total of my entire stock. I cannot find that page again, please please where do I find it?
-
I'm trying to make combinations (product size/weight) a required option when ordering from my store. Currently, a customer can proceed through cart with purchase without specifying an exact size or weight of the product. I'm not seeing anywhere to do this within the combinations page anywhere around the "attribute/value" options. i currently have drop-downs established for the size/weight, but somehow isn't required when purchasing. Any help is greatly appreciated. Thanks in advance!
-
- combinations
- dropdown
-
(and 4 more)
Tagged with:
-
I've successfully created new attribute values (new colors), however, these does not automatically transfer to the list in the attributes generator, when creating new product combinations. E.g. I created the color 'blue' in the 'attributes and values' section, but it does not show in the 'product combinations generator'. I also tried to delete some other colors, which still remained on the list afterwards. So, basically it seems that it does not update These used to transfer automatically in Prestashop 1.5, however, after I updated to 1.6 this no longer seems to be the case. Is this a bug or am I doing something wrong?
-
- 1
-
-
- attributes
- value
-
(and 2 more)
Tagged with:
-
I have just created an order from a cart, however the order details do not show on the invoice although the correct price does. The value of the order doesn't show in the cumulative sales on the Dashboard. And the item is still showing as in stock, it should now show as out of stock as it was the only item How can I correct this error?
- 1 reply
-
- order
- stock level
-
(and 1 more)
Tagged with:
-
Dear community, we re currently trying to build some filters with advanced search 4 and within one category we encountered a problem. We´ve got different attributes with values that should be one attribute. But there s been a spelling mistake and so we do have several different attributes meaning the same. In the backoffice it s possible to change a specific attribute value to another attribute. But the description of the product sticks with the old attribute name and is not changed. Does anybody know a way or a tool in order to move the attribute values from one attrbute to another so that the description of the related products change as well? Best regards, crowder
- 2 replies
-
- attributes
- value
-
(and 3 more)
Tagged with:
-
Hello , I have used multiple select input type in my modules configuration but when i submit it gives me only last selected options value inspite of all that are selected value for getting value I have used Tools::getValue() function. please give me some solution so that i can get all selected options value
- 3 replies
-
- prestashop
- helperform
-
(and 6 more)
Tagged with:
-
Hi! I want work with a variable from input and i don't know how. Is it possible?
-
By default you can select New, Used and Refurbished in product edit page. I'd like to also add Exibition. I made some changes in /classes/Product.php: 'condition' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new', 'used', 'refurbished', 'exhibitioned'), 'default' => 'new'), ... and /adminXXX/themes/default/template/controllers/products/informations.tpl: <select name="condition" id="condition"> <option value="new" {if $product->condition == 'new'}selected="selected"{/if} >{l s='New'}</option> <option value="used" {if $product->condition == 'used'}selected="selected"{/if} >{l s='Used'}</option> <option value="refurbished" {if $product->condition == 'refurbished'}selected="selected"{/if}>{l s='Refurbished'}</option> <option value="exhibitioned" {if $product->condition == 'exhibitioned'}selected="selected"{/if}>{l s='Item from exhibition'}</option> </select> Now I have another option in the list, there's success note after saving but, value in database ps_product and ps_product_shop tables is always set to New, even if I try to change Used or Refurbished to Exhibitioned. How to make it work?
-
Bonjour, Je m'excuse si je n'ai aps mit le topic dans la bonne catégorie. Je suis actuéllement en train de faire un module avec un formulaire. Je passe donc par Helper form. J'ai des checkbox, mais je ne vois pas comment mettre une valeur aux Chexbox. Je suis sur prestashop 1.5.6.1. Merci pour votre aide.
- 1 reply
-
- Développement module
- Helper Form
-
(and 3 more)
Tagged with:
-
Bonsoir, Je suis en train de travailler sur l'import de mes produits (plus de 1000). J'ai 5 ou 6 caractéristiques avec chacune entre 5 et 12 valeurs... Lorsque je fais mon fichier, j'aimerai avoir la possibilité de mettre les informations comme ceci : 2:5 pour les caractéristiques (2 étant l'ID de la caractéristique et 5 l'ID de la valeur). Or, cela me crée de nouvelles entrées. Mes caractéristiques sont composées de plusieurs mots et souvent accentués... C'est fastidieux et source d'erreur. Suis-je obligé de passer par une formule du type : Type de Média:Livre numérique Alors que 5:13 serait bien plus simple !!!! Ca fonctionne très bien pour les catégories par exemple ! Merci de votre aide.