Jump to content

vermich

Members
  • Posts

    104
  • Joined

  • Last visited

Profile Information

  • Location
    Lille
  • Activity
    Developer

vermich's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. I have this in authentification.tpl <p class="required text"> <input type="text" name="codece" id="codece" value="{if isset($smarty.post.codece)}{$smarty.post.codece}{/if}" /> <label for="codece">{l s='Code CE'}<sup>*</sup></label> </p> the module is ok. i think you just have to add this public $codece; in classes/Customer.php ( at the beginning). I also add this in controller/front/authcontroller.php line 380 $codecemaj = Tools::getValue('codece'); $codece = strtolower($codecemaj); if (!empty($codece)){ $sql = "SELECT COUNT(*) FROM ps_group_lang WHERE code = '$codece'"; $group_ce = Db::getInstance()->getValue($sql); if ( $group_ce == 0) $this->errors[] = Tools::displayError('Ce code CE existe pas.', false); } in order to show an error
  2. Bonjour à toutes et à tous, Souhaitant ajouter des marges différentes selon les groupes d'utilisateurs à partir du prix d'achat j'ai autorisé les réduction négative sur mon site ( en modifiant la vérification de la valeur ). Le problème et que sur mon site je gère maintenant deux société différentes qui souhaite avoir chacune une marge différente mais rendre possible une réduction négative sur les reductions par catégorie semble beaucoup plus compliqué. Quelqu'un aurait-t-il une idée de la marche à suivre. Merci d'avance et bon courage pour votre boulot.
  3. Hi everybody, I need your help in order to show the transaction_id in a new column in adminordercontroller.php I haven't find any solution. I think values are load in $this but i don't know how i can load ps_order_payment table: that's what i should modify ? : public function __construct() { $this->table = 'order'; $this->className = 'Order'; $this->lang = false; $this->addRowAction('view'); $this->explicitSelect = true; $this->allow_export = true; $this->deleted = false; $this->context = Context::getContext(); $this->_select = ' a.id_currency, a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`) LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$this->context->language->id.')'; $this->_orderBy = 'id_order'; $this->_orderWay = 'DESC';
  4. Bonjour à tous, Je suis en train de modifier les différentes listes de produit afin d'y afficher les caractéristiques (origine, dlc, poid) J'ai réussi à les faire apparaître dans les listes des blocs viewed product-list et homefeatured mais impossible de trouver comment les faire apparaître dans la liste des nouveau produit. Quelqu'un aurait il une solution. Merci d'avance. Romain
  5. I really need your help. i put this into blockviewed in order to get feature : $obj->features = Product::getFrontFeaturesStatic((int)$this->context->language->id, (int)$obj->id); $productsViewedObj[] = $obj; And smarty get it here: $this->smarty->assign(array( 'productsViewedObj' => $productsViewedObj, [size=4]'mediumSize' => Image::getSize('medium')));[/size] But in blocknewproduct there is no $Obj so i don't no how to replace (int)$obj->id. I'm lost and my brain is burning. Thanks for your time.
  6. En creusant un peu j'ai de nouvelles infos: Le tpl qui affiche les infos et le même pour les deux type de message (message.tpl) donc pas de problème de ce coté là. L'id de l'order n'ai pas enregistré en base dans ps_customer_thread Le problème vient donc du fichier Orderdetailscontroller. Donc tout marche depuis le fichier Contactcontroller.php mais pas depuis Orderdetailscontroller. Mais de mon coté je ne trouve pas le problème. Si quelqu'un de meilleur que moi peut y jeter un coup d'oeil.
  7. Bonjours à tous, J'ai constater que lorsque le client envoi un message au sav depuis la page de récapitulatif de commande il peut choisir le produit concerné mais l'information n’apparaît pas dans son message coté backoffice. La même fonctionnalité est présente pour les message envoyé de la page contact est n'a pas de soucis. J'ai testé sur un prestashop vierge et c'est la même chose. Avez-vous ce problème ? quelqu'un sait il comment réparer cette fonctionnalité ? Merci d'avance et bonne journée à tous.
  8. Hi everybody, I would like to get features in my blocknewproduct I do this but that take origin (the first in bdd i think ) and show it in every sheet: <dl class="products"> {foreach from=$new_products item=newproduct name=myLoop} <dt class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}">{$newproduct.name}</a></dt> <!-- {if $newproduct.description_short}<dd class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><p><a href="{$newproduct.link}">{$newproduct.description_short|truncate:75:'...'}</a><br /><a href="{$newproduct.link}" class="lnk_more">{l s='Read more' mod='blocknewproducts'}</a></p></dd>{/if} --> {if $product.features}<dd> <!-- product's features --> {foreach from=$product.features item=feature name=features} {if $feature.id_feature != 10 && $feature.id_feature != 9} <span>{$feature.value|escape:'htmlall':'UTF-8'}</span><br /> {/if} {if $feature.id_feature == 9 } <span>{$feature.name|escape:'htmlall':'UTF-8'}: {$feature.value|escape:'htmlall':'UTF-8'}</span><br /> {/if} {/foreach} <!-- product's features --> </dd> {/if} {/foreach} </dl>
  9. Bonjour à tous, Pour mon site j'ai décidé de placé tout les prix en HT sur lesquels sont ajoutés les taxes puis ma marge. Pour la marge, celle-ci dépendant des groupes j'ai réussi à transformer la réduction par groupe en augmentation par groupe. Pour cela j'ai modifié le fichier AdminGroupController un peu salement et j'appose une réduction négative. protected function validateDiscount($reduction) { if (!Validate::isPrice($reduction) || $reduction > 100 || $reduction < 0) return true; else return true; } Le problème et que maintenant j'ai besoin d'apposé l'augmentation par catégorie, j'ai donc essayer de faire la même chose sur le formulaire d'ajout de réduction par categorie mais impossible de trouver où ça coince je ne comprend pas le cheminement. [PrestaShopException] Property GroupReduction->reduction is not valid at line 837 in file classes/ObjectModel.php 831. 832. $message = $this->validateField($field, $this->$field); 833. if ($message !== true) 834. { 835. if ($die) 836. throw new PrestaShopException($message); 837. return $error_return ? $message : false; 838. } 839. } 840. 841. return true; ObjectModelCore->validateFields - 259. * 260. * @return array All object fields 261. */ 262. public function getFields() 263. { 264. $this->validateFields(); 265. $fields = $this->formatFields(self::FORMAT_COMMON); 266. 267. // For retro compatibility 268. if (Shop::isTableAssociated($this->def['table'])) 269. $fields = array_merge($fields, $this->getFieldsShop()); ObjectModelCore->getFields - 459. // Database insertion 460. if (isset($this->id) && !Tools::getValue('forceIDs')) 461. unset($this->id); 462. if (Shop::checkIdShopDefault($this->def['table'])) 463. $this->id_shop_default = min($id_shop_list); 464. if (!$result = ObjectModel::$db->insert($this->def['table'], $this->getFields(), $null_values)) 465. return false; 466. 467. // Get object id in database 468. $this->id = ObjectModel::$db->Insert_ID(); 469. ObjectModelCore->add - 44. 45. protected static $reduction_cache = array(); 46. 47. public function add($autodate = true, $null_values = false) 48. { 49. return (parent::add($autodate, $null_values) && $this->_setCache()); 50. } 51. 52. public function update($null_values = false) 53. { 54. return (parent::update($null_values) && $this->_updateCache()); GroupReductionCore->add - 421. * @param bool $autodate 422. * @return boolean Insertion result 423. */ 424. public function save($null_values = false, $autodate = true) 425. { 426. return (int)$this->id > 0 ? $this->update($null_values) : $this->add($autodate, $null_values); 427. } 428. 429. /** 430. * Add current object to database 431. * ObjectModelCore->save - Argument] 476. $category->addGroupsIfNoExist((int)Tools::getValue('id_group')); 477. $group_reduction = new GroupReduction(); 478. $group_reduction->id_group = (int)Tools::getValue('id_group'); 479. $group_reduction->reduction = (float)($reduction / 100); 480. $group_reduction->id_category = (int)$cat; 481. if (!$group_reduction->save()) 482. $this->errors[] = Tools::displayError('You cannot save group reductions.'); 483. } 484. } 485. } 486. } AdminGroupsControllerCore->updateCategoryReduction 394. { 395. if (!$this->validateDiscount(Tools::getValue('reduction'))) 396. $this->errors[] = Tools::displayError('The discount value is incorrect (must be a percentage).'); 397. else 398. { 399. $this->updateCategoryReduction(); 400. $object = parent::processSave(); 401. $this->updateRestrictions(); 402. return $object; 403. } 404. } AdminGroupsControllerCore->processSave 535. { 536. // Hook before action 537. Hook::exec('actionAdmin'.ucfirst($this->action).'Before', array('controller' => $this)); 538. Hook::exec('action'.get_class($this).ucfirst($this->action).'Before', array('controller' => $this)); 539. // Call process 540. $return = $this->{'process'.Tools::toCamelCase($this->action)}(); 541. // Hook After Action 542. Hook::exec('actionAdmin'.ucfirst($this->action).'After', array('controller' => $this, 'return' => $return)); 543. Hook::exec('action'.get_class($this).ucfirst($this->action).'After', array('controller' => $this, 'return' => $return)); 544. 545. return $return; AdminControllerCore->postProcess -Argument] 152. // setMedia MUST be called before postProcess 153. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) 154. $this->setMedia(); 155. 156. // postProcess handles ajaxProcess 157. $this->postProcess(); 158. 159. if (!empty($this->redirect_after)) 160. $this->redirect(); 161. 162. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) ControllerCore->run - 343. // Execute hook dispatcher 344. if (isset($params_hook_action_dispatcher)) 345. Hook::exec('actionDispatcher', $params_hook_action_dispatcher); 346. 347. // Running controller 348. $controller->run(); 349. } 350. catch (PrestaShopException $e) 351. { 352. $e->displayMessage(); 353. } DispatcherCore->dispatch - 44. $_POST['controller'] = strtolower($_POST['tab']); 45. if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) 46. $_REQUEST['controller'] = strtolower($_REQUEST['tab']); 47. 48. // Prepare and trigger admin dispatcher 49. Dispatcher::getInstance()->dispatch();
  10. No idea juste where is the tpl for the backoffice product-list ?
  11. didn't work i think i made a bad explanation. i want to remove that tag :
×
×
  • Create New...