Jump to content

frogtaku

Members
  • Posts

    27
  • Joined

  • Last visited

Profile Information

  • Location
    France
  • Activity
    Freelancer

frogtaku's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Your suggestion just gave me an idea, and it worked! Finding the file, I've noticed that the shopping-cart.tpl incriminated was from a theme I used from a copy of the default one. For some reason the file was smaller than it should have been, so there must have been an error during the transfer. Replacing it did the job. Thanks for that indirect way of helping me to solve the problem!
  2. I have one whose folder is called "loyalty" indeed (the back-office is in french so the name is "Programme de fidélité"). Edit: deactivating it doesn't seem to change anything.
  3. Trying to access the order page after I made a 1-click upgrade from 1.4 to 1.6 on local, I have an error displaying in place of the content: Notice: Undefined index: points in C:\wamp\www\prestashop-prod\cache\smarty\compile\c9\29\c7\c929c77002644a8c4a184d69188a2f691d84004d.file.shopping-cart.tpl.php on line 33 And below: Notice: Trying to get property of non-object in C:\wamp\www\prestashop-prod\cache\smarty\compile\c9\29\c7\c929c77002644a8c4a184d69188a2f691d84004d.file.shopping-cart.tpl.php on line 33 I deactivated any non-prestashop made module and override in the meanwhile, it doesn't seem to have any incidence on it. Clearing Smarty cache, I have those paths: Notice: Trying to get property of non-object in C:\wamp\www\prestashop-prod\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code on line 33 Notice: Undefined index: points in C:\wamp\www\prestashop-prod\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code on line 33 Please tell me if you need to see smarty_internal_templatebase.php code. Versions are as follow: Prestashop: 1.6.0.9 PHP: 5.5.12 MySQL: 5.6.17
  4. Thanks for clearing that up, I wasn't 100% sure. Is there a way to know what it is used for? The thing is it's not my own install and I am on my own for that matter (figuring what's "vanilla" or not), for some reason. I have been looking inside that file before asking here, in case there was a mention in comments for exemple, but there's no such thing.
  5. Hello, I upgraded a store to 1.6 and the order page wasn't displaying anything. So I set "display_errors" to "on" in define.inc and so far I got this on the order page and in the modules pannel: Strict standards: Declaration of PaymentModule::validateOrder() should be compatible with PaymentModuleCore::validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown', $message = NULL, $extra_vars = Array, $currency_special = NULL, $dont_touch_amount = false, $secure_key = false, Shop $shop = NULL) in C:\wamp\www\prestashop-prod\override\classes\PaymentModule.php on line 125 Here's where I am confused: there's no code on line 125, or rather, just the "}" that ends it. I thought it was one of those errors where you have to remove spaces at the end of the code (there was) but it didn't change anything. Is the override a deprecated thing I can safely remove? On another 1.6 install I have, there's no such file.
  6. Toujours pas de réponse ? C'est quand même dingue que je n'en ai eu aucune ni en français ni en anglais pour un problème dont je suis presque certain que j'ai raté quelque chose d'évident. Merci d'avance pour toute réponse encore une fois.
  7. J'essaie de lister tous les produits dans un onglet que j'ai créé dans la page produit du back-office, or l'onglet ne charge pas correctement. Voici la partie du code du template qui nous intéresse: {if isset($products) && $products} <ul> {foreach from=$products item=product} <li>{$product.name}</li> {/foreach} </ul> {/if} Le code du controller : public function hookDisplayAdminProductsExtra($params){ if (Validate::isLoadedObject($product = new Product((int)Tools::getValue('id_product')))){ $this->prepareNewTab(); return $this->display(__FILE__, 'product-tab.tpl'); } } Et la fonction qui définit les variables : public function prepareNewTab(){ $products = Product::getProducts($this->context->language->id, 0, 100); $products_all = Product::getProductsProperties($this->context->language->id, $products); $this->context->smarty->assign(array( 'custom_field' => $this->getCustomField((int)Tools::getValue('id_product')), 'languages' => $this->context->controller->_languages, 'default_language' => (int)Configuration::get('PS_LANG_DEFAULT'), 'products' => $products_all; )); } Il faut savoir que l'onglet se chargeait correctement jusqu'à ce que je définisse la variable "products". Auparavant, tout fonctionnait mis à part bien sûr que le foreach ne donnait rien pour cette partie du code de template. Faute de réponse dans la version anglaise du forum (vekia m'a tout de même permis de remarquer que je n'avais pas défini une variable très importante avant d'en arriver à ce problème, à savoir "products" *ahem*), je retente ma chance ici. Merci d'avance Edit : Petite précision que j'ai omis de mettre : la page "Modules" m'avertit qu'une classe est manquante et qu'il y a une erreur de syntaxe, donc mon intuition me dit que je n'ai pas appelé la classe "Product" correctement.
  8. No idea? Either the solution is obvious and I am too stupid to be told, or I hacked the matrix and I am on my own. Thanks in advance for any help.
  9. So, looking at other threads, I tried this method and commented where it won't work: public function prepareNewTab(){ $products = Product::getProducts($this->context->language->id, 0, 100); $products_all = Product::getProductsProperties($this->context->language->id, $products); //=> WILL PRODUCE A FATAL ERROR ON TAB $this->context->smarty->assign(array( 'custom_field' => $this->getCustomField((int)Tools::getValue('id_product')), 'languages' => $this->context->controller->_languages, 'default_language' => (int)Configuration::get('PS_LANG_DEFAULT'), 'products' => $products_all; // TAB WON'T LOAD CORRECTLY )); } Any idea? Edit: Looking at the module page, it tells me I have a syntax error and a missing class. I guess it's refering to the Product class. Should I declare it? How would it affect the existing code? The lack of documentation on its use for a module is a little bothersome.
  10. Oh, I thought $products array was a global variable so I could access it directly through a smarty template. I have difficulty understanding how to define it this way though... Is $this->Tools::getValue() the way to go?
  11. Sorry I misunderstood something public function hookDisplayAdminProductsExtra($params){ if (Validate::isLoadedObject($product = new Product((int)Tools::getValue('id_product')))){ $this->prepareNewTab(); return $this->display(__FILE__, 'product-tab.tpl'); } } The function that is called is there: public function prepareNewTab(){ $this->context->smarty->assign(array( 'custom_field' => $this->getCustomField((int)Tools::getValue('id_product')), 'languages' => $this->context->controller->_languages, 'default_language' => (int)Configuration::get('PS_LANG_DEFAULT') ));
  12. I didn't implement/override one, is this necessary to access the products array? Sorry if my question is stupid, I am still tiptoeing around module development.
  13. I dare doing a little bump, because I am pretty sure I am missing something really basic that I'll be embarassed about shortly after. Yet I don't grasp it, looking at product-list.tpl for inspiration.
  14. I am trying to make a simple list of all product names in the back-office's product tab I created. Here's what I have written in the module's .tpl: {if isset($products) && $products} <ul> {foreach from=$products item=product} <li>{$product.name}</li> {/foreach} </ul> {/if} The output is just: <ul></ul> I guess it isn't as simple as that...
  15. Silly me! I didn't touch that. I have moved the hook to the correct position in product.tpl now. Thanks again vekia!
×
×
  • Create New...