berninoel42 Posted July 4, 2014 Share Posted July 4, 2014 (edited) Bonjour, Je suis en train de créer une boutique.J'ai acheter un module "Attribute wizard Pro" qui demande pas mal de modif pour l'install. et maintenant j'ai une erreur à l'affichage de mes produits : Fatal error: Call to undefined method ProductController::getProduct() in /home/opticienj/www/modules/productcomments/productcomments.php on line 820 Il faut savoir que je n'ai pas effectuer de modification sur ce fichier. J'ai effectuer des modifs demandé dans l'install sur ces fichiers là : override/classes/Product.php - Lignes #37-43, 69, 115 /override/controllers/front/CartController.php - Lignes #29-30, 36-39, 47, 71-74, 164 Il faut savoir que le module est approuvé par prestashopQuelles peut en etre la raison ? quelle méthode adopter pour régler le problème.Merci. Edited July 4, 2014 by berninoel42 (see edit history) Link to comment Share on other sites More sharing options...
Mediacom87 Posted July 4, 2014 Share Posted July 4, 2014 Bonjour, que vous a répondu le développeur de ce module ? Link to comment Share on other sites More sharing options...
Baraku Posted July 4, 2014 Share Posted July 4, 2014 Bonjour, Comme l'indique Mediacom, il faut d'emblée se tourner vers le développeur du module. Il est vraiment mieux situé pour décoincer tout ça. Link to comment Share on other sites More sharing options...
berninoel42 Posted July 6, 2014 Author Share Posted July 6, 2014 Il m'a dit que ca ne venait pas de lui et qui fallait corrigé cette erreur pour installer son module... Link to comment Share on other sites More sharing options...
Mediacom87 Posted July 6, 2014 Share Posted July 6, 2014 Donc en gros cela fonctionne sans installer le module et faire les modifications demnadées, mais sinon le soucis ne vient pas de leur module. Bonne blague celle là. Link to comment Share on other sites More sharing options...
berninoel42 Posted July 6, 2014 Author Share Posted July 6, 2014 (edited) ben maintenant je suis un peu coincé ca ne fonctionne plus et le module n'est pas installé..d'ou peut provenir l'errreur? si je recharge le fichier théoriquement ca devrait fonctionner? non? Edited July 6, 2014 by berninoel42 (see edit history) Link to comment Share on other sites More sharing options...
Mediacom87 Posted July 6, 2014 Share Posted July 6, 2014 Cela fonctionnait avant donc il suffit de revenir en arrière. Link to comment Share on other sites More sharing options...
loulou66 Posted July 6, 2014 Share Posted July 6, 2014 Coucou la ligne 820 du pordutscomments.php est $product = $this->context->controller->getProduct(); vu l'erreur je pense qu'il doit s'agir d'une erreur de Context qui n'est pas déclarer quelque part peut tu nous monter les fichiers que tu a modifier en override ? sans dévoiler les les fonction du module que tu as acheter @++ Loulou66 Link to comment Share on other sites More sharing options...
berninoel42 Posted July 6, 2014 Author Share Posted July 6, 2014 merci loulou66, si je comprends bien tu veux les fichiers dans le dossier override du module que j'ai acheté? Link to comment Share on other sites More sharing options...
loulou66 Posted July 6, 2014 Share Posted July 6, 2014 Coucou ha bin non tu peut pas donner sans l'accord du créateur les fichiers d'un module payant faut voir avec lui pour résoudre le problème @++ Loulou66 Link to comment Share on other sites More sharing options...
berninoel42 Posted July 7, 2014 Author Share Posted July 7, 2014 Voici les fichiers sur lesquels on me demande des modifications : /override/classes/Cart.php - Lignes #74-75, 160, 205, 211, 503-535, 547, 590, 596, 632, 640, 669-671, 708, 758, 768, 796-797, 809, 813-816, 872-873, 884-885, 8[spam-filter]908, 916-919, 931-932, 944, 1013 /override/classes/order/OrderDetail.php - Lignes #43, 116-117 /override/classes/PaymentModule.php - Lignes #27, 290, 301 /override/classes/Product.php - Lignes #37-43, 69, 115 /override/controllers/front/CartController.php - Lignes #29-30, 36-39, 47, 71-74, 164 Je vais vous mettre mes fichiers actuels. Je vais commencer par le fichiers product.php qui me semble <?php class Product extends ProductCore { /** * Get all available attribute groups * * @param integer $id_lang Language id * @return array Attribute groups * * Removing temporary attributes. */ public function getAttributesGroups($id_lang) { if (!Combination::isFeatureActive()) return array(); $sql = 'SELECT ag.`id_attribute_group`, ag.`is_color_group`, agl.`name` AS group_name, agl.`public_name` AS public_group_name, a.`id_attribute`, al.`name` AS attribute_name, a.`color` AS attribute_color, pa.`id_product_attribute`, IFNULL(stock.quantity, 0) as quantity, product_attribute_shop.`price`, product_attribute_shop.`ecotax`, pa.`weight`, product_attribute_shop.`default_on`, pa.`reference`, product_attribute_shop.`unit_price_impact`, pa.`minimal_quantity`, pa.`available_date`, ag.`group_type` FROM `'._DB_PREFIX_.'product_attribute` pa '.Shop::addSqlAssociation('product_attribute', 'pa').' '.Product::sqlStock('pa', 'pa').' LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_attribute` LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute` LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group` LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON a.`id_attribute` = al.`id_attribute` LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON ag.`id_attribute_group` = agl.`id_attribute_group` '.Shop::addSqlAssociation('attribute', 'a').' WHERE pa.`id_product` = '.(int)$this->id.' AND al.`id_lang` = '.(int)$id_lang.' AND agl.`id_lang` = '.(int)$id_lang.' GROUP BY id_attribute_group, id_product_attribute ORDER BY ag.`position` ASC, a.`position` ASC, agl.`name` ASC'; $result = Db::getInstance()->executeS($sql); $backtrace = debug_backtrace(); if (isset($backtrace[1]) && $backtrace[1]['function'] == 'assignAttributesGroups') foreach($result as $key => $val) if ($val['group_name'] == 'awp_details') unset($result[$key]); return $result; } /** * Get all available product attributes combinations * * MODIFIED: GROUP BY pa.`id_product_attribute`, ag.`id_attribute_group` * * @param integer $id_lang Language id * @return array Product attributes combinations */ public function getAttributeCombinations($id_lang) { if (!Combination::isFeatureActive()) return array(); $sql = 'SELECT pa.*, product_attribute_shop.*, ag.`id_attribute_group`, ag.`is_color_group`, agl.`name` AS group_name, al.`name` AS attribute_name, a.`id_attribute`, pa.`unit_price_impact` FROM `'._DB_PREFIX_.'product_attribute` pa '.Shop::addSqlAssociation('product_attribute', 'pa').' LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_attribute` LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute` LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group` LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.') WHERE pa.`id_product` = '.(int)$this->id.' GROUP BY pa.`id_product_attribute`, a.`id_attribute` ORDER BY pa.`id_product_attribute`'; $res = Db::getInstance()->executeS($sql); //Get quantity of each variations foreach ($res as $key => $row) { $cache_key = $row['id_product'].'_'.$row['id_product_attribute'].'_quantity'; if (!Cache::isStored($cache_key)) Cache::store( $cache_key, StockAvailable::getQuantityAvailableByProduct($row['id_product'], $row['id_product_attribute']) ); $res[$key]['quantity'] = Cache::retrieve($cache_key); } return $res; } /** * Get product attribute combination by id_product_attribute * * MODIFIED: GROUP BY pa.`id_product_attribute`, ag.`id_attribute_group` * * @param integer $id_product_attribute * @param integer $id_lang Language id * @return array Product attribute combination by id_product_attribute */ public function getAttributeCombinationsById($id_product_attribute, $id_lang) { if (!Combination::isFeatureActive()) return array(); $sql = 'SELECT pa.*, product_attribute_shop.*, ag.`id_attribute_group`, ag.`is_color_group`, agl.`name` AS group_name, al.`name` AS attribute_name, a.`id_attribute`, pa.`unit_price_impact` FROM `'._DB_PREFIX_.'product_attribute` pa '.Shop::addSqlAssociation('product_attribute', 'pa').' LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_attribute` LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute` LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group` LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.') WHERE pa.`id_product` = '.(int)$this->id.' AND pa.`id_product_attribute` = '.(int)$id_product_attribute.' GROUP BY pa.`id_product_attribute`, a.`id_attribute` ORDER BY pa.`id_product_attribute`'; $res = Db::getInstance()->executeS($sql); //Get quantity of each variations foreach ($res as $key => $row) { $cache_key = $row['id_product'].'_'.$row['id_product_attribute'].'_quantity'; if (!Cache::isStored($cache_key)) Cache::store( $cache_key, StockAvailable::getQuantityAvailableByProduct($row['id_product'], $row['id_product_attribute']) ); $res[$key]['quantity'] = Cache::retrieve($cache_key); } return $res; } } Link to comment Share on other sites More sharing options...
loulou66 Posted July 7, 2014 Share Posted July 7, 2014 Coucou malheureusement je ne voit rien as tu refais les manip pas a pas ? pour voir si il manquait pas un, un ; ou une } remet les fichier d'origine de PS et test pour voir si tu as une erreur ensuite refait les manips d'overrides si tu est sur un 1.6 des fois le fichier cache/class-index.php ne remet pas a jour il faut le supprimer manuellement pour qu'il se refasse avec les overrides apres il faut que tu voit avec Presto Changeo le concepteur de ce module @++ Loulou66 Link to comment Share on other sites More sharing options...
berninoel42 Posted July 8, 2014 Author Share Posted July 8, 2014 (edited) en faite ce que je trouve bizarre c'est que de base ces fichiers n'existe pas...même dans mes sauvegardes.J'ai envoyé un email au développeur pour qu'il me répare ceci.J'attends sa réponse...qui à mon avis sera négative.Du coup j'ai tout gagné, je voulais un nouveau module, et j'ai plus de site...super! Edited July 8, 2014 by berninoel42 (see edit history) Link to comment Share on other sites More sharing options...
berninoel42 Posted July 8, 2014 Author Share Posted July 8, 2014 (edited) Alors je viens de recharger le fichier ProductComment.php et ca refonctionne. Je me suis apercu que ce fichier ne contenait que 500 ligne...du coup il n'arrivait pas à trouver la ligne 820..normal ! il ne fallait en rien toucher les fichiers dans le override. pourquoi faire compliqué quand on peut faire simple ! Merci à tous de votre aide si précieuse problème résolu Edited July 8, 2014 by berninoel42 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now