Jump to content

Search the Community

Showing results for tags 'objectmodel.php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community Help and Support
    • PrestaShop Download
    • PrestaShop Addons
  • News and Announcements
    • PrestaShop news and releases
    • PrestaShop Beta
    • PrestaShop Blogs
    • PrestaShop Meetups
  • International community (English)
    • General topics
    • PrestaShop Merchants
    • PrestaShop Developers
    • Taxes, Translations & Laws
    • Community Modules and Themes
  • Forum francophone
    • Discussion générale
    • Aide et support communautaire
    • PrestaShop pour les marchands
    • PrestaShop pour les développeurs
    • Adaptation aux lois Québécoises
    • Modules et thèmes gratuits
    • Modules et thèmes payants
  • Foro en Español
    • Discusión general
    • Soporte de la comunidad y ayuda
    • Comerciantes PrestaShop
    • Desarrolladores PrestaShop
    • Módulos y plantillas gratuitas
  • Forum italiano
    • Forum generale
    • Aiuto e supporto della Community
    • Commercianti PrestaShop
    • Sviluppatori PrestaShop
    • Aspetti legali sull'eCommerce
    • Moduli e template gratuiti
  • Deutsches Forum
    • Generelle Fragen
    • Support und Hilfe aus der Community
    • e-Commerce/Versand-Handel mit Prestashop
    • Prestashop-Entwickler
    • Anpassung an deutsches Recht
    • Kostenlose Module und Templates
    • Generelle Fragen Copy
  • Nederlandstalig forum
    • Algemeen
    • Hulp en ondersteuning, van en voor de community
    • PrestaShop-winkeliers
    • PrestaShop-ontwikkelaars
    • Het aanpassen van PrestaShop
    • Gratis modules en templates
  • Fórum em Português
    • Fórum Geral
    • Ajuda e Suporte da Comunidade
    • Lojistas que utilizam o PrestaShop
    • Desenvolvedores PrestaShop
    • Legislação específica
    • Módulos e temas gratuitos
  • Polskie forum
    • Forum ogólne
    • Wsparcie i pomoc użytkowników
    • Oferty twórców PrestaShop
    • Deweloperzy PrestaShop
    • Darmowe Moduły i Szablony
  • Dansk forum
    • Generelt forum
    • Hjælp og support fra fællesskabet
    • PrestaShop for købmænd
    • PrestaShop for udviklere
    • Love og regler
    • Gratis moduler og temaer
  • České fórum
    • Instalasi, Konfigurasi dan upgrade
    • Obecná diskuze
    • Bezplatné moduly a šablony
    • PrestaShop vývojáři
    • PrestaShop obchodníci
  • Bahasa Indonesia
    • Diskusi Umum
    • Podpora a pomoc komunity
    • Laporan Bug
    • Jasa, Promosi & Lowongan Kerja
  • Svenskt forum
    • Allmän diskussion
    • Installation, konfigurering och uppdatering
  • Forumul românesc
    • Discuţii generale
    • Instalare, configurare şi upgrade
  • Pусский язык
    • Обсуждение скрипта
    • Установка, Настройка, Обновление
    • Прием багов
  • Slovenské fórum
    • Všeobecná diskusia
    • Podpora a pomoc komunity
    • PrestaShop obchodníci
    • PrestaShop vývojári
    • Bezplatné moduly a šablóny
  • Türkçe Topluluğu
    • Genel Konular
    • Topluluk desteği ve yardım
    • PrestaShop Tüccarları
    • Prestashop Geliştiricileri
    • Ücretsiz Modül ve Temalar
  • Diễn đàn tiếng Việt
    • Thảo luận chung
    • Hỗ trợ từ cộng đồng
    • Dành cho chủ doanh nghiệp / cửa hàng
    • Dành cho lập trình viên
  • PrestaShop Communities
    • اللغه العربيه [Arabic]
    • Ελληνικά [Greek]
    • עִבְרִית [Hebrew]
    • 中文
    • Magyar [Hungarian]
    • 日本語 [Japanese]
    • Lietuviškai [Lithuanian]
    • انجمن فارسی [Persian]
    • ไทย [Thai]
    • Malaysia [Malaysian]
    • Eesti [Estonian]
    • Slovenščina [Slovenian]
    • Српски [Serbian]
  • IP. Board Forum
    • IP. Board Forum Questions and Issues
  • Archive
    • Zapłać Moduły i Szablony [ARCHIVE]
    • Moduly, upravy a dizajn [ARCHIVE]
    • Phát triển và các mô-đun [ARCHIVE]
    • Yazılım, Modül ve Tema [ARCHIVE]
    • Модули, Шаблоны [ARCHIVE]
    • Module şi teme [ARCHIVE]
    • Pengembangan dan Modul [ARCHIVE]
    • Moduler och teman [ARCHIVE]
    • Ecommerce x PrestaShop [ARCHIVE BOARD]
    • Vývoj a moduly [ARCHIVE]
    • Kostenpflichtige Module, Templates [ARCHIVE]
    • Módulos y temas pagos [ARCHIVE]
    • Módulos e temas pagos [ARCHIVE]
    • Servizi commerciali [ARCHIVE]
    • Forum - Feedback Contributor
    • PrestaShop Cloud

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 8 results

  1. Hello everyone, I've an issue with my module. I'm using the Object Model associated with an Admin Controller to add custom “ranges” for the products that are multilingual and multishop. I've followed the tutorial on the devdocs of PrestaShop 1.7 but everything I've tried got me the same result : The data are inserting in all the table but not the main one (like in the attached picture). Here is my Gamme model : class Gamme extends ObjectModel { public $id; /** * @var int $id_product_gamme ID of the gamme */ public $id_product_gamme; /** * @var string $name Name of the gamme */ public $name; /** * @see ObjectModel::$definition */ public static $definition = array( 'table' => 'product_gamme', 'primary' => 'id_product_gamme', 'multilang' => true, 'multilang_shop' => true, 'fields' => array( // Lang field 'name' => array( 'type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 255 ), ), ); //Write the add method here, it add a gamme to the database and return the id of the gamme added public function add($autodate = true, $null_values = false) { if (parent::add($autodate, $null_values)) { $this->id_product_gamme = (int)$this->id; return true; } return false; } /* * Get a list of gamme objects * * @param int $id_lang ID of the language to get the gamme names in (default: current language) * @param bool $active Whether to only retrieve active gamme (default: true) * * @return array Array of Gamme objects */ public static function getGammes($id_lang = false, $id_shop = false) { $gammes = array(); $sql = 'SELECT g.`id_product_gamme` FROM `' . _DB_PREFIX_ . 'product_gamme` g ' . Shop::addSqlAssociation('product_gamme', 'g') . ' LEFT JOIN `' . _DB_PREFIX_ . 'product_gamme_lang` gl ON (g.`id_product_gamme` = gl.`id_product_gamme`' . Shop::addSqlRestrictionOnLang('gl') . ') LEFT JOIN `' . _DB_PREFIX_ . 'product_gamme_shop` gs ON (g.`id_product_gamme` = gs.`id_product_gamme`' . Shop::addSqlRestrictionOnLang('gs') . ') WHERE 1 ' . ($id_lang ? 'AND gl.`id_lang` = ' . (int)$id_lang : '') . ' ' . ($id_shop ? 'AND gs.`id_shop` = ' . (int)$id_shop : '') . ' ORDER BY g.`id_product_gamme` ASC'; $results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); foreach ($results as $row) { $gamme = new Gamme($row['id_product_gamme'], $id_lang); $gammes[] = $gamme; } return $gammes; } } The controller : require_once _PS_MODULE_DIR_ . 'elementfive/classes/Gamme.php'; class AdminElementFiveGammeController extends ModuleAdminController { public function __construct() { Shop::addTableAssociation('product_gamme', ['type' => 'shop']); Shop::addTableAssociation('product_gamme_lang', ['type' => 'fk_shop']); $this->bootstrap = true; $this->table = Gamme::$definition['table']; $this->className = 'Gamme'; $this->lang = true; $this->identifier = Gamme::$definition['primary']; $this->default_form_language = (int) Configuration::get('PS_LANG_DEFAULT'); $this->allow_employee_form_lang = (int) Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG'); $this->context = Context::getContext(); $this->fields_list = array( 'id_product_gamme' => array( 'title' => Context::getContext()->getTranslator()->trans('ID'), 'align' => 'center', 'class' => 'fixed-width-xs', ), 'name' => array( 'title' => Context::getContext()->getTranslator()->trans('Name'), 'filter_key' => 'b!name', 'lang' => true, ), ); $this->bulk_actions = array( 'delete' => array( 'text' => Context::getContext()->getTranslator()->trans('Delete selected'), 'confirm' => Context::getContext()->getTranslator()->trans('Would you like to delete the selected items?'), ) ); parent::__construct(); } public function renderForm() { $this->fields_form = [ 'legend' => [ 'title' => $this->l('Gamme'), 'icon' => 'icon-cogs' ], 'input' => [ [ 'type' => 'text', 'label' => $this->l('Name'), 'name' => 'name', 'lang' => true, 'required' => true, 'col' => 4, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}', 'empty_message' => $this->l('This field is required.'), ] ], 'submit' => [ 'title' => $this->l('Save'), 'name' => 'submitAdd' . $this->table, ] ]; if (Shop::isFeatureActive()) { $this->fields_form['input'][] = [ 'type' => 'shop', 'label' => $this->l('Shop association'), 'name' => 'id_shop', ]; } return parent::renderForm(); } } Thanks for helping me, let me know if I have to add more information.
  2. prestashop 1.7.6.5, but I got the same error 500 with version 1.7.6.2 The order process in front office works with no problems. If I try to create a new order from back office, when I save it I get error 500. The same error with or without disabling Overrides and non prestashop modules. Default Currency is Euro. Anyone have some idea? The following is the result of the Debug: [PrestaShopException] La proprietà Cart->id_currency è vuota. (Property Cart->id_currency is empty) at line 1003 in file classes/ObjectModel.php 998. } 999. 1000. $message = $this->validateField($field, $this->$field); 1001. if ($message !== true) { 1002. if ($die) { 1003. throw new PrestaShopException($message); 1004. } 1005. 1006. return $error_return ? $message : false; 1007. } 1008. } ObjectModelCore->validateFields - [line 292 - classes/ObjectModel.php] ObjectModelCore->getFields - [line 737 - classes/ObjectModel.php] ObjectModelCore->update - [line 295 - classes/Cart.php] - [1 Arguments] CartCore->update - [line 330 - modules/shippingaddress/shippingaddress.php] ShippingAddress->initializeShippingAddress - [line 186 - modules/shippingaddress/shippingaddress.php] ShippingAddress->hookActionGetIDZoneByAddressID - [line 970 - classes/Hook.php] - [1 Arguments] HookCore::coreCallHook - [line 355 - classes/Hook.php] - [3 Arguments]
  3. Bonjour, Après avoir tenté de migrer de version PHP 5.6 vers 7.0, le site est devenu inaccessible (erreur 500). J'ai tenté de supprimer le fichier www/cache/class_index.php mais cela ne solutionne pas le problème. Une idée? En mode debug "true": Fatal error: Interface 'Core_Foundation_Database_EntityInterface' not found in classes/ObjectModel.php on line 27 ou Warning: scandir(/home/novoflexik/www/Adapter/): failed to open dir: No such file or directory in www/classes/PrestaShopAutoload.php on line 184 Warning: scandir(): (errno 2): No such file or directory in www/classes/PrestaShopAutoload.php on line 184 Warning: Invalid argument supplied for foreach() in www/classes/PrestaShopAutoload.php on line 184 Warning: scandir(/home/novoflexik/www/Core/): failed to open dir: No such file or directory in www/classes/PrestaShopAutoload.php on line 184 Warning: scandir(): (errno 2): No such file or directory in www/classes/PrestaShopAutoload.php on line 184 Warning: Invalid argument supplied for foreach() in www/classes/PrestaShopAutoload.php on line 184 Fatal error: Interface 'Core_Foundation_Database_EntityInterface' not found in www/classes/ObjectModel.php on line 27
  4. Prestashop 7.3.2 Ineens, vanuit het niets, is mijn index-pagina op http://www.glasinlood-delden.nl/webshop2 nog maar half zichtbaar. Als ik in de module "aangepaste tekstblokken" kijk, is alles prima zichtbaar, maar als ik opsla zie ik de foutmeldingen zoals die in de bijlage is te zien. Kan iemand mij aub helpen??
  5. Buen dia comunidad y equipo de PrestaShop Como veran estoy teniendo incovenientes al instalar mercado pago en mi tienda de prestashop, el cual al momento de instalar emite el siguiente error. [PrestaShopException] Property OrderState->logable is not valid at line 917 in file classes/ObjectModel.php 912. } 913. 914. $message = $this->validateField($field, $this->$field); 915. if ($message !== true) { 916. if ($die) { 917. throw new PrestaShopException($message); 918. } 919. return $error_return ? $message : false; 920. } 921. } 922. ObjectModelCore->validateFields - [line 246 - classes/ObjectModel.php] ObjectModelCore->getFields - [line 487 - classes/ObjectModel.php] ObjectModelCore->add - [line 282 - modules/mercadopago/mercadopago.php] MercadoPago->createStates - [line 332 - modules/mercadopago/mercadopago.php] MercadoPago->install - [line 868 - controllers/admin/AdminModulesController.php] AdminModulesControllerCore->postProcessCallback - [line 1117 - controllers/admin/AdminModulesController.php] AdminModulesControllerCore->postProcess - [line 178 - classes/controller/Controller.php] ControllerCore->run - [line 367 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 58 - admin/index.php] Al actualizar la pagina el modulo se instala, pero de forma incompleta, ya que no aparece en metodos de pago. Espero su pronta colaboracion respeto a este problema, Cordialmente Cristian S Vargas G
  6. Hi, i have this error on fresh installation of Prestashop 1.6.3 version with base template: Property HomeSlide->position is empty at line 909 in file classes/ObjectModel.php Please help me to solve this error. Thanks in advance for the support. Sincerely, Fabio Perri.
  7. Acabo de migrar la web de servidor y me aparece el siguiente error al querer introducir un producto en la tienda. Utilizo la versión 1.5.2.0 sobre PHP 5.2.17, con límite de memoria 1024M y Tiempo Máximo de ejecución 300, Versión de MySQL: 5.5.44-MariaDB-1ubuntu0.14.04.1 y Motor MySQL: InnoDB. Catchable fatal error: Argument 2 passed to ObjectModelCore::hydrateCollection() must be an array, boolean given, called in /var/www/vhosts/web.com/httpdocs/classes/Collection.php on line 344 and defined in /var/www/vhosts/web.com/httpdocs/classes/ObjectModel.php on line 1364 Línea 304 del archivo Collection.php: $this->results = ObjectModel::hydrateCollection($this->classname, $this->results, $this->id_lang); Línea 1364 del archivo ObjectModel.php: public static function hydrateCollection($class, array $datas, $id_lang = null) { if (!class_exists($class)) throw new PrestaShopException("Class '$class' not found"); $collection = array(); $rows = array(); if ($datas) { $definition = ObjectModel::getDefinition($class); if (!array_key_exists($definition['primary'], $datas[0])) throw new PrestaShopException("Identifier '{$definition['primary']}' not found for class '$class'"); foreach ($datas as $row) { // Get object common properties $id = $row[$definition['primary']]; if (!isset($rows[$id])) $rows[$id] = $row; // Get object lang properties if (isset($row['id_lang']) && !$id_lang) foreach ($definition['fields'] as $field => $data) if (!empty($data['lang'])) { if (!is_array($rows[$id][$field])) $rows[$id][$field] = array(); $rows[$id][$field][$row['id_lang']] = $row[$field]; } } } // Hydrate objects foreach ($rows as $row) { $obj = new $class; $obj->hydrate($row, $id_lang); $collection[] = $obj; } return $collection; } ¿A alguien le sucedió esto mismo que me pueda ayudar?
  8. Давно обновил версию на 1.5.6.1. и больше не могу редактировать странички, выскакивает следующее: [PrestaShopException]Property CMS->content is not valid at line 878 in file classes/ObjectModel.php 872. 873. $message = $this->validateField($field, $value, $id_lang); 874. if ($message !== true) 875. { 876. if ($die) 877. throw new PrestaShopException($message); 878. return $error_return ? $message : false; 879. } 880. } 881. } 882. ObjectModelCore->validateFieldsLang - [line 296 - classes/ObjectModel.php] - [0 Argument] ObjectModelCore->getFieldsLang - [line 634 - classes/ObjectModel.php] - [0 Argument] ObjectModelCore->update - [line 75 - classes/CMS.php] - [1 Arguments] CMSCore->update - [line 334 - controllers/admin/AdminCmsController.php] - [0 Argument] AdminCmsControllerCore->postProcess - [line 121 - controllers/admin/AdminCmsContentController.php] - [0 Argument] AdminCmsContentControllerCore->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument] ControllerCore->run - [line 348 - classes/Dispatcher.php] - [0 Argument] Что делать - help
×
×
  • Create New...