Jump to content

zouhairHajji

Members
  • Posts

    39
  • Joined

  • Last visited

1 Follower

Profile Information

  • First Name
    zouhair
  • Last Name
    HAJJI

Recent Profile Visitors

60 profile views

zouhairHajji's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. essaye ceci : $this->context->smarty->assign('code', "x45f454fe5f");
  2. i overrided the method createTemplate($template) public function __construct() { parent::__construct(); $this->template = 'displayAdmin.tpl'; } public function createTemplate($tpl_name) { // Use override tpl if it exists // If view access is denied, we want to use the default template that will be used to display an error if ($this->viewAccess() && $this->override_folder) { if (file_exists($this->context->smarty->getTemplateDir(1) . DIRECTORY_SEPARATOR . $this->override_folder . $tpl_name)) return $this->context->smarty->createTemplate($this->override_folder . $tpl_name, $this->context->smarty); elseif (file_exists($this->context->smarty->getTemplateDir(0) . 'controllers' . DIRECTORY_SEPARATOR . $this->override_folder . $tpl_name)) return $this->context->smarty->createTemplate('controllers' . DIRECTORY_SEPARATOR . $this->override_folder . $tpl_name, $this->context->smarty); } return $this->context->smarty->createTemplate(_PS_MODULE_DIR_.'symstick\views\templates\admin\symstick/'. $tpl_name, $this->context->smarty); } and now it work, i don't know if i can use it like that or non
  3. i have the same problem, but i did the same step like you, but i still have the same problem. my error is : Fatal error: Uncaught --> Smarty: Unable to load template file 'C:\xampp\htdocs\prestashop\admin215kx66zt/themes/default\template\symstick' <-- thrown in C:\xampp\htdocs\prestashop\tools\smarty\sysplugins\smarty_internal_templatebase.php on line 129 class AdminSynchroController extends ModuleAdminController { public function __construct() { parent::__construct(); $this->tpl_folder = 'symstick'; $this->setTemplate($this->tpl_folder); } cou can help me please ?
  4. 100 * 20 / 100 = 20 euros, 100 euros - 20 euros = 80 euros non ? pourquoi c'est 83.33 ? merci beaucoup
  5. merci Coeos.pro pour votre reponse, Je ne comprend pas, je me demande si ceci est du par une mauvaise manipulation ou suite d'un erreur de calcule merci
  6. Bonjour, je rencontre un petit problème avec mon site internet, en effet, quand je rajoute un nouveau produitavec une tva 20% Le prix hors tax devra être : 80 euros Le prix ttc devra être :100 euros mais mon site m'affiche des bêtises Merci pour votre aide
  7. LuzoWeb Merci beaucoup, j'ai deja essayé ce que vous m'avez montré, mais ca ne marche pas :/
  8. Merci J. Danse J'ai déjà vu ce projet sur Git, sauf que ce fichier php que vous m'avez donnez n'accede pas a la vue, il l'a genere à l'aide du modèle. Je me demande si on peut afficher une vue comme cette méthode : public function displayForm() { $this->context->smarty->assign('request_uri', Tools::safeOutput($_SERVER['REQUEST_URI'])); $this->context->smarty->assign('path', $this->_path); $this->context->smarty->assign('EXAMPLE_CONF', pSQL(Tools::getValue('EXAMPLE_CONF', Configuration::get('EXAMPLE_CONF')))); $this->context->smarty->assign('submitName', 'submit'.Tools::ucfirst($this->name)); $this->context->smarty->assign('errors', $this->errors); // You can return html, but I prefer this new version: use smarty in admin, return $this->display(__FILE__, 'views/templates/admin/configure.tpl'); } merci beaucoup
  9. Bonjour, On est un petit groupe de développeur qui souhaitent créer un module prestashop, sauf que on a pas bien maitriser comment afficher une view à l'utilisateur du Back-office Actuellement on a su comment utiliser le modèle avec le controller "extends adminController". Est ce que quelqun sait comment faire pour afficher une view. merci
  10. Merci beaucoup okom3pom . Voici le script que j'ai réaliser : INSERT INTO `ps_product` (`id_shop_default`, `id_manufacturer`, `id_supplier`, `reference`, `supplier_reference`, `location`, `width`, `height`, `depth`, `weight`, `quantity_discount`, `ean13`, `upc`, `cache_is_pack`, `cache_has_attachments`, `is_virtual`, `id_category_default`, `id_tax_rules_group`, `on_sale`, `online_only`, `ecotax`, `minimal_quantity`, `price`, `wholesale_price`, `unity`, `unit_price_ratio`, `additional_shipping_cost`, `customizable`, `text_fields`, `uploadable_files`, `active`, `redirect_type`, `id_product_redirected`, `available_for_order`, `available_date`, `condition`, `show_price`, `indexed`, `visibility`, `cache_default_attribute`, `advanced_stock_management`, `date_add`, `date_upd`, `pack_stock_type`) VALUES ("1", "0", "0", "reference", "", "", "0", "0", "0", "0", "0", "9999999999999", "", "0", "0", "0", "2", "1", "0", "0", "0", "1", "123457", "0", "", "0", "0", "0", "0", "0", "1", "404", "0", "1", "0000-00-00", "new", "1", "0", "both", "0", "0", "2015-06-01 12:06:27", "2015-06-01 12:06:27", "3"); INSERT INTO `ps_product_lang` (`id_product`, `meta_description`, `meta_keywords`, `meta_title`, `link_rewrite`, `name`, `description`, `description_short`, `available_now`, `available_later`, `id_lang`, `id_shop`) select max(a.id_product), "", "", "", "name", "name", " reference ", " résumé reference ", "", "", "1", "1" from ps_product a; INSERT INTO `ps_category_product` (`id_category`, `id_product`, `position`) select "2", max(a.id_product), "7" from ps_product a; INSERT INTO `ps_stock_available` (`out_of_stock`, `id_product`, `id_product_attribute`, `id_shop_group`, `id_shop`, `quantity`) select "2", max(a.id_product), "0", "0", "1", "10" from ps_product a; INSERT INTO `ps_product_shop` (`id_product`, `id_category_default`, `id_tax_rules_group`, `on_sale`, `online_only`, `ecotax`, `minimal_quantity`, `price`, `wholesale_price`, `unity`, `unit_price_ratio`, `additional_shipping_cost`, `customizable`, `text_fields`, `uploadable_files`, `active`, `redirect_type`, `id_product_redirected`, `available_for_order`, `available_date`, `condition`, `show_price`, `indexed`, `visibility`, `cache_default_attribute`, `advanced_stock_management`, `date_add`, `date_upd`, `pack_stock_type`, `id_shop`) select max(a.id_product), "2", "1", "", "0", "0", "1", "", "0", "", "0", "0", "0", "0", "0", "1", "404", "0", "1", "0000-00-00", "new", "1", "0", "both", "0", "0", "2015-06-01 12:06:27", "2015-06-01 12:06:27", "3", "1" from ps_product a; insert into ps_specific_price_priority (id_product,priority) select max(a.id_product), "id_shop;id_currency;id_country;id_group" from ps_product a; UPDATE `ps_product_shop` pps SET `price` = "123457" WHERE pps.`id_product` = (select max(id_product) from ps_product ) AND pps.`id_shop` = (select id_shop from ps_product where id_product = (select max(id_product) from ps_product ) ); le code php qui permet de générer ce script : public function startSynchronisation(){ $idTaxRule = '1'; $quantity = '10'; $name = 'name'; $description = 'reference'; $prixDeBase = '123457'; $this->content .= $this->GenerateScript_Produit( array('reference' => 'reference', 'EAN' => '9999999999999', 'prixDeBase' => $prixDeBase, 'idTaxRule' => $idTaxRule) ); $this->content .= '<br><br>'; $this->content .= $this->GenerateScript_product_lang( array('description' => $description, 'name' => $name) ); $this->content .= '<br><br>'; $this->content .= $this->GenerateScript_category_product(); $this->content .= '<br><br>'; $this->content .= $this->GenerateScript_stock_available( array('quantity' => $quantity) ); $this->content .= '<br><br>'; $this->content .= $this->GenerateScript_product_shop( array('prixDeBase' => $prixDeBase, 'idTaxRule' => $idTaxRule) ); $this->content .= '<br><br>'; $this->content .= $this->GenerateScript_specific_price_priority(); $this->content .= '<br><br>'; $this->content .= $this->GenerateScript_updatePrice( array('beginPrice' => $prixDeBase) ); } /** args( reference,EAN,prixDeBase,idTaxRule ) */ public function GenerateScript_Produit($args){ $res = ''; $res .= 'INSERT INTO `'._DB_PREFIX_.'product` (`id_shop_default`, `id_manufacturer`, `id_supplier`, `reference`, `supplier_reference`, `location`, `width`, `height`, `depth`, `weight`, `quantity_discount`, `ean13`, `upc`, `cache_is_pack`, `cache_has_attachments`, `is_virtual`, `id_category_default`, `id_tax_rules_group`, `on_sale`, `online_only`, `ecotax`, `minimal_quantity`, `price`, `wholesale_price`, `unity`, `unit_price_ratio`, `additional_shipping_cost`, `customizable`, `text_fields`, `uploadable_files`, `active`, `redirect_type`, `id_product_redirected`, `available_for_order`, `available_date`, `condition`, `show_price`, `indexed`, `visibility`, `cache_default_attribute`, `advanced_stock_management`, `date_add`, `date_upd`, `pack_stock_type`) VALUES ("1", "0", "0", "'.$args['reference'].'", "", "", "0", "0", "0", "0", "0", "'.$args['EAN'].'", "", "0", "0", "0", "2", "'.$args['idTaxRule'].'", "0", "0", "0", "1", "'.$args['prixDeBase'].'", "0", "", "0", "0", "0", "0", "0", "1", "404", "0", "1", "0000-00-00", "new", "1", "0", "both", "0", "0", "'.date("Y-m-d").' '.date("H:i:s").'", "'.date("Y-m-d").' '.date("H:i:s").'", "3"); '; return $res; } /** args( description, name, resumé = false ) */ public function GenerateScript_product_lang($args){ $res = ''; $res .= 'INSERT INTO `ps_product_lang` (`id_product`, `meta_description`, `meta_keywords`, `meta_title`, `link_rewrite`, `name`, `description`, `description_short`, `available_now`, `available_later`, `id_lang`, `id_shop`) select max(a.id_product), "", "", "", "'.$args['name'].'", "'.$args['name'].'", "<p>'.$args['description'].'</p>", "<p>résumé '.$args['description'].'</p>", "", "", "1", "1" from ps_product a; '; return $res; } public function GenerateScript_category_product(){ $res = ''; $res .= 'INSERT INTO `ps_category_product` (`id_category`, `id_product`, `position`) select "2", max(a.id_product), "7" from ps_product a; '; return $res; } /** args( quantity ) */ public function GenerateScript_stock_available($args){ $res = ''; $res .= 'INSERT INTO `ps_stock_available` (`out_of_stock`, `id_product`, `id_product_attribute`, `id_shop_group`, `id_shop`, `quantity`) select "2", max(a.id_product), "0", "0", "1", "'.$args['quantity'].'" from ps_product a; '; return $res; } /** args( prixDeBase,idTaxRule ) */ public function GenerateScript_product_shop($arrays){ $res = ''; $res .= 'INSERT INTO `ps_product_shop` (`id_product`, `id_category_default`, `id_tax_rules_group`, `on_sale`, `online_only`, `ecotax`, `minimal_quantity`, `price`, `wholesale_price`, `unity`, `unit_price_ratio`, `additional_shipping_cost`, `customizable`, `text_fields`, `uploadable_files`, `active`, `redirect_type`, `id_product_redirected`, `available_for_order`, `available_date`, `condition`, `show_price`, `indexed`, `visibility`, `cache_default_attribute`, `advanced_stock_management`, `date_add`, `date_upd`, `pack_stock_type`, `id_shop`) select max(a.id_product), "2", "1", "'.$args['idTaxRule'].'", "0", "0", "1", "'.$args['prixDeBase'].'", "0", "", "0", "0", "0", "0", "0", "1", "404", "0", "1", "0000-00-00", "new", "1", "0", "both", "0", "0", "'.date("Y-m-d").' '.date("H:i:s").'", "'.date("Y-m-d").' '.date("H:i:s").'", "3", "1" from ps_product a; '; return $res; } /** args( quantity ) */ public function GenerateScript_specific_price_priority(){ $res = ''; $res .= 'insert into ps_specific_price_priority (id_product,priority) select max(a.id_product), "id_shop;id_currency;id_country;id_group" from ps_product a;'; return $res; } /** args( beginPrice ) */ public function GenerateScript_updatePrice($args){ $res = ''; $res .= 'UPDATE `ps_product_shop` pps SET `price` = "'.$args['beginPrice'].'" WHERE pps.`id_product` = (select max(id_product) from ps_product ) AND pps.`id_shop` = (select id_shop from ps_product where id_product = (select max(id_product) from ps_product ) );'; return $res; }
  11. quand j'essaye de modifier le prix, et puis chercher les script sql ou il y a update ou insert, je trouve aucun script qui correspond au prix final.
  12. Votre post que vous avez postez okom3pom m'a vraiment aidé, merci beaucoup, en effet je n'arrive pas a créer un produit avec son prix, quand je crée un produit prestashop lui attribue comme prix final 00.00, voici la requette que j'ai pu réalier : INSERT INTO `ps_product` (`id_shop_default`, `id_manufacturer`, `id_supplier`, `reference`, `supplier_reference`, `location`, `width`, `height`, `depth`, `weight`, `quantity_discount`, `ean13`, `upc`, `cache_is_pack`, `cache_has_attachments`, `is_virtual`, `id_category_default`, `id_tax_rules_group`, `on_sale`, `online_only`, `ecotax`, `minimal_quantity`, `price`, `wholesale_price`, `unity`, `unit_price_ratio`, `additional_shipping_cost`, `customizable`, `text_fields`, `uploadable_files`, `active`, `redirect_type`, `id_product_redirected`, `available_for_order`, `available_date`, `condition`, `show_price`, `indexed`, `visibility`, `cache_default_attribute`, `advanced_stock_management`, `date_add`, `date_upd`, `pack_stock_type`) VALUES ("1", "0", "0", "reference", "", "", "0", "0", "0", "0", "0", "9999999999999", "", "0", "0", "0", "2", "1", "0", "0", "0", "1", "123457", "0", "", "0", "0", "0", "0", "0", "1", "404", "0", "1", "0000-00-00", "new", "1", "0", "both", "0", "0", "2015-06-01 11:15:23", "2015-06-01 11:15:23", "3"); INSERT INTO `ps_product_lang` (`id_product`, `meta_description`, `meta_keywords`, `meta_title`, `link_rewrite`, `name`, `description`, `description_short`, `available_now`, `available_later`, `id_lang`, `id_shop`) select max(a.id_product), "", "", "", "name", "name", " reference ", " résumé reference ", "", "", "1", "1" from ps_product a; INSERT INTO `ps_category_product` (`id_category`, `id_product`, `position`) select "2", max(a.id_product), "7" from ps_product a; INSERT INTO `ps_stock_available` (`out_of_stock`, `id_product`, `id_product_attribute`, `id_shop_group`, `id_shop`, `quantity`) select "2", max(a.id_product), "0", "0", "1", "10" from ps_product a; INSERT INTO `ps_product_shop` (`id_product`, `id_category_default`, `id_tax_rules_group`, `on_sale`, `online_only`, `ecotax`, `minimal_quantity`, `price`, `wholesale_price`, `unity`, `unit_price_ratio`, `additional_shipping_cost`, `customizable`, `text_fields`, `uploadable_files`, `active`, `redirect_type`, `id_product_redirected`, `available_for_order`, `available_date`, `condition`, `show_price`, `indexed`, `visibility`, `cache_default_attribute`, `advanced_stock_management`, `date_add`, `date_upd`, `pack_stock_type`, `id_shop`) select max(a.id_product), "2", "1", "", "0", "0", "1", "", "", "", "0", "0", "0", "0", "0", "1", "404", "0", "1", "0000-00-00", "new", "1", "0", "both", "0", "0", "2015-06-01 11:15:23", "2015-06-01 11:15:23", "3", "1" from ps_product a; le script est opérationnel, vous pouvez le tester sans problème.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More