Search the Community
Showing results for tags 'Array'.
-
Hello, i am using prestashop 8.1.4. i would like to insert a value in the $data array in PaymentModule.php form my module. This value i need to display on order_conf template to customer, which takes values from this array. But i do not want to override the (validateOrder function) PaymentModule.php and want to do that from my module that is installed. In this my module i am hooked to actionValidateOrder hook, but the params that i get from this hook are: 'cart' => $this->context->cart, 'order' => $order, 'customer' => $this->context->customer, 'currency' => $this->context->currency, 'orderStatus' => $order_status, So i can't access the $data array as far as i see, as $data is not property of order or cart objects. I also see that there is a hook in this PaymentModule.php called "actionValidateOrderAfter" but the params in this hooks are similair and as far as i think i can't access this array there too. I have made other things in my module but have two generated values that want to send to template order_conf by merging them (array_merge) to $data array. Problem is how to access this array from my module? Can anyone help me? In my module i have also registered to hook SendMailAlterTemplateVars - but the parameters there are sent only to (mailalerts module) templates - so i can not use them in the order_conf template. So how can I access this $data array from hookactionValidateOrder function in my module? Is that possible? Or where from? Regards,
- 1 reply
-
- paymentmodule
- variables
-
(and 3 more)
Tagged with:
-
Hi, i'm currently on a PrestaShop 1.7.8.9 with Php 7.2.34. When i'm accessing the product (see as attached file) with a certain account. i get this kind of error message : When i click on AdminProductDataProvider i get this page : It seems like the product on id 357 is not readable. I found out there are 2 others products which cause the same problem. Maybe i could delete them in the DB ? In which table can i found them ? With another account, i can access the BO of products but, when i filter for the product with 357 id, i get the same error, and juste need to go back then refresh the page. If you need any other informations feel free to ask i'll answer them as quick as possible. Thanks in advance.
-
Hi, ich versuche gerade per smarty die Produkt features im array abzugreifen, leider bekomme ich es nicht hin! Irgendwie klappt meine Foreach Schleife nicht.. also in der -> $delivery_options -> product_list -> features -> id_feature_value --> Siehe Bild Die Aktuelle Adress ID, sowie das land habe ich bereits, mir fehlt noch diese id! Ich möchte folgendes machen: wenn feature id = X frage ab Lieferland wenn Lieferland = x Dann blende info / Text ein! Prestashop 1.7 Datei wäre die shipping.tpl (checkout/partials/steps) Kann mir da jemand einen Tipp geben? Vielen Dank!
-
Borrado ok. Miras la ficha producto y sale el error...
Adrianna-27 posted a topic in Core developers
Hola a todos: Tengo un prestashop 1.7.5 y hace tiempo instale algunos módulos que no funcionan bien y los desistalé sin mayor problema. Con uno de ellos estoy casi seguro que es con el módulo "amproductfields.zip" que es para colocar fotos y texto debajo de las habituales que salen. Se quedo un "error pegado" que no se como quitar. En concreto a parece la vista de todos la palabra "Array" en todas las fichas de productos. Le dio mil vueltas para eliminar esa palabra y ya no se que hacer. Adjunto pantallazo y parte del código fuente que aparece en esa parte. Haber si alguien me puede ayudar . Gracias a todos. . Código fuente: <section id = "amproductfields"> <h2> </h2> <div> Matriz </div> </section> UN SALUDO A TODOS.- 2 replies
-
- texto que aparece mal
- imagenes
- (and 6 more)
-
Bonjour, Je travaille sur un module de paiement perso. qui ne doit s'afficher dans le tunnel d'achat qu'à certaines conditions, pour créer ce module je me suis basé sur le module de paiement par chèque. Les conditions d'affichage du nouveau module dans le tunnel d'achat : Les produits du panier doivent faire partie de certaines catégories de produits spécifiques. Le prix HT de chaque produit du panier doit être supérieur à un certain montant. Mon problème est le suivant : Pour gérer la première condition (vérifier que les produits du paniers font partie de certaines catégories) j'ai modifié la fonction hookPayment de mon module comme ceci : public function hookPayment($params) { // Tableau $allowed_products avec les ID des produits éligibles à cette méthode de paiement $allowed_products= array(6244,8871,5,10,12); // Je récupère les produits du panier $products = Context::getContext()->cart->getProducts(); // je compare les produits du panier à ceux du tableau $allowed_products $allowed=false; foreach ($products as $product) { // Si il y a correspondance $allowed = true if (in_array($product['id_product'], $allowed_products)){ $allowed=true; } } if (!$allowed) return; if (!$this->active) return; if (!$this->checkCurrency($params['cart'])) return; $this->smarty->assign(array( 'this_path' => $this->_path, 'this_path_bw' => $this->_path, 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' )); return $this->display(__FILE__, 'payment.tpl'); } Cette méthode fonctionne mais j'ai beaucoup de produits éligibles pour cette méthode de paiement et pour éviter de taper à la main tous les ID produit dans le tableau $allowed_products, je souhaite savoir comment récupérer les ID des produits de certaines catégories et les intégrer dans le tableau $allowed_products, . Jusqu'à présent je n'ai pas trouvé de solution je dois passer à côté de quelque chose ! -_-' Quelqu'un peut m'aider ou me donner une piste ? Merci d'avance. INFO : Version de PrestaShop 1.6.0.14.
- 8 replies
-
- id product in array
- array
-
(and 3 more)
Tagged with:
-
Hi... i have write this code in my module front controller inside setMedia() method foreach($customerlocationsdata as $customerlocation){ $customerlocations[] = array( 'firstname' => $customerlocation['firstname'], 'lastname' => $customerlocation['lastname'], 'address1' => $customerlocation['address1'], 'address2' => $customerlocation['address2'], 'postcode' => $customerlocation['postcode'], 'state' => State::getNameById($customerlocation['id_state']), 'country' => Country::getNameById($this->context->language->id, $customerlocation['id_country']), ); } Media::addJsDefL('customerlocations' ,$customerlocations); but is is not working.i need the this "customerlocations" array use the .js file. how can i use "customerlocations" data in my js file ? can any one help me ? Thanks
- 1 reply
-
- array
- Media::addJsDefL
-
(and 1 more)
Tagged with:
-
Guys, I have created a *.tpl file and I assigned some variables to the smarty array e.g: public function hookExtraCarrier($params) { //deleted code... $this->context->smarty->assign(array( 'wineo_free_shipping_id' => Configuration::get('WINEO_FREE_CARRIER_ID'), 'this_path' => $this->_path, 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/', )); return $this->display(__FILE__, 'wineocarrier.tpl'); } I have another method that I want to add more variables to the array. I have tried things like: public function addCarrierNameList() { //deleted code... if (isset($carrierNameNorm)) { $this->context->smarty->assign(array( 'wineo_shipping_type' => $carrierNameNorm['name'] )); } // echo '<pre>', print_r($carrierNameNorm['name']),'</pre>'; // return $this->display(__FILE__, 'wineocarrier.tpl'); } } I cannot get the 'wineo_shipping_type' variable in the template file. What is the best way to approach this? Thanks!!!
-
Quick Search block v1 not working correctly on my PS v1.4.8 I also have ASearch Module v2.2.6 by Ebyyd.com installed When a search is done which has results, it displays Search "Array" When a search is done with no results it gives me an error, as below. Array ( [name] => 2 litre potted [times] => 19 [class] => tag_level3 ) Array No results found for your search "Array" Have a check at http://www.gb-online.co.uk/prestashop/ Any ideas Plz.
-
Greetings fellow PS'ers Im working on my first prestashop and i still need to solve one thing. In my case it is bad usability. Some of my products is customizable where the user have to upload one or more images. At the moment one have to add a certain input of files fields, eg. 5 fields for 5 images. My question is: Is there a way to modify the cutsomifization block in products.tpl to ONE FILE UPLOADER can handle multiple images? An array ofc. In that case, what changes shall i make to what files? Sorry for my bad formulations.
- 4 replies
-
- Product Cutomization
- File Upload
-
(and 3 more)
Tagged with:
-
I work with a site that uses a lot of different tracking codes and things and a lot of the time I need to pass various variables like the total cost of the order and the users email address to the order confirmation page. I normally have a look through the forums and find what I'm looking for in some way or another, usually pulling data from the $order or $cookie arrays but I'm struggling to find somethings and figured it would be useful to find this stuff out for myself rather than hope someone else has had the same problem as and when it happens to me. As of right now I need to do a foreach loop for each product ordered so I can grab their name, price and quantity. I would of thought I could grab this from the order array but I can't see it in there. What would be the best method for pulling this information? And is there any documentation on how to go about pulling information like this so I don't need to pester you guys in the future about it if I need to grab something else? As always I appreciate any help you can provide on the matter. tldr; How do I pull the the ordered products names, prices and quantities to the order confirmation page in a foreach loop?
- 1 reply
-
- product information
- $cookie
- (and 8 more)
-
Hi all, Hopefully this is something that is easy-ish to help with. Our web hosting upgraded from Windows Server 2005 to 2008 yesterday and prestashop ceased to work, throwing out 500 errors. We found out this was due to an issue with the database not migrating the password correctly and an SQL query solved the problem. Once I could actually access the shop, it seems all ok but once I try to access the catalog tab to look at products, update, etc. I get nothing but the following message onscreen: PHP Notice: Array to string conversion in ********\htdocs\prestashop\classes\AdminTab.php on line 190 See below a snippet of the offending code/file: public function __construct() { global $cookie; $this->id = Tab::getCurrentTabId(); $this->_conf = array( 1 => $this->l('Deletion successful'), 2 => $this->l('Selection successfully deleted'), 3 => $this->l('Creation successful'), 4 => $this->l('Update successful'), 5 => $this->l('Status update successful'), 6 => $this->l('Settings update successful'), 7 => $this->l('Image successfully deleted'), 8 => $this->l('Module downloaded successfully'), 9 => $this->l('Thumbnails successfully regenerated'), 10 => $this->l('Message sent to the customer'), 11 => $this->l('Comment added'), 12 => $this->l('Module installed successfully'), 13 => $this->l('Module uninstalled successfully'), 14 => $this->l('Language successfully copied'), 15 => $this->l('Translations successfully added'), 16 => $this->l('Module transplanted successfully to hook'), 17 => $this->l('Module removed successfully from hook'), 18 => $this->l('Upload successful'), 19 => $this->l('Duplication completed successfully'), 20 => $this->l('Translation added successfully but the language has not been created'), 21 => $this->l('Module reset successfully'), 22 => $this->l('Module deleted successfully'), 23 => $this->l('Localization pack imported successfully'), 24 => $this->l('Refund Successful'), 25 => $this->l('Images successfully moved')); if (!$this->identifier) $this->identifier = 'id_'.$this->table; //THIS IS LINE 190 if (!$this->_defaultOrderBy) $this->_defaultOrderBy = $this->identifier; $className = get_class($this); if ($className == 'AdminCategories' OR $className == 'AdminProducts') $className = 'AdminCatalog'; $this->token = Tools::getAdminToken($className.(int)$this->id.(int)$cookie->id_employee); } I would very much appreciate any help. Please let me know if I can provide any more information or anything else to help a speedy solution. Kind regards.
-
When i make a new order on my website, as a logged in user, in 1st step after i put my address for purchase, it keeps giving me this error: Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/var/www/vhosts/taxco.com.ve/httpdocs/themes/taxco/order-address.tpl" on line 88 "{if !$smarty.foreach.inv_loop.first},{/if}{$field_name|json_encode}" unknown modifier "json_encode"' in /var/www/vhosts/taxco.com.ve/httpdocs/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:667 Stack trace: #0 /var/www/vhosts/taxco.com.ve/httpdocs/tools/smarty/sysplugins/smarty_internal_compile_private_modifier.php(132): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown modifie...', 88) #1 /var/www/vhosts/taxco.com.ve/httpdocs/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php(475): Smarty_Internal_Compile_Private_Modifier->compile(Array, Object(Smarty_Internal_SmartyTemplateCompiler), Array, NULL, NULL) #2 /var/www/vhosts/taxco.com.ve/httpdocs/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php(259): Smarty_Internal_TemplateCompilerBase->callTagCompil in /var/www/vhosts/taxco.com.ve/httpdocs/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 667 Seems like there is an error in order-address.tpl, i looked for any error there, but seems it is just the code that raise the exception, because of other error,s i'm new into PS and i can't really figure out why is this happening. I'm using 'Venezuela' localization and PS version 1.5.6.0 This is the link to the error: http://www.taxco.com.ve/index.php?controller=order&step=1 Any ideas? Thanks in advance!
-
Hi all, Hopefully this is something that is easy-ish to help with. Our web hosting upgraded from Windows Server 2005 to 2008 yesterday and prestashop ceased to work, throwing out 500 errors. We found out this was due to an issue with the database not migrating the password correctly and an SQL query solved the problem. Once I could actually access the shop, it seems all ok but once I try to access the catalog tab to look at products, update, etc. I get nothing but the following message onscreen: PHP Notice: Array to string conversion in ********\htdocs\prestashop\classes\AdminTab.php on line 190 See below a snippet of the offending code/file: public function __construct() { global $cookie; $this->id = Tab::getCurrentTabId(); $this->_conf = array( 1 => $this->l('Deletion successful'), 2 => $this->l('Selection successfully deleted'), 3 => $this->l('Creation successful'), 4 => $this->l('Update successful'), 5 => $this->l('Status update successful'), 6 => $this->l('Settings update successful'), 7 => $this->l('Image successfully deleted'), 8 => $this->l('Module downloaded successfully'), 9 => $this->l('Thumbnails successfully regenerated'), 10 => $this->l('Message sent to the customer'), 11 => $this->l('Comment added'), 12 => $this->l('Module installed successfully'), 13 => $this->l('Module uninstalled successfully'), 14 => $this->l('Language successfully copied'), 15 => $this->l('Translations successfully added'), 16 => $this->l('Module transplanted successfully to hook'), 17 => $this->l('Module removed successfully from hook'), 18 => $this->l('Upload successful'), 19 => $this->l('Duplication completed successfully'), 20 => $this->l('Translation added successfully but the language has not been created'), 21 => $this->l('Module reset successfully'), 22 => $this->l('Module deleted successfully'), 23 => $this->l('Localization pack imported successfully'), 24 => $this->l('Refund Successful'), 25 => $this->l('Images successfully moved')); if (!$this->identifier) $this->identifier = 'id_'.$this->table; //THIS IS LINE 190 if (!$this->_defaultOrderBy) $this->_defaultOrderBy = $this->identifier; $className = get_class($this); if ($className == 'AdminCategories' OR $className == 'AdminProducts') $className = 'AdminCatalog'; $this->token = Tools::getAdminToken($className.(int)$this->id.(int)$cookie->id_employee); } I would very much appreciate any help. Please let me know if I can provide any more information or anything else to help a speedy solution. Kind regards.
-
Hi everyone! This is my first post, but I hope next time I'll come back to give a hand instead of asking for one Here is my problem: I am building a simple website... However, I realized that when I try to go on my CMS pages from the information left colum, or from any other link on the site, my pages appear blank (although there are texts) . The CMS category are working perfectly, only the CMS pages are not showing the texts. The only thing showing on my pages are the CMS cathégorie "home" + name of the CMS page (with no space) : "AccueilLivraison"* and in the next line "AccueilArray" I have built another website using this template and the same page would show only one line as followed: Accueil>livraison and instead of "accueilArray" would be the normal title of the CMS page. I dont know why this ">" doesn't appear in both websites, but i know for sure I havn't been playing with the codes. Someone with a tiny start of solution would be great help! Thanks in Advance! Pao
-
Bonjour, Après un migration vers la version 1.5.2 de prestashop qui ne s'est pas trop mal passée, je viens de m’apercevoir que sur les factures la date approximative de livraison est buggée. Le message en bas de la facture n'indique pas de date mais "array". J'ai mis une capture d'écran en pièce attachée.
- 18 replies
-
- date livraison
- facture
-
(and 1 more)
Tagged with:
-
Hi, I would like to add an external variable in employee context array, how to add additional variable in employee array? Let's say I wanted to add something like this: $context->employee['accessVerified'] = true; so later I could access that variable somewhere in admin like: if($context->employee->accessVerified) ... Please help. Thanks,
-
HI, i need to get an array of id of some cms pages to show some custom content on them in PS 1.4.7, i did this way: first i override the front_controller php with the following code: <?php class FrontController extends FrontControllerCore { public function init() { $id_cms_category = array(); $id_cms_page = array(); $id_category = array(); $id_product = array(); parent::init(); $id_cms_category = (int)Tools::getValue('id_cms_category'); $id_cms_page = (int)Tools::getValue('id_cms'); $id_category = (int)Tools::getValue('id_category'); $id_product = (int)Tools::getValue('id_product'); self::$smarty->assign(array( 'id_cms_category' => $id_cms_category, 'id_cms_page' => $id_cms_page, 'id_category' => $id_category, 'id_product' => $id_product, ) ); } } ?> then in the tpl {if $page_name == 'cms' AND $smarty.get.id_cms} {if in_array($cms_class, array(4,10,11,12,13,14,15,16,17,18,19,20,21,22))} .....my content..... {/if} {/if} i'm now upgrading my site to the 1.5.6.1 version, but this code it is not working anymore.... i can get the $id_product variables in array and use them with no problems, but the $id_cms it is not present if i check on the console and give an empty array Can anyone suggest me what i have to change to get it working for the $id_cms too? sorry for my poor english thanks in advance Ariom
-
okay i have a question. i would like to know where the array for the search is. i am trying to have it pull a number from another table and i cant find the array or the query for the search , im trying to get it to pull a part number along side the product that they searched for
-
Hi, I am doing a small module. In that I am fetching some data from the database in hook. The code for hook is like this, in this I just want to assign the value of public function hookHome($params) { $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); global $cookie, $smarty; $value=array(); $sql_select="SELECT * FROM "._DB_PREFIX_."storeinfo WHERE status = '1'"; $value=Db::getInstance()->ExecuteS($sql_select); // print_r($value); $smarty->assign('array',$value); $smarty->assign('default',$defaultLanguage); return $this->display(__FILE__, 'storeinfo.tpl'); } In view file (storeinfo.tpl) I want to show the values thats why I just made {$array|@print_r} in storeinfo.tpl but it did not showed anything. Now If I am doing print_r($value) in the public function hookHome($params) {} I am getting the array. But the assigned values in smarty is not showing in .tpl file so can someone kindly tell me what is the problem here..Any help and suggestions will be really appreciable. Thanks
-
Hi there, I am using prestashop 1.4 and the search box is all good (returning expected results) but above the results it says 'Search "ARRAY"' and not as it should say 'Search "chair" ' (chair being what I have typed in the search box and asked it to search for!) Can anybody help? Many Thanks
-
Ik heb de module leverdatum geïnstalleerd. Als ik nu een factuur aanmaak komt onderaan te staan geschatte leverdatum ligt tussen array en array in plaats van de werkelijke leverdatum. Hoe los ik dit op? Ik heb prestashop 1.5.4.1
- 1 reply
-
- leverdatum
- factuur
-
(and 1 more)
Tagged with:
-
Hi all and how are you all? Well once again I need your help please. I have 2 sorts of the products. One which is Jigsaw Puzzles and the other is Kites. On my Jiggaw Puzzles the breadcrumb is fine as you can see below. "Home > Jigsaw Puzzles > Product Name" Click link too see the breadcrumb: "Home > Jigsaw Puzzles > Product Name" On my Kites it doesn't have the full breadcrumb as shown below. "Home > Product Name" Click link too see the breadcrumb: "Home > Product Name" And so I really need help on this ladies and gentlemen. Thanks in advance for any help given, will be much appreciated. Kind Regards bow316
- 6 replies
-
- back button
- buttons
-
(and 4 more)
Tagged with:
-
Buenas, Llevo unos días intentando arreglar lo siguiente pero no hay forma. Antes de nada mi versión es la 1.5.3 y estoy en la farragosa parte de añadir "new tax rule" una por cada provincia de España, y me he dado cuenta de que muestra una array fija, es decir que no hace ni siguiente ni atrás, con la consecuente pérdida de información a la vista. sabéis de que puede ser? Gracias de antemano!
-
Hello, I'm using prestashop 1.4.8.2 The instant search displays products in the reverse order as the ajax search (so the products are displayed without respecting the weight preferences). How do I correct this behaviour? Thank you Donia
- 1 reply
-
- instant search
- search
-
(and 3 more)
Tagged with: