Jump to content

quendi

Members
  • Posts

    55
  • Joined

  • Last visited

Profile Information

  • Location
    Poland

Recent Profile Visitors

3,805,100 profile views

quendi's Achievements

  1. Hi, Is it possible to display information about product availability on the order confirmation page and in the order confirmation email, but in the state before clicking "Confirm order". Example: The product is in quantity 1 in stock. The customer is shown the inscription: "product available in stock". The customer orders this product and such an inscription also appears on the order confirmation page (e.g. under the product name). Currently, the quantity of the product is displayed after the order, i.e. "the product is not available". Has anyone done this before and could guide me?
  2. Hi, I have problem with saving product images. When loading a picture, the progress bar works normally, the picture then appears, but after saving, the picture is not displayed (front and admin editing product- after refreshing - in list of product i can see image). I can see error 403 in console (chmod for all folders is 755, 644 for files). Prestashop 1.7.8.7. PHP 7.4.32
  3. As if someone was looking for 1.7.x it also works. To make simple URL, add: public function canonicalRedirection($canonicalURL = ''){ }
  4. Temat stary, ale też szukałem, więc daję linka dla potomnych https://github.com/PrestaShop/ps_cashondelivery Instrukcja instalacji: Pobrać poprzez Clone or Download -> Download ZIP Wypakować ZIPa Wejść w pierwszy folder i zmienić mu nazwę (usunąć '-master'). Spakować folder (nie zawartość) do ZIP. Zainstalować
  5. How can I disable the fields required when importing a CSV in an address? I do not want to delete fields, but they are unnecessary.
  6. How can I display the date of registration and the date of the last login of a given customer in frontoffice? Before asking questions, I know that such info is in the Customers tab, but I have to display it in the file my-account.tpl.
  7. Jak wyświetlić datę rejestracji oraz datę ostatniego logowania danego klienta we frontoffice? Uprzedzając pytania, tak wiem, że takie info jest w zakładce Klienci, ale muszę to wyświetlić w pliku my-account.tpl.
  8. I have made some additional fields in the client's address (PrestaShop 1.6.1.x) - however, when entering data, the values do not enter into the database. I added fields in the ps_address table, modified the files in the override directory (Address.php, AdminAdressessController.php). Address.php <?php class Address extends AddressCore { public $nr_faktury; public $symb_dok; public $data-wyst; public $termin; public $sposob_platnosci; public $opoznienie; public $kwota_faktury; public $nnaleznosc; public $nzobowiazanie; public $nn_razem; public $nz_razem; public $saldo; public static $definition = array( 'table' => 'address', 'primary' => 'id_address', 'fields' => array( 'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_warehouse' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_state' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId'), 'alias' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 32), 'company' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 64), 'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32), 'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32), 'vat_number' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), 'address1' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'required' => true, 'size' => 128), 'address2' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'size' => 128), 'postcode' => array('type' => self::TYPE_STRING, 'validate' => 'isPostCode', 'size' => 12), 'city' => array('type' => self::TYPE_STRING, 'validate' => 'isCityName', 'required' => true, 'size' => 64), 'other' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'size' => 300), 'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), 'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), 'dni' => array('type' => self::TYPE_STRING, 'validate' => 'isDniLite', 'size' => 16), 'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false), 'nr_faktury' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'symb_dok' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'data-wyst' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'termin' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'sposob_platnosci' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'opoznienie' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'kwota_faktury' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'nnaleznosc' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'nzobowiazanie' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'nn_razem' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'nz_razem' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'saldo' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), ), ); } AdminAddressesController.php <?php Class AdminAddressesController extends AdminAddressesControllerCore { public function renderForm() { $this->fields_form = array( 'legend' => array( 'title' => $this->l('Addresses'), 'icon' => 'icon-envelope-alt' ), 'input' => array( array( 'type' => 'text_customer', 'label' => $this->l('Customer'), 'name' => 'id_customer', 'required' => false, ), array( 'type' => 'text', 'label' => $this->l('Identification Number'), 'name' => 'dni', 'required' => false, 'col' => '4', 'hint' => $this->l('DNI / NIF / NIE') ), array( 'type' => 'text', 'label' => $this->l('Nr faktury'), 'name' => 'nr_faktury', 'required' => false, ), array( 'type' => 'text', 'label' => $this->l('Symbol dokumentu'), 'name' => 'symb_dok', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Data wystawienia'), 'name' => 'data_wyst', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Termin płatności'), 'name' => 'termin', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Sposób płatności'), 'name' => 'sposob_platnosci', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Opóźnienie'), 'name' => 'opoznienie', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Kwota faktury'), 'name' => 'kwota_faktury', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Niezapłacona należność'), 'name' => 'nnaleznosc', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Niezapłacone zobowiązanie'), 'name' => 'nzobowiazanie', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Razem należność'), 'name' => 'nn_razem', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Razem zobowiazanie'), 'name' => 'nz_razem', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Saldo'), 'name' => 'saldo', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Address alias'), 'name' => 'alias', 'required' => true, 'col' => '4', 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}' ), array( 'type' => 'text', 'label' => $this->l('Home phone'), 'name' => 'phone', 'required' => false, 'col' => '4', 'hint' => Configuration::get('PS_ONE_PHONE_AT_LEAST') ? sprintf($this->l('You must register at least one phone number.')) : '' ), array( 'type' => 'text', 'label' => $this->l('Mobile phone'), 'name' => 'phone_mobile', 'required' => false, 'col' => '4', 'hint' => Configuration::get('PS_ONE_PHONE_AT_LEAST') ? sprintf($this->l('You must register at least one phone number.')) : '' ), array( 'type' => 'textarea', 'label' => $this->l('Other'), 'name' => 'other', 'required' => false, 'cols' => 15, 'rows' => 3, 'hint' => $this->l('Forbidden characters:').' &lt;&gt;;=#{}' ), ), 'submit' => array( 'title' => $this->l('Save'), ) ); $id_customer = (int)Tools::getValue('id_customer'); if (!$id_customer && Validate::isLoadedObject($this->object)) $id_customer = $this->object->id_customer; if ($id_customer) { $customer = new Customer((int)$id_customer); $token_customer = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)$this->context->employee->id); } $this->tpl_form_vars = array( 'customer' => isset($customer) ? $customer : null, 'tokenCustomer' => isset ($token_customer) ? $token_customer : null ); // Order address fields depending on country format $addresses_fields = $this->processAddressFormat(); // we use delivery address $addresses_fields = $addresses_fields['dlv_all_fields']; $temp_fields = array(); foreach ($addresses_fields as $addr_field_item) { if ($addr_field_item == 'company') { $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('Company'), 'name' => 'company', 'required' => false, 'col' => '4', 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}' ); $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('VAT number'), 'col' => '2', 'name' => 'vat_number' ); } else if ($addr_field_item == 'lastname') { if (isset($customer) && !Tools::isSubmit('submit'.strtoupper($this->table)) && Validate::isLoadedObject($customer) && !Validate::isLoadedObject($this->object)) $default_value = $customer->lastname; else $default_value = ''; $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('Last Name'), 'name' => 'lastname', 'required' => true, 'col' => '4', 'hint' => $this->l('Invalid characters:').' 0-9!&amp;lt;&amp;gt;,;?=+()@#"�{}_$%:', 'default_value' => $default_value, ); } else if ($addr_field_item == 'firstname') { if (isset($customer) && !Tools::isSubmit('submit'.strtoupper($this->table)) && Validate::isLoadedObject($customer) && !Validate::isLoadedObject($this->object)) $default_value = $customer->firstname; else $default_value = ''; $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('First Name'), 'name' => 'firstname', 'required' => true, 'col' => '4', 'hint' => $this->l('Invalid characters:').' 0-9!&amp;lt;&amp;gt;,;?=+()@#"�{}_$%:', 'default_value' => $default_value, ); } else if ($addr_field_item == 'address1') { $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('Address'), 'name' => 'address1', 'col' => '6', 'required' => true, ); } else if ($addr_field_item == 'address2') { $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('Address').' (2)', 'name' => 'address2', 'col' => '6', 'required' => false, ); } elseif ($addr_field_item == 'postcode') { $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('Zip/Postal Code'), 'name' => 'postcode', 'col' => '2', 'required' => true, ); } else if ($addr_field_item == 'city') { $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('City'), 'name' => 'city', 'col' => '4', 'required' => true, ); } else if ($addr_field_item == 'country' || $addr_field_item == 'Country:name') { $temp_fields[] = array( 'type' => 'select', 'label' => $this->l('Country'), 'name' => 'id_country', 'required' => false, 'col' => '4', 'default_value' => (int)$this->context->country->id, 'options' => array( 'query' => Country::getCountries($this->context->language->id), 'id' => 'id_country', 'name' => 'name' ) ); $temp_fields[] = array( 'type' => 'select', 'label' => $this->l('State'), 'name' => 'id_state', 'required' => false, 'col' => '4', 'options' => array( 'query' => array(), 'id' => 'id_state', 'name' => 'name' ) ); } } // merge address format with the rest of the form array_splice($this->fields_form['input'], 3, 0, $temp_fields); return AdminController::renderForm(); } }
  9. Dodałem kilka pól w adresie klienta, ale podczas wprowadzania wartości nie zapisują się w bazie danych. Jak ręcznie wpiszę w tabelę (ps_address - pola wszędzie nazywają się tak samo), to wszystko ładnie potem widać w panelu. Gdzie robię błąd? Chciałbym też później dodawać kolejne pozycje poprzez import CSV, ten przechodzi bez błędów, ale również nie zapisuje do bazy. Niżej nadpisane pliki (w override): Address.php <?php class Address extends AddressCore { public $nr_faktury; public $symb_dok; public $data-wyst; public $termin; public $sposob_platnosci; public $opoznienie; public $kwota_faktury; public $nnaleznosc; public $nzobowiazanie; public $nn_razem; public $nz_razem; public $saldo; public static $definition = array( 'table' => 'address', 'primary' => 'id_address', 'fields' => array( 'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_warehouse' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_state' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId'), 'alias' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 32), 'company' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 64), 'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32), 'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32), 'vat_number' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), 'address1' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'required' => true, 'size' => 128), 'address2' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'size' => 128), 'postcode' => array('type' => self::TYPE_STRING, 'validate' => 'isPostCode', 'size' => 12), 'city' => array('type' => self::TYPE_STRING, 'validate' => 'isCityName', 'required' => true, 'size' => 64), 'other' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'size' => 300), 'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), 'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), 'dni' => array('type' => self::TYPE_STRING, 'validate' => 'isDniLite', 'size' => 16), 'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false), 'nr_faktury' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'symb_dok' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'data-wyst' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'termin' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'sposob_platnosci' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'opoznienie' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'kwota_faktury' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'nnaleznosc' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'nzobowiazanie' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'nn_razem' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'nz_razem' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'saldo' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), ), ); } AdminAddressesController.php <?php Class AdminAddressesController extends AdminAddressesControllerCore { public function renderForm() { $this->fields_form = array( 'legend' => array( 'title' => $this->l('Addresses'), 'icon' => 'icon-envelope-alt' ), 'input' => array( array( 'type' => 'text_customer', 'label' => $this->l('Customer'), 'name' => 'id_customer', 'required' => false, ), array( 'type' => 'text', 'label' => $this->l('Identification Number'), 'name' => 'dni', 'required' => false, 'col' => '4', 'hint' => $this->l('DNI / NIF / NIE') ), array( 'type' => 'text', 'label' => $this->l('Nr faktury'), 'name' => 'nr_faktury', 'required' => false, ), array( 'type' => 'text', 'label' => $this->l('Symbol dokumentu'), 'name' => 'symb_dok', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Data wystawienia'), 'name' => 'data_wyst', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Termin płatności'), 'name' => 'termin', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Sposób płatności'), 'name' => 'sposob_platnosci', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Opóźnienie'), 'name' => 'opoznienie', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Kwota faktury'), 'name' => 'kwota_faktury', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Niezapłacona należność'), 'name' => 'nnaleznosc', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Niezapłacone zobowiązanie'), 'name' => 'nzobowiazanie', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Razem należność'), 'name' => 'nn_razem', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Razem zobowiazanie'), 'name' => 'nz_razem', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Saldo'), 'name' => 'saldo', 'required' => false, ) ), array( 'type' => 'text', 'label' => $this->l('Address alias'), 'name' => 'alias', 'required' => true, 'col' => '4', 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}' ), array( 'type' => 'text', 'label' => $this->l('Home phone'), 'name' => 'phone', 'required' => false, 'col' => '4', 'hint' => Configuration::get('PS_ONE_PHONE_AT_LEAST') ? sprintf($this->l('You must register at least one phone number.')) : '' ), array( 'type' => 'text', 'label' => $this->l('Mobile phone'), 'name' => 'phone_mobile', 'required' => false, 'col' => '4', 'hint' => Configuration::get('PS_ONE_PHONE_AT_LEAST') ? sprintf($this->l('You must register at least one phone number.')) : '' ), array( 'type' => 'textarea', 'label' => $this->l('Other'), 'name' => 'other', 'required' => false, 'cols' => 15, 'rows' => 3, 'hint' => $this->l('Forbidden characters:').' &lt;&gt;;=#{}' ), ), 'submit' => array( 'title' => $this->l('Save'), ) ); $id_customer = (int)Tools::getValue('id_customer'); if (!$id_customer && Validate::isLoadedObject($this->object)) $id_customer = $this->object->id_customer; if ($id_customer) { $customer = new Customer((int)$id_customer); $token_customer = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)$this->context->employee->id); } $this->tpl_form_vars = array( 'customer' => isset($customer) ? $customer : null, 'tokenCustomer' => isset ($token_customer) ? $token_customer : null ); // Order address fields depending on country format $addresses_fields = $this->processAddressFormat(); // we use delivery address $addresses_fields = $addresses_fields['dlv_all_fields']; $temp_fields = array(); foreach ($addresses_fields as $addr_field_item) { if ($addr_field_item == 'company') { $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('Company'), 'name' => 'company', 'required' => false, 'col' => '4', 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}' ); $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('VAT number'), 'col' => '2', 'name' => 'vat_number' ); } else if ($addr_field_item == 'lastname') { if (isset($customer) && !Tools::isSubmit('submit'.strtoupper($this->table)) && Validate::isLoadedObject($customer) && !Validate::isLoadedObject($this->object)) $default_value = $customer->lastname; else $default_value = ''; $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('Last Name'), 'name' => 'lastname', 'required' => true, 'col' => '4', 'hint' => $this->l('Invalid characters:').' 0-9!&amp;lt;&amp;gt;,;?=+()@#"�{}_$%:', 'default_value' => $default_value, ); } else if ($addr_field_item == 'firstname') { if (isset($customer) && !Tools::isSubmit('submit'.strtoupper($this->table)) && Validate::isLoadedObject($customer) && !Validate::isLoadedObject($this->object)) $default_value = $customer->firstname; else $default_value = ''; $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('First Name'), 'name' => 'firstname', 'required' => true, 'col' => '4', 'hint' => $this->l('Invalid characters:').' 0-9!&amp;lt;&amp;gt;,;?=+()@#"�{}_$%:', 'default_value' => $default_value, ); } else if ($addr_field_item == 'address1') { $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('Address'), 'name' => 'address1', 'col' => '6', 'required' => true, ); } else if ($addr_field_item == 'address2') { $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('Address').' (2)', 'name' => 'address2', 'col' => '6', 'required' => false, ); } elseif ($addr_field_item == 'postcode') { $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('Zip/Postal Code'), 'name' => 'postcode', 'col' => '2', 'required' => true, ); } else if ($addr_field_item == 'city') { $temp_fields[] = array( 'type' => 'text', 'label' => $this->l('City'), 'name' => 'city', 'col' => '4', 'required' => true, ); } else if ($addr_field_item == 'country' || $addr_field_item == 'Country:name') { $temp_fields[] = array( 'type' => 'select', 'label' => $this->l('Country'), 'name' => 'id_country', 'required' => false, 'col' => '4', 'default_value' => (int)$this->context->country->id, 'options' => array( 'query' => Country::getCountries($this->context->language->id), 'id' => 'id_country', 'name' => 'name' ) ); $temp_fields[] = array( 'type' => 'select', 'label' => $this->l('State'), 'name' => 'id_state', 'required' => false, 'col' => '4', 'options' => array( 'query' => array(), 'id' => 'id_state', 'name' => 'name' ) ); } } // merge address format with the rest of the form array_splice($this->fields_form['input'], 3, 0, $temp_fields); return AdminController::renderForm(); } } Fragment AdminImportController.php case $this->entities[$this->l('Addresses')]: //Overwrite required_fields $this->required_fields = array( 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'country', 'customer_email', 'city' ); $this->available_fields = array( 'no' => array('label' => $this->l('Ignore this column')), 'id' => array('label' => $this->l('ID')), 'alias' => array('label' => $this->l('Alias *')), 'active' => array('label' => $this->l('Active (0/1)')), 'customer_email' => array('label' => $this->l('Customer email *')), 'id_customer' => array('label' => $this->l('Customer ID')), 'manufacturer' => array('label' => $this->l('Manufacturer')), 'supplier' => array('label' => $this->l('Supplier')), 'company' => array('label' => $this->l('Company')), 'lastname' => array('label' => $this->l('Last Name *')), 'firstname' => array('label' => $this->l('First Name *')), 'address1' => array('label' => $this->l('Address 1 *')), 'address2' => array('label' => $this->l('Address 2')), 'postcode' => array('label' => $this->l('Zip/postal code *')), 'city' => array('label' => $this->l('City *')), 'country' => array('label' => $this->l('Country *')), 'state' => array('label' => $this->l('State')), 'other' => array('label' => $this->l('Other')), 'phone' => array('label' => $this->l('Phone')), 'phone_mobile' => array('label' => $this->l('Mobile Phone')), 'vat_number' => array('label' => $this->l('VAT number')), 'dni' => array('label' => $this->l('DNI/NIF/NIE')), 'nr_faktury' => array('label' => $this->l('Nr faktury')), 'symb_dok' => array('label' => $this->l('Symbol dokumentu')), 'data_wyst' => array('label' => $this->l('Data wystawienia')), 'termin' => array('label' => $this->l('Termin płatności')), 'sposob_platnosci' => array('label' => $this->l('Sposób płatności')), 'opoznienie' => array('label' => $this->l('Opóźnienie')), 'kwota_faktury' => array('label' => $this->l('Kwota faktury')), 'nnaleznosc' => array('label' => $this->l('Niezapł. należ.')), 'nzobowiazanie' => array('label' => $this->l('Niezapł. zobow.')), 'nn_razem' => array('label' => $this->l('Razem niezpł. należ.')), 'nz_razem' => array('label' => $this->l('Razem niezpł. zobow.')), 'saldo' => array('label' => $this->l('Saldo')), ); self::$default_values = array( 'alias' => 'Alias', 'postcode' => 'X' ); break;
  10. Szukam osoby, która napisze dla mnie funkcję pobierania zdjęć przez moich klientów bezpośrednio ze strony kategorii produktów (znalazłem w sieci jeden moduł, ale w nim jest tylko możliwość pobierania zdjęć z karty produktu). Niżej opis, jak to powinno działać: 1. Przy produktach są checkboxy, które klient sklepu zaznacza przy wybranych przez siebie produktach (ew. wyżej jeden by zaznaczyć od razu wszystkie produkty). 2. Wyżej, mniej więcej w okolicy przycisku "Porównaj produkty" w domyślnym szablonie PS 1.6.x, jest przycisk "Pobierz zdjęcia". 3. Zdjęcia pobierają się w archiwum ZIP, najlepiej w oryginalnym rozmiarze, w jakim zostały załadowane podczas dodawania produktów do sklepu. Proszę o wycenę tutaj lub na PRIV.
  11. Mam problem z PrestaShop 1.7.3, który polega na tym, że nie widzi stron CMS, a strona z preferencjami kieruje na cms właśnie zamiast tam gdzie powinna. Kiedy ręcznie wpiszę adres zakładki preferencji, czyli: index.php?controller=AdminPreferences to strona się pojawia. Na sklepie co mi wiadomo był czyszczony cache i od tamtej pory się popsuło. Miał ktoś podobny problem? Nadpisuje pliki admina i kontrolerów, ale nie widać różnicy.
  12. Uwielbiam ten moment, kiedy zdążyłem zadać pytanie na forum i nagle mnie olśniło Daje rozwiązanie jakby ktoś kiedyś szukał. if ($field === 'vat_number') { $formField->setMaxLength('10'); $formField->setType('number'); }
  13. W którym miejscu, mogę zmienić typ pola input dla nr NIP z "text" na "number" oraz dodać wartość "maxlength" (dotyczy formularza rejestracji). Dłuższy czas już szukam i nie mogę sobie poradzić. PrestaShop 1.7.3
×
×
  • Create New...