Jump to content

Roope

Members
  • Posts

    212
  • Joined

  • Last visited

Community Answers

  1. Roope's post in multi-language product name and paypal checkout was marked as the answer   
    Hello adrianmak!
      How do you handle passing values to the PayPal checkout? Maybe you'll need something like this: if($user->language->isDefault()) {    $value = $page->fieldname; } else {    $value = $page->getLanguageValue($user->language, 'fieldname'); }
  2. Roope's post in Need to save/ show prizes (€) was marked as the answer   
    For prices I would suggest to go with float input and then modify the output when ever needed. Text field for numeric data is not the sharpest solution. With float you can be sure that data is always numeric only, can have decimals and calculations with PHP work without hassle. For output you can use some basic function like this:
    function price($float) { return number_format($float, 2, ',', '') . "€"; } If you need to add taxes it's also easy extend to the output function:
    function price($float, $tax=null) { if($tax) $float = $float * ((int) $tax / 100 + 1); return number_format($float, 2, ',', '') . "€"; }
  3. Roope's post in Search does not work was marked as the answer   
    I think that it has something to do with (page name) language support. Now your search form points to http://creacc.espaceproduction.com/rechercher/ but because of lang support page actually lives in lang prefixed url http://creacc.espaceproduction.com/fr/rechercher/. Now PW does redirect and thus loses the search query.   You could try something like this: <form id='search_form' action='<?php echo $pages->get("/rechercher/")->url; ?>' method='get'> <input type='text' name='q' id='search_query' value='<?php echo htmlentities($input->whitelist('q'), ENT_QUOTES, 'UTF-8'); ?>' /> <button type='submit' id='search_submit'>Rechercher</button> </form>
×
×
  • Create New...