Jump to content

ciolo18

Members
  • Posts

    13
  • Joined

  • Last visited

ciolo18's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, I want to add a mandatory checkbox in Contact form to throw an error message when the checkbox is not checked , I followed the steps from tutorial, but the error doesn't appear, something I did wrong. Please help, This is the code inserted in contact-form.tpl <h3 class="page-subheading"> Confidențialitate date client</h3><div style="width:21px; float:left;"><div class="required checkbox"> <div class="checker" id="uniform-customer_privacy"> <span class="checkbox"> <label for="ps_customer_checkbox">{l s=''}</label> {if isset($customerThread.ps_customer_checkbox)} <input type="checkbox" id="ps_customer_checkbox" name="ps_customer_checkbox" value="{$customerThread.ps_customer_checkbox|escape:'htmlall':'UTF-8'}" readonly="readonly" /> {else} <input type="checkbox" value="1" id="ps_customer_checkbox" name="ps_customer_checkbox" autocomplete="off"> {/if} </span> </div></div></div><div style="width: 92%; float: left; margin-top: 8px;"> <label for="customer_priv" style="font-weight: normal;"><!--? xml version="1.0" encoding="UTF-8" ?--><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> Datele personale oferite de dumneavoastră sunt confidentiale *</label></div> The CustomerTheard,php: <?php class CustomerThread extends CustomerThreadCore { public $ps_customer_checkbox; public static $definition = array( 'table' => 'customer_thread', 'primary' => 'id_customer_thread', 'fields' => array( 'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_contact' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_customer' =>array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'size' => 254), 'token' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true), 'status' => array('type' => self::TYPE_STRING), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'ps_customer_checkbox' => array('type' => self::TYPE_BOOL, 'validate' =>'isBool', 'required' => true), ), ); } The code from ContactController from override/controllers/front/ContactController.php if ($contact->customer_service) { if ((int)$id_customer_thread) { $ct = new CustomerThread($id_customer_thread); $ct->status = 'open'; $ct->id_lang = (int)$this->context->language->id; $ct->id_contact = (int)$id_contact; $ct->id_order = (int)$id_order; if ($id_product = (int)Tools::getValue('id_product')) { $ct->id_product = $id_product; } $ct->ps_customer_checkbox = (int)Tools::getValue('ps_customer_checkbox'); $ct->update(); } else { $ct = new CustomerThread(); if (isset($customer->id)) { $ct->id_customer = (int)$customer->id; } $ct->id_shop = (int)$this->context->shop->id; $ct->id_order = (int)$id_order; if ($id_product = (int)Tools::getValue('id_product')) { $ct->id_product = $id_product; } $ct->id_contact = (int)$id_contact; $ct->id_lang = (int)$this->context->language->id; $ct->email = $from; $ct->status = 'open'; $ct->token = Tools::passwdGen(12); $ct->ps_customer_checkbox = (int)Tools::getValue('ps_customer_checkbox') $ct->add(); } if ($ct->ps_customer_checkbox = 0){ $this->errors[] = Tools::displayError('Arunca-mi eroare'); The db is populated when the checkbox is unchecked, but no error is thrown. Thanks in advance, Cristi
  2. Ok, mersi mult, am rezolvat treaba atata ca in judetul Cluj numa pot face , nu numai in Municipiul Cluj Napoca, adica daca clientul e din Belis, sau Mihai Viteazu de exemplu ii apare tot transport gratis.
  3. La metoda de livrare, am 2 metode, prin fan curier si livrare gratuita in Municipiul Cluj-Napoca, cum as putea face ca, clientul care nu e din cluj napoca sa nu poata accesa metoda de livrare sau daca nu este din judetul cluj sa nu poata accesa aceasta metoda?Precizez ca am pus comanda minima 150ron si livrare gratuita de peste 300 de lei prin fan curier( in Cluj Napoca e gratis de la 150ron in sus)Va multumesc.
  4. Mie imi afiseaza la total pretul fara tva + taxele postale nu sunt incluse in pret
  5. Buna, am modificat cu modzilla firebug aranjarea din header care arata ca in imaginea de mai jos, dar in internet explorer imi apar mai dezordonate.Care ar fi rezolvarea?
  6. I had same problem and I just delete ajax-cart.js from modules->blockcart and now it works!!
  7. Multumesc cristi, s-a rezolvat!!!
  8. Buna ziua, as dori sa pun comanda minima 150RON, cum procedez? Adica clientul sa nu poata finaliza comanda decat daca are minim 150RON in cont!!
  9. @bluestyle te duci la fiecare produs din categoria granule si il pui si in categoria accesorii si in acvaristica, si ai rezolvat problema, plus cand dai accesorii iti apar toate produsele pe prima pagina din categoria accesorii, sper ca te am ajutat:)
  10. Am rezolvat treaba din BO->Preferences->Performance->Alcatuieste Fortat- Da
  11. Am instalat modulul si imi apare in paranteza (0) chiar daca sunt produse in categorii!!! Care ar fii solutia?
  12. Buna, am instalat modulul facebook like si apoi modulul facebook fan page, problema e ca din momentul in care am instalat facebook fan page, facebook like mi a disparut.Ce ar fii de facut?
×
×
  • Create New...