Phenomene Posted May 21 Share Posted May 21 J'ai une erreur de syntaxe. Je pense que c'est au niveau de la couleur voir image. $product highlight. Je n'arrive pas à changer la couleur dans notepad ++. J'ai essayé paramètre configurateur de coloration syntaxique et je n'y suis pas arrivé. J'ai regardé plusieurs tuto sur notepad++ sans succès. Lorsque j'insère un _ la couleur est bonne sauf qu'il ne faut ce _ ($product_ highlight) . Quelqu'un pourrait me dire ce qu'il faut faire ? Merci syntax error, unexpected 'highlight' (T_STRING), expecting ')' syntax error, unexpected 'highlight' (T_STRING) Link to comment Share on other sites More sharing options...
Eolia Posted May 21 Share Posted May 21 En php une variable ne peut pas comporter d'espace, revoyez votre code. Link to comment Share on other sites More sharing options...
Phenomene Posted May 21 Author Share Posted May 21 Ou alors il faut juste accoler les deux termes $producthighlight ? Merci gshoppingflux.zip Link to comment Share on other sites More sharing options...
Phenomene Posted May 21 Author Share Posted May 21 Je voulais savoir si je pouvais supprimer } $info_cron = '<a href="'.$this->uri.'modules/'.$this->name.'/cron.php" target="_blank">'.$this->uri.'modules/'.$this->name.'/cron.php</a>'; if (count($languages) > 1) { $files_desc = $this->l('Configure these URLs in your Google Merchant Center account.'); } else { $files_desc = $this->l('Configure this URL in your Google Merchant Center account.'); J'aimerais pouvoir cliquer sur le lien voir image. C'est pourquoi j'ai copier le fichier file_ exports Merci Link to comment Share on other sites More sharing options...
Eolia Posted May 21 Share Posted May 21 il y a 39 minutes, Phenomene a dit : Ou alors il faut juste accoler les deux termes $producthighlight ? Merci gshoppingflux.zip 21.72 Ko · 2 downloads Ben non, il faut mettre un underscore: $product_highlight vu que c'est comme ça que la variable s'appelle à la ligne 201. Link to comment Share on other sites More sharing options...
Eolia Posted May 21 Share Posted May 21 il y a 20 minutes, Phenomene a dit : Je voulais savoir si je pouvais supprimer } $info_cron = '<a href="'.$this->uri.'modules/'.$this->name.'/cron.php" target="_blank">'.$this->uri.'modules/'.$this->name.'/cron.php</a>'; if (count($languages) > 1) { $files_desc = $this->l('Configure these URLs in your Google Merchant Center account.'); } else { $files_desc = $this->l('Configure this URL in your Google Merchant Center account.'); J'aimerais pouvoir cliquer sur le lien voir image. C'est pourquoi j'ai copier le fichier file_ exports Merci Ben si vous supprimez cette ligne vous n'aurez plus le lien de la tâche cron. Pour info je ne crois pas que ce module d'il y a 12 ans soit encore fonctionnel par rapport aux standard actuels exigés par GoogleMerchantCenter Link to comment Share on other sites More sharing options...
Phenomene Posted May 21 Author Share Posted May 21 10 minutes ago, Eolia said: Ben non, il faut mettre un underscore: $product_highlight vu que c'est comme ça que la variable s'appelle à la ligne 201. C'est moi qui ai rajouté $product_highlight dans plusieurs lignes du code. Link to comment Share on other sites More sharing options...
Phenomene Posted May 21 Author Share Posted May 21 9 minutes ago, Eolia said: Ben si vous supprimez cette ligne vous n'aurez plus le lien de la tâche cron. Pour info je ne crois pas que ce module d'il y a 12 ans soit encore fonctionnel par rapport aux standard actuels exigés par GoogleMerchantCenter Je tente on verra bien. Link to comment Share on other sites More sharing options...
Eolia Posted May 21 Share Posted May 21 il y a 2 minutes, Phenomene a dit : C'est moi qui ai rajouté $product_highlight dans plusieurs lignes du code. Alors il faut être logique et conserver la même syntaxe partout. Link to comment Share on other sites More sharing options...
Phenomene Posted May 21 Author Share Posted May 21 12 minutes ago, Eolia said: Ben si vous supprimez cette ligne vous n'aurez plus le lien de la tâche cron. Pour info je ne crois pas que ce module d'il y a 12 ans soit encore fonctionnel par rapport aux standard actuels exigés par GoogleMerchantCenter J'aimerais remplacer ou supprimer ce code : if (count($languages) > 1) { $files_desc = $this->l('Configure these URLs in your Google Merchant Center account.'); } else { $files_desc = $this->l('Configure this URL in your Google Merchant Center account.'); } Link to comment Share on other sites More sharing options...
Phenomene Posted May 21 Author Share Posted May 21 Dans cet article sur les Ressource REST : produits il est écrit : "productHighlights": [ https://developers.google.com/shopping-content/reference/rest/v2.1/products Link to comment Share on other sites More sharing options...
Phenomene Posted May 21 Author Share Posted May 21 3 hours ago, Eolia said: Alors il faut être logique et conserver la même syntaxe partout. C'est ce que je me suis dit, alors je me suis basée sur ce qui existait. En ajoutant, product highlight, j'ai commencé par écrire comme ça product highlight et après comme ça product _ highlight partout ou cela le nécessitait. Au final, j'obtiens toujours les messages d'erreur de syntaxe. Link to comment Share on other sites More sharing options...
Eolia Posted May 21 Share Posted May 21 product _ highlight <= pas bon, il y a 2 espaces $product_highlight <= Correct Link to comment Share on other sites More sharing options...
yama Posted May 22 Share Posted May 22 A ta place, j'aurais achete un module a jour pour exporter les produits sur Google plutot que de lire des tuto notepad ++ Petit gain de temps. Link to comment Share on other sites More sharing options...
Phenomene Posted May 22 Author Share Posted May 22 J'ai un nouveau message d'erreur syntax error, unexpected '$id_shop' (T_VARIABLE), expecting ')' Est-ce que le problème viendrait d'ici ? Merci public function initDb($id_shop) { $languages = Language::getLanguages(true, $id_shop); $id_lang = $this->context->language->id; $str = array(); $shop = new Shop($id_shop); $root = Category::getRootCategory($id_lang, $shop); $categs = Db::getInstance()->executeS(' SELECT c.id_category, c.id_parent, c.active FROM '._DB_PREFIX_.'category c INNER JOIN `'._DB_PREFIX_.'category_shop` cs ON (cs.id_category=c.id_category AND cs.id_shop='.(int) $id_shop.') ORDER BY c.id_category ASC, c.level_depth ASC, cs.position ASC;'); foreach ($categs as $kc => $cat) { foreach ($languages as $key => $lang) { $str[$lang['id_lang']] = ''; } $condition = ''; $availability = ''; $gender = ''; $age_group = ''; $color = ''; $material = ''; $pattern = ''; $size = ''; $product_highlight = ''; $cat_exists = GCategories::get($cat['id_category'], $id_lang, $id_shop); if ((!count($cat_exists) || $cat_exists === false) && ($cat['id_category'] > 0)) { if ($root->id_category == $cat['id_category']) { foreach ($languages as $key => $lang) { $str[$lang['id_lang']] = $this->l('Google Category Example > Google Sub-Category Example'); } $condition = 'new'; $availability = 'in stock'; } GCategories::add($cat['id_category'], $str, $cat['active'], $condition, $availability, $gender, $age_group, $color, $material, $pattern, $size, $id_shop,$product_highlight ); } } foreach ($languages as $lang) { if (!count(GLangAndCurrency::getLangCurrencies($lang['id_lang'], $id_shop))) { GLangAndCurrency::add($lang['id_lang'], $this->context->currency->id, 1, $id_shop); } } return true; } public function uninstall($delete_params = true) { if (!parent::uninstall()) { return false; } if ($delete_params) { if (!$this->uninstallDB() || !Configuration::deleteByName('GS_PRODUCT_TYPE') || !Configuration::deleteByName('GS_DESCRIPTION') || !Configuration::deleteByName('GS_SHIPPING_MODE') || !Configuration::deleteByName('GS_SHIPPING_PRICE') || !Configuration::deleteByName('GS_SHIPPING_COUNTRY') || !Configuration::deleteByName('GS_SHIPPING_COUNTRIES') || !Configuration::deleteByName('GS_CARRIERS_EXCLUDED') || !Configuration::deleteByName('GS_IMG_TYPE') || !Configuration::deleteByName('GS_MPN_TYPE') || !Configuration::deleteByName('GS_GENDER') || !Configuration::deleteByName('GS_AGE_GROUP') || !Configuration::deleteByName('GS_ATTRIBUTES') || !Configuration::deleteByName('GS_COLOR') || !Configuration::deleteByName('GS_MATERIAL') || !Configuration::deleteByName('GS_PATTERN') || !Configuration::deleteByName('GS_SIZE') || !Configuration::deleteByName('GS_PRODUCT_HIGHLIGHT') || !Configuration::deleteByName('GS_EXPORT_MIN_PRICE') || !Configuration::deleteByName('GS_NO_GTIN') || !Configuration::deleteByName('GS_SHIPPING_DIMENSION') || !Configuration::deleteByName('GS_NO_BRAND') || !Configuration::deleteByName('GS_ID_EXISTS_TAG') || !Configuration::deleteByName('GS_EXPORT_NAP') || !Configuration::deleteByName('GS_QUANTITY') || !Configuration::deleteByName('GS_FEATURED_PRODUCTS') || !Configuration::deleteByName('GS_GEN_FILE_IN_ROOT') || !Configuration::deleteByName('GS_FILE_PREFIX')) { return false; } } return true; } Link to comment Share on other sites More sharing options...
Mediacom87 Posted May 22 Share Posted May 22 Il y a 1 heure, yama a dit : A ta place, j'aurais achete un module a jour pour exporter les produits sur Google plutot que de lire des tuto notepad ++ Petit gain de temps. +1 Link to comment Share on other sites More sharing options...
Phenomene Posted May 22 Author Share Posted May 22 Suis-je bien sur un forum d'entraide ou pas ? Link to comment Share on other sites More sharing options...
coeos.pro Posted May 22 Share Posted May 22 Il y a 15 heures, Eolia a dit : Alors il faut être logique et conserver la même syntaxe partout. je confirme, et c'est vraiment partout, dans le code il y a Link to comment Share on other sites More sharing options...
coeos.pro Posted May 22 Share Posted May 22 Configuration::updateValue('GS_PRODUCT HIGHLIGHT',... Link to comment Share on other sites More sharing options...
coeos.pro Posted May 22 Share Posted May 22 Tools::getValue('product Highlight') Link to comment Share on other sites More sharing options...
coeos.pro Posted May 22 Share Posted May 22 GCategories::update(...$size, $product highlight $id_shop); Link to comment Share on other sites More sharing options...
coeos.pro Posted May 22 Share Posted May 22 return array( ... 'product highlight[]' => $product_highlight, Link to comment Share on other sites More sharing options...
Phenomene Posted May 22 Author Share Posted May 22 J'ai retravailler le fichier le voici gshoppingflux.zip Link to comment Share on other sites More sharing options...
coeos.pro Posted May 22 Share Posted May 22 et qu'est ce qui ne fonctionne pas ? il y a un message d'erreur ? Link to comment Share on other sites More sharing options...
Phenomene Posted May 22 Author Share Posted May 22 Le message d'erreur syntax error, unexpected '$id_shop' (T_VARIABLE), expecting ')' Link to comment Share on other sites More sharing options...
Mediacom87 Posted May 22 Share Posted May 22 il y a une heure, Phenomene a dit : Suis-je bien sur un forum d'entraide ou pas ? Oui et non. Entraide, vous l'avez trouvé, effectuer les tâches à votre place, ce n'est pas le but. Là, vous avez récupéré un script dont ne sait où qui, à l'évidence, ne fonctionne pas. Modifier un module existant demande des connaissances adaptées et comme nous ne pouvons pas deviner ce que votre code doit faire, nous ne pouvons pas vous aiguiller. La première réponse est la bonne, une variable PHP ne peut pas contenir d'espace. Après, vous demandez un autre truc sans avoir fait le moindre retour sur la première demande, donc nous ne savons déjà plus ce que vous faites et où vous en êtes. Pareil, lorsque vous partagez du code sur le forum, faites le en utilisant la fonction dédié qui va permettre d'avoir une présentation convenable et lisible. De plus, comme indiqué dans les règles du forum, une question = un topic, pas 10 questions dans un seul topic, c'est impossible à suivre. Et pour finir, le script que vous utilisez est déjà périmé puisqu'il en existe un en version 1.7.4 que j'ai trouvé sans grande recherche, sauf que ce script date de 2021, donc peut-être qu'il n'est tout simplement pas compatible avec votre version de PrestaShop ou de PHP. Link to comment Share on other sites More sharing options...
coeos.pro Posted May 22 Share Posted May 22 ligne 400 GCategories::update($id_gcategory, $gcateg, $export, $condition, $availability, $gender, $age_group, $color, $material, $pattern, $size, $product_highlight $id_shop); il manque une virgule avant $id_shop Link to comment Share on other sites More sharing options...
yama Posted May 22 Share Posted May 22 12 hours ago, Phenomene said: Suis-je bien sur un forum d'entraide ou pas ? C'est un forum d'entraide. Cependant, ce n'est pas une classe pour apprendre php. Si vous ne savez pas changer la couleur dans un editeur, il y a de forte chance que vous n'ayez jamais touche a php. Sinon vous n'utiliseriez probablement pas notepad++ mais ca c'est une autre histoire. Ne pas connaitre php est un leger probleme pour corriger et ou modifier le comportement d'un module existant. De ce fait, je vous conseille d'acheter un module sans bug et d'apprendre php en // sur des forums dedies et sur des projets un peu moins complexe. 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