- Posts: 117
- Thank you received: 1
[résolu]codification champ personnalisé
- rottenberg
-
Topic Author
- Offline
-- Joomla version -- : 3.3.6
-- PHP version -- : 2.5.6
Bonjour;
J'ai ajouté un champ personnalisé dans la définition de produits : la certification.
Il s'agit d'une liste à choix multiple.
Certains codes (importé depuis une autre application) ont 3 caractères et d'autres en ont 4.
Exemple :
BDL : BETDIN LYON
BDLO : BETDIN LONDRES
Dans le module du filtre si je saisis dans le code de certification le mot lyon on me propose BETDIN LYON.
Mais l'affichage contient tous les produits ayant la référence BDL et la référence BDLO (BETDIN LONDRES).
Comme je ne peux pas gérer les codes de certification (donnés par une application extérieure) comme puis je faire pour n'avoir que le code demandé.
Par avance merci pour vos conseilss
Meilleures salutations
Michel ROTTENBERG
Please Log in or Create an account to join the conversation.
Il n'y a pas d'option pour changer cela.
Changez la ligne:
Please Log in or Create an account to join the conversation.
- rottenberg
-
Topic Author
- Offline
- Posts: 117
- Thank you received: 1
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR b.certification LIKE 'BDL,%' OR b.certification LIKE '%,BDL' OR b.certificati' at line 1 SQL=SELECT DISTINCT b.* FROM hfn_hikashop_product_category AS a LEFT JOIN hfn_hikashop_product AS b ON a.product_id=b.product_id WHERE b.product_published=1 AND b.product_type = 'main' AND a.category_id IN (2) AND b.product_quantity!=0 AND (b.product_access = 'all' OR b.product_access LIKE '%,9,%') AND (b.certification = 'BDL' OR OR b.certification LIKE 'BDL,%' OR b.certification LIKE '%,BDL' OR b.certification LIKE '%,BDL,%') ORDER BY a.ordering ASC LIMIT 0, 21
Par ailleurs je n'ai pas trouvé le fichier dans la liste des sources personnalisables, j'ai fait la modification directement dans le repertoire.
Je joins le fichier filter.php aprè modification
Please log in or register to see it.
par avance merci pour vos conseils
meilleures salutations
Michel ROTTENBERG
Please Log in or Create an account to join the conversation.
J'ai fais une erreur dans le code de mon précédent message. J'ai corrigé. Veuillez réappliquer avec le nouveau code et cela devrait éviter le problème.
Please Log in or Create an account to join the conversation.
- rottenberg
-
Topic Author
- Offline
- Posts: 117
- Thank you received: 1
Par ailleurs je ne trouve pas le source dans la fonction de personnalisation des sources dan HIKA SHOP. J'ai modifié le source directement par FTP. Que se passera-t-il lors d'un upgrade de HIKA SHOP
Meilleures salutations
Michel ROTTENBERG
Please Log in or Create an account to join the conversation.
www.hikashop.com/forum/product-category-...onnalise.html#176812
Comme expliqué dans mon précédent message, j'ai corrigé le code de mon premier message directement dans le message.
C'est en effet pas FTP qu'il faut faire la modification.
Si la modification est concluante, merci de nous faire un retour et nous l'inclueront dans la prochaine version d'HikaShop.
Ainsi, pas de soucis pour les prochaines mises à jour.
Please Log in or Create an account to join the conversation.
- rottenberg
-
Topic Author
- Offline
- Posts: 117
- Thank you received: 1
quand je choisis 'BDL' (BETDIN LYON) je ne récupère aucun produit.
Quand je choisis 'BDLO' (BETDIN LONDRES) je récupère bien les produits correspondants.
meilleures salutations
Michel
Please Log in or Create an account to join the conversation.
take.ms/QZFtG
Donc je ne vois pas ?
Peut-être avz vous des espaces avant ou après le texte ou quelque chose du genre ?
Please Log in or Create an account to join the conversation.
- rottenberg
-
Topic Author
- Offline
- Posts: 117
- Thank you received: 1
il faut prendre le second : certification.
tapez Lyon vous obtiendrez le libelle de la certification : BETH DIN DE LYON. Les produits selectionnes seront ceux du BETH DIN DE LONDRES ( code certification correspondant : BDLO) et ceux du BETH DIN de LYON ( code correspondant : BDL).
SI vous tapez Londres dans le critère de choix certification, vous n obtiendrez que ceu du BETH DIN DE LONDRES.
meilleures salutations
Michel ROTTENBERG
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- rottenberg
-
Topic Author
- Offline
- Posts: 117
- Thank you received: 1
je viens de télécharger la version 2.3.4.
Le filtre sur un champ de selection ne fonctionne pas. il génère l'erreur suivante :
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR b.certification LIKE 'BDLO,%' OR b.certification LIKE '%,BDLO' OR b.certifica' at line 1 SQL=SELECT DISTINCT b.* FROM hfn_hikashop_product_category AS a LEFT JOIN hfn_hikashop_product AS b ON a.product_id=b.product_id WHERE b.product_published=1 AND b.product_type = 'main' AND a.category_id IN (2) AND b.product_quantity!=0 AND (b.product_access = 'all' OR b.product_access LIKE '%,9,%') AND (b.certification = 'BDLO' OR OR b.certification LIKE 'BDLO,%' OR b.certification LIKE '%,BDLO' OR b.certification LIKE '%,BDLO,%') ORDER BY a.ordering ASC LIMIT 0, 21
J'ai remplacé la modification faite dans filter.php par celle donnée ci desssus :
$fieldsList[] = 'b.'.$filter->filter_options.' = '.$database->Quote($field);
$fieldsList[] = 'b.'.$filter->filter_options.' LIKE \''.hikashop_getEscaped($field,true).',%\'';
$fieldsList[] = 'b.'.$filter->filter_options.' LIKE \'%,'.hikashop_getEscaped($field,true).'\'';
$fieldsList[] = 'b.'.$filter->filter_options.' LIKE \'%,'.hikashop_getEscaped($field,true).',%\'';
J'ai fait un essai. Maintenant cela fonctionne. Je n'ai plus aucun problème entre les codes 'BDL' et 'BDLO'.
Meilleures salutations
Michel ROTTENBERG
Please Log in or Create an account to join the conversation.
Merci d'éditer le fichier "administrator/components/com_hikashop/classes/filter.php" et de remplacer
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.