Jump to content

a2dgroup

Members
  • Posts

    22
  • Joined

  • Last visited

Profile Information

  • Location
    Italy
  • Activity
    Web development agency

a2dgroup's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hello everyone, I'm trying to display the list of best-selling products for the search if id doesn't produce anything results. Not being very practical, I tried to copy part of the code that I find in the best-seller.tpl and paste it in the file search.tpl. {if $products} <div class="sortPagiBar shop_box_row shop_box_row clearfix"> {include file="./product-sort.tpl"} {include file="./nbr-product-page.tpl"} </div> {include file="./product-list.tpl" products=$products} <div class="bottom_pagination shop_box_row clearfix"> {include file="./product-compare.tpl" paginationId='bottom'} {include file="./pagination.tpl" paginationId='bottom'} </div> {else} <p class="alert alert-info">{l s='No top sellers for the moment.'}</p> {/if} However, I do not know how to initialize the variable $products and then nothing comes out. Can you indicate a simple solution to apply? I also tried to activate the module lock best sellers but I can not find the proper position where to show it. Thank you all for the help! Best regards
  2. Ciao a tutti, Sto provando a far visualizzare la lista dei prodotti più venduti per la ricerca non porta a nessun risultato. Non essendo molto pratico, ho provato a copiare parte del codice che trovo in best-seller.tpl e incollarlo nel file search.tpl. Il codice che ho preso è questo: {if $products} <div class="sortPagiBar shop_box_row shop_box_row clearfix"> {include file="./product-sort.tpl"} {include file="./nbr-product-page.tpl"} </div> {include file="./product-list.tpl" products=$products} <div class="bottom_pagination shop_box_row clearfix"> {include file="./product-compare.tpl" paginationId='bottom'} {include file="./pagination.tpl" paginationId='bottom'} </div> {else} <p class="alert alert-info">{l s='No top sellers for the moment.'}</p> {/if} Tuttavia non so come inizializzare la variabile $products e quindi non esce nulla. Qualcuno saprebbe indicarmi una soluzione semplice da applicare? Ho tentato anche di attivare il modulo Blocco migliori vendite ma non trovo la posizione corretta dove mostrarlo. Grazie a tutti per l'aiuto!
  3. Hello, thank you for your reply. I've switched off the "express payment" option and now it works fine! Thank you Alessandro
  4. Hello, in my prestashop e-commerce a user that pay with paypal module must wait to be redirected to the website after the payment and click on "confirm my order" button, or the order is not placed. Is it possible to avoid this last step and let the system create the order before payment procedure is accomplished (maybe by setting the order's status to pending)? Some users may think that the order is placed after have confirmed the payments on the paypal website and close the browser before the redirection to the e-commerce. Thank you
  5. Salve, volevo sapere se è possibile con il metodo di pagamento paypal eliminare la necessità di ritorno da paypal a prestashop per cliccare su comando "conferma il tuo ordine". Mi spiego meglio: attualmente il cliente 1)fa check out 2)clicca su paypal 3) viene reindirizzato su paypal 4)paga 5) viene reindirizzato su sito web prestashop 6)clicca su "conferma il tuo ordine" 7)fine Attualmente se l'utente non attende il redirect e non clicca sulla conferma, l'ordine non viene caricato. Temo che molti clienti pensino di aver terminato l'ordine dopo aver confermato il pagamento a paypal. Grazie Alessandro
  6. Hi, I'm trying to create a module in prestashop for insert products in my shop by programmatically. Now, I have a button on my module which call the following function: private function _saveContent() { $message = ''; $defaultLanguage = new Language((int)(Configuration::get('PS_LANG_DEFAULT'))); $object = new Product(); $object->price = 22; $object->id_tax_rules_group = 0; $object->name = 'prova'; $object->id_manufacturer = 0; $object->id_supplier = 0; $object->quantity = 1; $object->minimal_quantity = 1; $object->additional_shipping_cost = 0; $object->wholesale_price = 0; $object->ecotax = 0; $object->width = 0; $object->height = 0; $object->depth = 0; $object->weight = 0; $object->out_of_stock = 0; $object->active = 1; $object->id_category_default = 22; $object->category=array(22); $object->available_for_order = 0; $object->show_price = 1; $object->on_sale = 0; $object->online_only = 1; $object->meta_keywords = 'test'; $object->description_short = array((int)(Configuration::get('PS_LANG_DEFAULT')) => 'RRR'); $object->link_rewrite = array((int)(Configuration::get('PS_LANG_DEFAULT')) => 'RRR'); $object->add(); $message = $this->displayConfirmation($this->l('I prodotti sono stati aggiornati correttamente')); return $message; } The function insert the product in the database table PREFIX_product; I also see the product in the list on backoffice, but after that the page reply with these errors: [PrestaShopException] Property Product->link_rewrite is empty 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 744 - classes/Product.php] - [2 Arguments] 738. $limit = (int)Configuration::get('PS_PRODUCT_SHORT_DESC_LIMIT'); 739. if ($limit <= 0) 740. $limit = 800; 741. $this->def['fields']['description_short']['size'] = $limit; 742. 743. return parent::validateFieldsLang($die, $error_return); 744. } 745. 746. /** 747. * @see ObjectModel::validateField() 748. */ ProductCore->validateFieldsLang - [line 296 - classes/ObjectModel.php] - [0 Argument] 290. { 291. // Retrocompatibility 292. if (method_exists($this, 'getTranslationsFieldsChild')) 293. return $this->getTranslationsFieldsChild(); 294. 295. $this->validateFieldsLang(); 296. $is_lang_multishop = $this->isLangMultishop(); 297. 298. $fields = array(); 299. if ($this->id_lang === null) 300. foreach (Language::getLanguages(false) as $language) ObjectModelCore->getFieldsLang - [line 480 - classes/ObjectModel.php] - [0 Argument] 474. return false; 475. 476. // Database insertion for multilingual fields related to the object 477. if (!empty($this->def['multilang'])) 478. { 479. $fields = $this->getFieldsLang(); 480. if ($fields && is_array($fields)) 481. { 482. $shops = Shop::getCompleteListOfShopsID(); 483. $asso = Shop::getAssoTable($this->def['table'].'_lang'); 484. foreach ($fields as $field) ObjectModelCore->add - [line 499 - classes/Product.php] - [2 Arguments] 493. return $fields; 494. } 495. 496. public function add($autodate = true, $null_values = false) 497. { 498. if (!parent::add($autodate, $null_values)) 499. return false; 500. 501. if ($this->getType() == Product::PTYPE_VIRTUAL) 502. StockAvailable::setProductOutOfStock((int)$this->id, 1); 503. else ProductCore->add - [line 166 - modules/skeleton/skeleton.php] - [0 Argument] 160. $object->on_sale = 0; 161. $object->online_only = 1; 162. $object->meta_keywords = 'test'; 163. $object->description_short = array((int)(Configuration::get('PS_LANG_DEFAULT')) => ''); 164. $object->link_rewrite = array((int)(Configuration::get('PS_LANG_DEFAULT')) => ''); 165. $object->add(); 166. 167. $message = $this->displayConfirmation($this->l('I prodotti sono stati aggiornati correttamente')); 168. return $message; 169. } 170. Skeleton->_saveContent - [line 95 - modules/skeleton/skeleton.php] - [0 Argument] 89. public function getContent() 90. { 91. $message = ''; 92. 93. if (Tools::isSubmit('submit_'.$this->name)) 94. $message = $this->_saveContent(); 95. 96. $this->_displayContent($message); 97. 98. return $this->display(__FILE__, 'settings.tpl'); 99. } Skeleton->getContent - [line 685 - controllers/admin/AdminModulesController.php] - [0 Argument] 679. // We check if method of module exists 680. if (!method_exists($module, $method)) 681. throw new PrestaShopException('Method of module can\'t be found'); 682. 683. // Get the return value of current method 684. $echo = $module->{$method}(); 685. 686. // After a successful install of a single module that has a configuration method, to the configuration page 687. if ($key == 'install' && $echo === true && strpos(Tools::getValue('install'), '|') === false && method_exists($module, 'getContent')) 688. Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&configure='.$module->name.'&conf=12'); 689. } AdminModulesControllerCore->postProcessCallback - [line 811 - controllers/admin/AdminModulesController.php] - [0 Argument] 805. $ppmReturn = $this->$ppm(); 806. } 807. 808. // Call appropriate module callback 809. if (!isset($ppmReturn)) 810. $this->postProcessCallback(); 811. 812. if ($back = Tools::getValue('back')) 813. Tools::redirectAdmin($back); 814. } 815. AdminModulesControllerCore->postProcess - [line 158 - classes/controller/Controller.php] - [0 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 - [line 348 - classes/Dispatcher.php] - [0 Argument] 342. // Execute hook dispatcher 343. if (isset($params_hook_action_dispatcher)) 344. Hook::exec('actionDispatcher', $params_hook_action_dispatcher); 345. 346. // Running controller 347. $controller->run(); 348. } 349. catch (PrestaShopException $e) 350. { 351. $e->displayMessage(); 352. } DispatcherCore->dispatch - [line 53 - admin9746/index.php] - [0 Argument] 47. $_POST['controller'] = strtolower($_POST['tab']); 48. if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) 49. $_REQUEST['controller'] = strtolower($_REQUEST['tab']); 50. 51. // Prepare and trigger admin dispatcher 52. Dispatcher::getInstance()->dispatch(); I think the problems are linked to multilanguage support, but I don't know what to do. Please help me
  7. Buonasera a tutti, Sto tentando di implementare l'inserimento dei prodotti in Prestashop 1.5.6.2. tramite un modulo creato apposta per quest'uso. Di fatto, richiamo questa funzione: private function _saveContent() { $message = ''; $defaultLanguage = new Language((int)(Configuration::get('PS_LANG_DEFAULT'))); $object = new Product(); $object->price = 22; $object->id_tax_rules_group = 0; $object->name = 'prova'; $object->id_manufacturer = 0; $object->id_supplier = 0; $object->quantity = 1; $object->minimal_quantity = 1; $object->additional_shipping_cost = 0; $object->wholesale_price = 0; $object->ecotax = 0; $object->width = 0; $object->height = 0; $object->depth = 0; $object->weight = 0; $object->out_of_stock = 0; $object->active = 0; $object->id_category_default = 22; $object->category=array(22); $object->available_for_order = 0; $object->show_price = 1; $object->on_sale = 0; $object->online_only = 1; $object->meta_keywords = 'test'; $object->description_short = array((int)(Configuration::get('PS_LANG_DEFAULT')) => 'DESC'); $object->link_rewrite = array((int)(Configuration::get('PS_LANG_DEFAULT')) => 'LINK'); if($object->save()) $object->add(); $message = $this->displayConfirmation($this->l('I prodotti sono stati aggiornati correttamente')); return $message; } Tuttavia appena eseguo il codice ottengo i seguenti errori: [PrestaShopException] Property Product->link_rewrite is empty 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 744 - classes/Product.php] - [2 Arguments] ProductCore->validateFieldsLang - [line 296 - classes/ObjectModel.php] - [0 Argument] ObjectModelCore->getFieldsLang - [line 480 - classes/ObjectModel.php] - [0 Argument] ObjectModelCore->add - [line 499 - classes/Product.php] - [2 Arguments] ProductCore->add - [line 166 - modules/skeleton/skeleton.php] - [0 Argument] Skeleton->_saveContent - [line 95 - modules/skeleton/skeleton.php] - [0 Argument] Skeleton->getContent - [line 685 - controllers/admin/AdminModulesController.php] - [0 Argument] AdminModulesControllerCore->postProcessCallback - [line 811 - controllers/admin/AdminModulesController.php] - [0 Argument] AdminModulesControllerCore->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument] ControllerCore->run - [line 348 - classes/Dispatcher.php] - [0 Argument] DispatcherCore->dispatch - [line 53 - admin9746/index.php] - [0 Argument] Dalle varie ricerche fatte in internet sembra un problema dovuto alla gestione del multilingua di prestashop. Ho provato ad eliminare le altre lingue oltre all'italiano, ma non è cambiato nulla. Oltre all'errore, c'è da notare che il prodotto viene inserito nel database e lo visualizzo anche nella lista prodotti del backoffice, ma non risulta attivabile poichè mancano il link_rewrite e anche il nome del prodotto non viene assegnato. Qualcuno ha qualche dritta da darmi? Grazie mille!
  8. ciao, si potrebbe andare, l'importante è che se l'utente non è loggato il sistem non dia informazioni sul prezzo di spedizione, mentre se lo è si. Tenendo conto che esistono situazioni corrette in cui la spesa di spedizioen è gratuita (sopra 100€ nel mio caso). Grazie per l'interessamento
  9. Se la tolgo poi non is vede nemmeno quando la spedizione è realemnte gratuita. Ho impotato gratuita sopra i 100 €.
  10. Ciao, hai ragione, il sistema non può calcolare da dove l'utente viene se non è registrato però non dovremme mostrare "spedizioen gratuita", non dovrebbe mostrare nulla. Se io fossi il cliente prima vedo spedizione gratuita, sono tentato, mi registro, vedo un altro prezzo e me ne vado perchè mi sento truffato. Non c'è un modo per aggirare il problema?
  11. Salve, ho un nuovo problema con prestashop, ho settato le spedizione in tutta italia a 10€, però se apro il carrello come nuovo visitatore mi dice spedizione gratuita! Quando poi mi registro e metto di dati di spedizione mette correttamente a 10€. Per me è un problma perchè l'utente può sentirsi inizialmente ingannato. Qualcuno sa come risolvere?
  12. Ho risolto! Avevo impostato un sovraprezzo di spedizione per errore. Grazie dei suggerimenti!
  13. Ciao Purtroppo il sito è offline e non posso a linkarlo. In ogni caso, ho impostato il costo nella sezione spedizione->corriere nella fascia di riferimento (italia), barando il checkbox a fianco di Italia ed inserendo il prezzo nella casellina adiacente.
×
×
  • Create New...