Version imprimable du sujet

Cliquez ici pour voir ce sujet dans son format original

Forum osCommerce-fr _ Contributions _ Flash Discount

Écrit par : Gyakutsuki 1 Feb 2005, 16:25

bonjour à tous,

Comme je l'avais annoncé dans un des post du forum, voici une nouvelle contribution.
Son objectif : réaliser des ventes flash.

Amusez vous bien !

http://www.oscommerce.com/community/contributions,2888

Écrit par : gazgull 2 Feb 2005, 01:45

salut

super module mais quand je rentre une promo( specials.php) je n'ai pas de champs supplémentaire de choix de date de début de la vente flash du coup si je rentre n'importe quel date d'expiration il met : j- 38Mn (???) je configure ca où ?

merci d'avance
manu

Écrit par : Gyakutsuki 2 Feb 2005, 02:33

Salut,

C'est une première version qui pourra évoluer dans le temps. tes observations sont correctes.
il pourrait y avoir un champ supplémentaire permettant de mettre un temps définis.
il pourrait aussi y avoir une date de début. j'y avais pensé mais je n'ai pas eu le temps de le faire.

Pour l'instant, il n'y a qu'une date d'expiration.

Ce module n'existe pas à ma connaissance sur os.com. C'est en ce sens que j'ai commencé à le développer. Il y en aura certainement d'autres qui proposeront des évolutions en intégrant les éléments cités ci dessus par exemple.

je viens de remarquer qu'il y a une erreur importante de calcul entre les dates. les premiers tests que j'avais fait présentaient des résultats correctes. Après une deuxième vérification, ce n'est pas le cas.
J'y travaille et je reviens dessus dès que possible.
Désolé pour le dérangement.

Écrit par : Gyakutsuki 2 Feb 2005, 18:26

V1.1 est sortie.
gestion des calculs de date rectifié
Bugs sur partie specials.php et general.php dans l'admin rectifiés.

Écrit par : angiez 2 Feb 2005, 22:21

QUOTE (Gyakutsuki @ 02 fév 2005, 18:26)
V1.1 est sortie.
gestion des calculs de date rectifié
Bugs sur partie specials.php et general.php dans l'admin aussi.

Bonsoir Gyakutsuki,

cette contribution est du pain béni mais j'hésite à l'installer... fonctionne-t-elle avec la contrib seperate price per customer ou les specials posent-elles pb ?

merci !

Écrit par : Gyakutsuki 2 Feb 2005, 22:28

Salut cette première version a été réalisée en modifiant un peu le fichier special dans l'admin. Coté catalog les fichiers impactés est product info. Le reste est généré dans une boxe et une page spéciale pour les flash.

Concernant l'autre contrib, je n'en sais trop rien sachant que je ne l'ai pas installé.

idéalement, mets les fichiers sur ton serveur test et puis tu verras.

Écrit par : angiez 2 Feb 2005, 22:39

QUOTE (Gyakutsuki @ 02 fév 2005, 22:28)
Salut cette première version a été réalisée en modifiant un peu le fichier special dans l'admin. Coté catalog les fichier impacté est product inf. Le reste est générée dans une boxe et une page spéciale pour les flash.

Concernant l'autre contrib, je n'en sais trop rien sachant que je ne l'ai pas installé.

idéalement, mets les fichiers sur ton serveur test et puis tu verras.

Merci de ta réponse Gyakutsuki!

Je vais attendre la prochaine version de SPPC et j'installerai à ce moment ta contrib car je risque de ramer pdt des jours voire des semaines.

Dès que je fais l'install je reviens poster en espérant que cela intéresse qques pers.

Merci encore!! wink.gif

Écrit par : corbin 3 Feb 2005, 20:13

mais non, on ne t'en veux pas ... Gyakutsuki (http://www.oscommerce-fr.info/forum/index.php?showtopic=16706&st=0&#entry89316 )
...mais pour un non-comprenant comme moi, avais-je bien compris ?

QUOTE
on met un produit à prix cassé de 17 heures à 18 heures : le "happy hour" du produit ?

Écrit par : Gyakutsuki 3 Feb 2005, 20:24

Pour l'instant c'est toujours basée sur la date initiale de la promotion. La flash se terminant à 24H00. La contrib permet actuellement de choisir un affichage promotion ou flash.
Elle en est à ses balbutiements.
Il faut rajouter par rapport à la vente flash, une date initiale et une date fin en prenant l'heure en compte ou uniquement en prenant l'heure. Dans ce dernier cas cela demande une gestion plus importante de l'administrateur

Prends une ms2 et copies les fichier à l'intérieur, cela devrait marcher du premier coup sans oubliér la base sql biggrin.gif


a+

Écrit par : Gyakutsuki 6 Feb 2005, 00:50

Je viens de sortir la Beta 2. La contrib a été complètement remaniée :
Tout est à ré installer y compris la bd de données qui a changée.

Vous y trouverez :
Un statut supplémentaire pour les promotions flash en plus de celui de la promotion.

Un champs supplémentaire avec la date début de la promotion flash avec H,mn,s
Un champs supplémentaire avec la date fin de la promotion flash avec H, mn,s

l'affichage dans le résumé de la date de début et fin de la promotion

Compte tenu du nbr de calcul dans le fichier product_info.php avec les dates et les conditions à respecter, j'ai besoin de quelques betas testeurs pour vérifier qu'il n'y a pas de bugs.

je vous remercie des retours.

Écrit par : abdel1970 6 Feb 2005, 19:18

bonsoir ,

j ai bien tout installé la contrib mais j ai un probleme au niveau de la base avec cette erreur :

"Il semble qu'il y ait une erreur dans votre requête SQL. Le message ci-bas peut vous aider à en trouver la cause.

ERROR: Ponctuation invalide @ 1
STR: =>
SQL: => Update the special table

ALTER TABLE `specials` ADD `flash_selling_beginning_date` DATETIME
requête SQL :

=> Update the special table ALTER TABLE `specials` ADD `flash_selling_beginning_date` DATETIME

MySQL a répondu:


#1064 - Erreur de syntaxe près de '=> Update the special table

ALTER TABLE `specials` ADD `flash' à la ligne 1"

si quelqu un a une solution

bien cordialement

smile.gif

Écrit par : Gyakutsuki 6 Feb 2005, 19:28

Je viens de refaire une installation via la requête de mise à jout et je n'ai eu aucun pb.

CODE

ALTER TABLE `specials` ADD `flash_selling_beginning_date` DATETIME;
ALTER TABLE `specials` ADD `flash_selling_end_date` DATETIME;



J'ai oublié une peite mise à jour à faire dans l'update mais c'est ok du côté de la requête
CODE

ALTER TABLE `specials` ADD `status_flash_selling` INT( 1 ) DEFAULT '1' NOT NULL;


J'ai aussi fait un test avec la base sql entière et je n'ai détecté aucun pb particulier.

CODE


DROP TABLE IF EXISTS specials;
CREATE TABLE specials (
 specials_id int(11) NOT NULL auto_increment,
 products_id int(11) NOT NULL default '0',
 specials_new_products_price decimal(15,4) NOT NULL default '0.0000',
 specials_date_added datetime default NULL,
 specials_last_modified datetime default NULL,
 expires_date datetime default NULL,
 date_status_change datetime default NULL,
 status int(1) NOT NULL default '1',
 status_flash_selling int(1) NOT NULL default '1',
 flash_selling_beginning_date datetime default NULL,
 flash_selling_end_date datetime default NULL,
 PRIMARY KEY  (specials_id)
) TYPE=MyISAM;


regarde au sein de table mysql ce qui se passe. Tu as du oublié de copier une partie du code. Ca peut arriver.

Écrit par : mrmicro 6 Feb 2005, 22:34

Superbe contrib, juste un petit souci j'ai ce message d'erreur à l'insertion d'un produit pour une promotion dans l'admin:

CODE
1136 - Column count doesn't match value count at row 1

insert into specials (products_id, specials_new_products_price, specials_date_added, expires_date, flash_selling_beginning_date, status) values ('405', '', now(), '20050215', '1')

[TEP STOP]


une solution? biggrin.gif

Écrit par : Gyakutsuki 6 Feb 2005, 23:26

remplace la requête à la ligne 99 par celle là :

CODE

       tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, flash_selling_beginning_date,  flash_selling_end_date, status) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '" . tep_db_input($flash_selling_beginning_date) . "', '" . tep_db_input($flash_selling_end_date) . "', '1')");



j'ai sortie une nouvelle mouture disponible en téléchargement rectifiant des pbs partie catalog.

Écrit par : mrmicro 7 Feb 2005, 00:29

C'est OK ca marche !

j'ai deja un petit addon pour ta contrib, je vais le poster sur oscommerce.

Écrit par : Gyakutsuki 7 Feb 2005, 00:44

n'inclue pas ton add on dans le fichier, car je veux être sur qu'il n'y a plus de pbs dans la version de base.

Propose le en supplément en expliquant comment insérer cet add on.

D'ailleurs peux tu nous en dire plus.

Écrit par : mrmicro 7 Feb 2005, 00:51

C'est ce que j'ai fait ! biggrin.gif

Écrit par : Gyakutsuki 7 Feb 2005, 01:28

J'ai regardé ce que tu as fait, un petit bouton acheter en plus dans la boxe. je l'incluerais certainement quand tous ce sera débuggué.

merci

Écrit par : mrmicro 7 Feb 2005, 09:47

Oui, j'ai pencé que ca ferait plus "vente flash" comme ça. cool.gif

Le mieux serais de laisser l'original et de faire un fichier en double du genre "flash_selling.button.php" et de mettre dans le readme qu'il faut renommer celui-ci si on souhaite que le bouton apparaisse.


Écrit par : fizzys 7 Feb 2005, 19:38

Bonsoir
j"ai aussi la même erreur que abdel1970 sur la requête SQL tentative effectuer par emplacement du fichier texte /exécuter ?? smile.gif
si quelqu un a une solution
Merci
fizzys

Écrit par : gazgull 8 Feb 2005, 00:30

huh.gif

salut
j'ai un petit bug... il affiche en minutes (249) y a pas un truc pour convertir ? en heures ET minutes

merci

Écrit par : Gyakutsuki 8 Feb 2005, 00:35

Ah, il ne convertit pas en heures, il y a un pt bug dans la conditions. je vais voir ca.
Il doit afficher d'abord en J, puis H, puis Mn, enfin secondes !!

Écrit par : Gyakutsuki 8 Feb 2005, 01:51

Bon j'ai regardé :

une petite erreur à la ligne 165 : la remplacer par celles-ci :

CODE


     if (($ecart_hour >0) && ($ecart_days < 1))  {
       echo J_FLASH_SELLING .': '. $ecart_hour .' H ';
     }
     
      if (($ecart_minutes > 0) && ($ecart_hour < 1 )) {
        echo J_FLASH_SELLING .': '. $ecart_minutes .' Mn ';
     }


Sinon il faut bien remplir tous les champs

Écrit par : gazgull 8 Feb 2005, 15:36

dry.gif

salut
y a t'il une possibilité qu'à la fin de la vente flash que ça désactive le prix promo ?


manu

Écrit par : Gyakutsuki 8 Feb 2005, 20:02

Ben tu as le choix entre la promotion et la vente flash. La promos fonction au jour, la flash à l'heure. Je ne sais pas si c'est d'une très grande utilité.
le Flash s'arrête automatiquement et la promo peut reprendre la suite ! Le seule problème est que le flash et la promo sont associés au même prix. A la rigueur il faudrait définir un prix sur le flash. Ainsi on résout le problème.
Je vais voir ce problème mais cela ne sera pas pour tout de suite à moins que j'arrive à trouver un peu de temps.

Écrit par : gazgull 8 Feb 2005, 23:09

wink.gif

bah en fait je veux faire une vente promo (flash) mais de quelques heures seulement d'où l'interet pour ton module... un genre de promo améliore en fait

bon courage pour la suite...

manu

Écrit par : Ryu007 10 Feb 2005, 18:04

Bonjour Gyakutsuki et à tous,

L'idée de la contribution est super biggrin.gif ...

Moi de mon coté j'ai quelques suggestions :

arrow.gif 1. Séparer les promotions des ventes flash car il est certain que c'est pas terrible d'afficher le produit dans deux catégories qui sont tout de meme assez opposés,
penses-tu pas ?! (Avis TRES TRES personnel)

Sur papier, c'est pas très dur à faire :
dans specials.php, ajouter dans l'ordre SQL à la ligne 54

CODE

and s.status_flash_selling = '0'
juste après where p.products_status = '1'

arrow.gif 2. Ensuite pour l'affichage de la mention "Vente flash" je pense qu'il serait plus sympa de faire un décompte "dynamique" en javascript comme un temps chronometre, quoi !
Pour le code javascript, je sais pas trop comment m'y prendre confused.gif ...

A toi de me dire si tous ça vaut le coup wink.gif ...
Amicalement

Écrit par : Gyakutsuki 10 Feb 2005, 18:47

Salut,

je suis entrain de travailler actuellement sur un champs tarif promotionnel.
Donc tu vas pouvoir faire par exemple :
Une promotion et à un moment donné basuclé automatiquement en super promo
Ou une super promo puis basculer en promo
Ou uniquement une promo
ou uniquement une super promo

Donc séparé les 2, je ne pense que celasoit utile. tu peux le faire en fonction des éléments ci dessus. Donc je me pencher dans la galère des conditions !!!

je ne sais pas quand je sortirais ce code, mais bon on verra. Déjà ca marche pas mal comme ca.

Pour ce qui est du décompte dynamique. Pas le temps de m'y pencher mais si il y a q'un qui veux le produite cela serait cool.


Écrit par : Ryu007 10 Feb 2005, 19:16

QUOTE (Gyakutsuki @ 10 fév 2005, 18:47)
Salut,

je suis entrain de travailler actuellement sur un champs tarif promotionnel.
Donc tu vas pouvoir faire par exemple :
Une promotion et à un moment donné basuclé automatiquement en super promo
Ou une super promo puis basculer en promo
Ou uniquement une promo
ou uniquement une super promo

Donc séparé les 2, je ne pense que celasoit utile. tu peux le faire en fonction des éléments ci dessus. Donc je me pencher dans la galère des conditions !!!

je ne sais pas quand je sortirais ce code, mais bon on verra. Déjà ca marche pas mal comme ca.

Pour ce qui est du décompte dynamique. Pas le temps de m'y pencher mais si il y a q'un qui veux le produite cela serait cool.

Bonjour Gyakutsuki,

Ouep effectivement ton idée est plus étudié que la mienne blush.gif

Pour l'idée du décompte javascript, c'est facile de trouver les scripts sur internet ...
Je t'en donne un que j'ai trouver sur mon "préféré" :

http://www.editeurjavascript.com/scripts/scripts_temps_1_103.php
Ou encore
http://www.editeurjavascript.com/scripts/scripts_temps_3_283.php

Amicalement

Écrit par : Gyakutsuki 10 Feb 2005, 19:18

ok merci, je verrais ce pb au moment venu.

a+

Écrit par : Ryu007 10 Feb 2005, 19:20

Pas de problème ...

Bonne continuation pour la suite et félicitation pour la contribution wink.gif

Amicalement

Écrit par : Rogers 11 Feb 2005, 10:01

Bonjour,

Etant donné que j'ai la Creload et une contrib B2B sur ma boutique, je suis extrèmement vigilent lorsque j'installe une nouvelle contrib.

Ainsi, j'ai remarqué qu'il y avait deux general.php dans includes/functions (un general.php et un general1.php). Quelle est la différence ? Les deux sont obligatoires ? Si oui pourquoi ?

Merci pour la réponse.

Écrit par : Gyakutsuki 11 Feb 2005, 21:36

Salut,

Tu peux l'effacer

Écrit par : Francois_from_Paris 13 Feb 2005, 00:07

Bonjour à tous !

Je suis nouveau sur le forum, je me lance dans la programmation php et je viens de découvrir osCommerce. Je trouve que vous faites tous un boulot formidable pour la communauté. De belles nuits blanches en perspective pour créer ma nouvelle boutique !

Concernant la contrib Flash Discount, je voudrais savoir s'il serait possible de développer une version pour laquelle on mettrait dans la base de données un prix discount pour chaque produit, et la machine choisirait un produit aléatoirement et le mettrait à l'affiche du site pendant une durée x avec un compteur qui décompte le temps restant, une fois le temps écoulé le produit reviendrait à son prix normal, puis un autre produit choisi au hasard prendrait sa place et ainsi de suite...

Voilà, si je rêve un peu dites-le moi !

En attendant mes propres contribs.... wink.gif

Écrit par : Gyakutsuki 13 Feb 2005, 00:36

Je pense que c'est possible mais comme tu dis tu as quelques nuits blanches devant toi biggrin.gif

Écrit par : binsou 23 Feb 2005, 14:35

QUOTE (abdel1970 @ 06 fév 2005, 13:18)
bonsoir ,

j ai bien tout installé la contrib mais j ai un probleme au niveau de la base avec cette erreur :

"Il semble qu'il y ait une erreur dans votre requête SQL. Le message ci-bas peut vous aider à en trouver la cause.

ERROR: Ponctuation invalide @ 1
STR: =>
SQL: => Update the special table

ALTER TABLE `specials` ADD `flash_selling_beginning_date` DATETIME
requête SQL : 

=> Update the special table ALTER TABLE `specials` ADD `flash_selling_beginning_date` DATETIME

MySQL a répondu:


#1064 - Erreur de syntaxe près de '=> Update the special table

ALTER TABLE `specials` ADD `flash' à la ligne 1"

si quelqu un a une solution

bien cordialement

smile.gif

Bonjour Abdel,
en réponse à ton post il me semble qu'en mysql pour ajouter une colonne (apparement c'est ce qui est fait ici) à une table la requete est la suivante :

CODE

ALTER TABLE  database.table ADD COLUMN ma_colonne varchar(12);


Ce qui ici donnerait :


CODE

ALTER TABLE nombase.specials ADD COLUMN flash_selling_beginning_date DATETIME;



Si tu as fait un "use mabase;" avant, le nom de la base en préfixe n'est peut etre pas nécessaire.

Écrit par : misilsam 2 Mar 2005, 21:44

Bonjour,

apres install de la version 1.6, a chaque fois ou je clique sur "promotions" pour mettre virtuellement un produit en promotion j'ai cette erreur :


1054 - Unknown column 'flash_selling_beginning_date' in 'field list'

select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, flash_selling_beginning_date, flash_selling_end_date, s.date_status_change, s.status, s.status_flash_selling from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = s.products_id order by pd.products_name limit 0, 20



pouvez vous m'aider svp ?

Merci


Écrit par : Gyakutsuki 2 Mar 2005, 22:13

Je viens de vérifier dans le package, toutes les relations y sont, tu as du oublier quelques chose et fait un tour sur ce post

Refait une installation.

Écrit par : misilsam 3 Mar 2005, 01:33

C bizzare je viens de le reinstaller a plusieures reprises sur un istall fraiche, dans le dossier catalog et toujours la meme chose.


Écrit par : misilsam 3 Mar 2005, 01:40

Je ne voit carrement pas d'ou ça peut venir. confused.gif

Écrit par : mesly 3 Mar 2005, 16:02

Bonjour
Pourriez vous me dire si cette contrib est possible avec la crealod 5 ?
Merci

Écrit par : Gyakutsuki 3 Mar 2005, 16:06

La réponse est oui s'il y a une adaptation, je crois que certains y avaient déjà pensé. Tu devrais trouver des infos dans le forum en question.

Écrit par : goutbouyo 6 Mar 2005, 16:10

Salut,

Je viens d'installer cette contribution et quand ma vente flash est finie, le produit n'est plus en promo donc c'est bon.

Mais par contre, dans le module vente flash (à gauche parti client) le produit apparait toujours avec l'ancien prix de promo et si je clique sur le produit il n'y a plus la promo.

Pourquoi le produit apparait il toujours dans le module vente flash alors que celle-ci est terminée ???

Si je veux que le produit n'apparaissent plus il faut que, dans le catalogue au niveau de vente flash, je mette le produit sur le bouton rouge.

Pouvez vous m'aider SVP ???

Écrit par : SKULT 9 Mar 2005, 00:39

QUOTE (misilsam @ 02 mar 2005, 15:44)
Bonjour,

apres install de la version 1.6, a chaque fois ou je clique sur "promotions" pour mettre virtuellement un produit en promotion j'ai cette erreur :


1054 - Unknown column 'flash_selling_beginning_date' in 'field list'

select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, flash_selling_beginning_date, flash_selling_end_date, s.date_status_change, s.status, s.status_flash_selling from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = s.products_id order by pd.products_name limit 0, 20



pouvez vous m'aider svp ?

Merci

Bonjour à tous,
J'ai presque le meme problème, j'ai réinstallé le module et toujours ce message:
1064 - Erreur de syntaxe près de '-20, 20' à la ligne 1

select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, flash_selling_beginning_date, flash_selling_end_date, s.date_status_change, s.status, s.status_flash_selling from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = s.products_id order by pd.products_name limit -20, 20

[TEP STOP]


Si quelqu'un a une idée ou une explication .
Merci d'avance. biggrin.gif

Écrit par : xaglo 9 Mar 2005, 01:09

http://www.oscommerce-fr.info/faq/qa_info.php?qID=166
http://www.oscommerce-fr.info/faq/qa_info.php?qID=165

Écrit par : sam-sport 9 Mar 2005, 09:09

unsure.gif

Bonjour,

1ere---Pourquoi un produit dont la "vente flash" est active s'affiche avec une reduction alors que son heure n'est pas venue? Comme elle s'affiche dans la box, le client pense automatiquement qu'il peut en profiter mais ce n'est pas le cas. Il serait judicieux de pouvoir annoncer une vente flash à l'avance, c'est à dire indiquer au client la date debut flash et de fin pour lui faire comprendre que la date de debut n'est pas arrivée.

2eme---Pourquoi , lorsque la date debut flash commence, la reduction de prix ne s'affiche pas sur ma commande?

merci


Écrit par : SKULT 9 Mar 2005, 14:40

QUOTE (xaglo @ 08 mar 2005, 19:09)
http://www.oscommerce-fr.info/faq/qa_info.php?qID=166
http://www.oscommerce-fr.info/faq/qa_info.php?qID=165

Merci pour le lien, mais ca ne fonctionne toujours pas.
De plus dans le fichier je n'est pas la meme syntaxe que ce qui est expliqué, moi j'ai ca :
if ($this->current_page_number > $this->number_of_pages) {
$this->current_page_number = $this->number_of_pages;
}

Bon j'ai quand meme essayer en rajoutant ce qu'il etait expliquer sans succes, tjours ce mess : 1064 - Erreur de syntaxe près de '-20, 20' à la ligne 1

select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, flash_selling_beginning_date, flash_selling_end_date, s.date_status_change, s.status, s.status_flash_selling from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = s.products_id order by pd.products_name limit -20, 20

[TEP STOP]
Si quelqu'un a une idee , merci d'avance

biggrin.gif

Écrit par : zoumok 13 Mar 2005, 10:08

Bonjour,

Et bravo pour cette nouvelle contrib, une très bonne initiative, que je vais de ce pas aller tester sur le serveur de test avant inclusion en production.

Je reviendrais poster pour donner mon avis et eventuellement les problèmes rencontrés pendant l'install.

Bon dimanche à tous.

Christian

Écrit par : zoumok 16 Mar 2005, 15:06

Bonjour,

Question : est-ce possible de faire tourner cette contribution sur la Creloade6 ?

parce que moi je n'y arrive pas.

Christian

Écrit par : Standave 21 Mar 2005, 19:05

Bonsoir,

J'ai l'erreur suivante depuis l'installation de la contribution "Flash Discount" :

Warning: main(templates/Helius/TEMPLATENAME_MAIN_PAGE): failed to open stream: No such file or directory in d:\program files\easyphp\www\catalog\index.php on line 159

Fatal error: main(): Failed opening required 'templates/Helius/TEMPLATENAME_MAIN_PAGE' (include_path='.;d:/Program Files/EasyPHP\php\pear\') in d:\program files\easyphp\www\catalog\index.php on line 159

Comment je peux faire pour réparer cette erreur.
Bien cordialement
Stand

Écrit par : Gyakutsuki 25 Mar 2005, 04:43

Je viens de sortir une nouvelle version v 2.0. De nombreuses modifications ont été réalisée.

ps: pour la creload, je ne connais pas assez les spécificités de cette contribution pour apporter des solutions adéquates. Veuillez vous référez au forum en question.

QUOTE
Question : est-ce possible de faire tourner cette contribution sur la Creloade6 ?

Il ne devrait pas y avoir de raison que cela ne marche pas mais c'est plus complexe à mettre en oeuvre.

Écrit par : wen 26 Mar 2005, 09:30

Bonjour Gyakutsuki
Qu'est-ce qui change ?
que doit on modifier pour installer la V2 si on a déjà installé la V1.6 ?
Merci
Wen
A propos je suis sous creload 6 et ça marche bien.
Pour installer la boxe il faut pas faire l'include dans Colum left, il faut passer par l'admin et la gestion des infobox en ayant mis d'abord boxe/flash_selling.php dans le répertoire des boxes de son template, et pour productinfo.php, il faut modifier productinfo.tpl.php

Écrit par : Gyakutsuki 26 Mar 2005, 16:13

Les principales modifications sont dans product_info et general.php.
Certaines conditions n'étaient pas insérées et en fonction de certaines actions, il ne pouvait y avoir de résultat attendu.

Écrit par : tchaoo 31 Mar 2005, 12:21

C a fait longtemps que je tourne autour de cette contrib, j'ai commencé mon install puis vient de faire machine arrière...

Y'a pas une adresse où la voir tourner avant que je me décide ? Car comme mon site est fortement custom et que je suis pas un as en php, avant de passer une journée dessus, je voudrai bien voir... comme St thomas ;o))

Merci

Écrit par : Gyakutsuki 31 Mar 2005, 15:24

Désolé mais j'ai pas de site de démos pour cette contrib, pour ma part. Peut être que quelqqu'ici en a un ?

Écrit par : djebaz 31 Mar 2005, 22:24

Une petite erreur dans le fichier sql.txt, sur la deuxieme requete :

voici la bonne :

CODE

DROP TABLE IF EXISTS specials;
CREATE TABLE specials (
 specials_id int(11) NOT NULL auto_increment,
 products_id int(11) NOT NULL default '0',
 specials_new_products_price decimal(15,4) NOT NULL default '0.0000',
 specials_date_added datetime default NULL,
 specials_last_modified datetime default NULL,
 expires_date datetime default NULL,
 date_status_change datetime default NULL,
 status int(1) NOT NULL default '1',
 status_flash_selling int(1) NOT NULL default '1',
 flash_selling_beginning_date datetime default NULL,
 flash_selling_end_date datetime default NULL,
 specials_price_flash_selling DECIMAL(15,4) NOT NULL default '0.0000',

 PRIMARY KEY  (specials_id)
) TYPE=MyISAM;



il manquait DECIMAL là :

specials_price_flash_selling DECIMAL(15,4) NOT NULL default '0.0000',

Gyakutsuki, t'es bon pour refaire un upload smile.gif

Écrit par : Gyakutsuki 31 Mar 2005, 23:01

Merci, pack refait.

Écrit par : djebaz 31 Mar 2005, 23:04

attends, attends...

ligne 110 dans admin/specials :

il manque pas qqchose ?

CODE

       tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, flash_selling_beginning_date,  flash_selling_end_date, specials_price_flash_selling, status) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '" . tep_db_input($flash_selling_beginning_date) . "', '" . tep_db_input($flash_selling_end_date) . "', '1')");



il y a 8 champs dans lesquels on insère 7 valeurs (ou c'est mes yeux ?)

Écrit par : djebaz 31 Mar 2005, 23:07

il manque la valeur de specials_price_flash_selling

voici la ligne 110 corrigée :

CODE

tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, flash_selling_beginning_date,  flash_selling_end_date, specials_price_flash_selling, status) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '" . tep_db_input($flash_selling_beginning_date) . "', '" . tep_db_input($flash_selling_end_date) . "', '" . tep_db_input($specials_price_flash_selling) . "', '1')");


Écrit par : djebaz 31 Mar 2005, 23:31

Autre problème, toujours la même variable :

dans flash_selling.php qui liste tous les produits en vente flash, la requete est la suivante :

CODE

$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling='1' order by s.specials_date_added DESC";


On va donc afficher le mauvais prix, puisque la bonne variable est specials_price_flash_selling.

donc il faut changer en :

CODE

$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling='1' order by s.specials_date_added DESC";



et plus loin, idem, changer en :



CODE


echo '            <td align="center" width="33%" class="smallText"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $specials['products_image'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . $specials['products_name'] . '</a><br><s>' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($specials['specials_price_flash_selling'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span></td>' . "\n";



Écrit par : Gyakutsuki 1 Apr 2005, 04:23

Oups, j'ai fait quelques bêtises en faisant cette nouvelle version. elle est mal née !!

une 2.2 est sortie en prenant en compte certaines rectifications.
N'a pas encore été inclue new_product et product_new.php.

Écrit par : piapia 7 Apr 2005, 22:18

Salut à tous!

Moi aussi je me lance dans les ventes flash. Ca fonctionne plutôt assez bien
mais j'ai quand même rencontré quelques problèmes :

1) Dans l'admin, si un produit n'est pas actif en promotion mais actif en vente flash,
lorsque l'on fait 'ajouter au panier, il prend en compte le prix original.
(si promo actif et vente flash actif, plus de pb)

2) Des fois, lors d'une vente flash, product_info.php affiche uniquement le prix d'origine mais il y a bien vente flash qui clignotte. Et quand on commande, le prix 'flash' est bien pris en compte (si promo actif et vente flash actif). C'est juste un pb d'affichage.

CODE
if (($status_special =='0') && ($status_flash_selling =='0')){
               ...
               elseif...  
               elseif...
               elseif...
               elseif...
               else {
                    //Bug Affichage Vente Flash
                    ...}

Le bug arrive quand on passe dans le else.
Un cas a été oublié ???

Écrit par : Gyakutsuki 7 Apr 2005, 22:39

Quelle version as tu ?
La dernière version marche correctement au niveau de l'affichage, je n'ai pas noté de pb, mais suite à ta demande et vérification, il y a bien un petit bug concernant le prix inséré dans le panier.

Voici comment le résoudre partiellement, cela ne marche pas dans tous les cas ! . Je travaille pour améliorer le pb.
dans classes/shopping_cart.php vers la ligne 218

CODE

         $products_weight = $product['products_weight'];

// ###############" Start flash selling ###############

         $products_weight = $product['products_weight'];

// ###############" Start flash selling ###############

         $specials_query0 = tep_db_query("select status, status_flash_selling from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'  or status_flash_selling = '1' ");
         if (tep_db_num_rows ($specials_query0)) {
           $specials0 = tep_db_fetch_array($specials_query0);

     if (($specials0['status'] == '1') && ($specials0['status_flash_selling'] == '0'))  {
               $specials_query = tep_db_query("select specials_new_products_price, status  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'  ");
               if (tep_db_num_rows ($specials_query)) {
                 $specials = tep_db_fetch_array($specials_query);
           $products_price = $specials['specials_new_products_price'];
     }
     }elseif ($specials0['status_flash_selling'] == '1')  {
               $specials_query = tep_db_query("select specials_price_flash_selling, status_flash_selling  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status_flash_selling = '1'  ");
               if (tep_db_num_rows ($specials_query)) {
                 $specials = tep_db_fetch_array($specials_query);
           $products_price = $specials['specials_price_flash_selling'];
      }
     }



    }
// ###############" EndStart flash selling ###############
         $this->total += tep_add_tax($products_price, $products_tax) * $qty;// ###############" EndStart flash selling ###############


et trouver la ligne ci dessous vers 280
CODE


         $products_price = $products['products_price'];


// ############### Start flash sellling #############
         $specials_query = tep_db_query("select specials_new_products_price, specials_price_flash_selling, status,  status_flash_selling  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1' or  status_flash_selling ='1' ");
// ############### End  flash sellling #############
         if (tep_db_num_rows($specials_query)) {
           $specials = tep_db_fetch_array($specials_query);
// ############### Start flash sellling #############

     if (($specials['status'] =='1') && ($specials['status_flash_selling'] !='1')) {
            $products_price = $specials['specials_new_products_price'];
      } else  {
            $products_price = $specials['specials_price_flash_selling'];
           }
         }
// ############### End  flash sellling #############

         $products_array[] = array('id' => $products_id,


Dans Flash_selling.php vers la ligne 56 à 62, les remplacer par celles-ci

Reste à vérifier si tout cela marche quand le flash_selling devient en off ==> pas encore fait.



CODE

<?php
//  $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling='1' order by s.specials_date_added DESC";

$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling='1' order by s.specials_date_added DESC";

$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);

 if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>


Dans le même fichier changer la requeête par celle ci
CODE

$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() < s.flash_selling_end_date order by s.specials_date_added DESC";


Dans includes/boxes/flash_selling.php

changer la requête par celle ci
CODE

 if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() < s.flash_selling_end_date order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {


Une version 2.3 est sortie reprenant ces éléments et quelques améliorations. Attention, il y a une nouveau champs dans la BD

Écrit par : wen 9 Apr 2005, 11:35

Bonjour Gyakutsuki
J'ai un prob, je viens d'installer la V2.3 et dans product.info, j'ai ces lignes d'erreur que j'ai commenté en attendant de corriger.

QUOTE
Fatal error: Call to undefined function: tep_get_products_special_status_flash_selling() in /***/catalog/templates/content/product_info.tpl.php on line 253

QUOTE
Fatal error: Call to undefined function: tep_get_products_special_status_fflash_selling() in /***/catalog/templates/content/product_info.tpl.php on line 254


ca correspond à ces ligne là :
QUOTE
$status_flash_selling = tep_get_products_special_status_flash_selling($product_info['products_id']);
    $status_special = tep_get_products_special_status_flash($product_info['products_id']);


De plus le bouton clignotant ne s'affiche pas , ou faut-il le ranger car je l'ai mis ou il fallait d'après les fichiers.
Merci
Wen

Écrit par : Gyakutsuki 9 Apr 2005, 14:54

Désolé pour la 2.3 je ne serais te répondre, il faut voir côté des cealodiens.

status_fflash_selling == c'est pas ca status_flash_selling ???

regarde si tu n'as pas une erreur à ce niveau

Écrit par : piapia 9 Apr 2005, 21:56

QUOTE (Gyakutsuki @ 07 avr 2005, 17:39)
Quelle version as tu ?
La dernière version marche correctement au niveau de l'affichage, je n'ai pas noté de pb, mais suite à ta demande et vérification, il y a bien un petit bug concernant le prix inséré dans le panier.


J'ai la version 2.2.
Le problème d'affichage que j'ai noté apparait que très rarement et je ne suis pas sur de savoir le reproduire...
Je vais essayer d'expliquer comment j'ai fait : comme lors d'une vente flash, le prix affiché dans le panier n'était pas le bon, j'ai modifié le prix du produit concerné donc le prix fash était le même que le prix initial.
Ensuite, quand j'ai compris que la remise était bien effectuée quand le status promotion et le status vente flash étaient actifs, j'ai remis le prix de mon produit à sa valeur initiale et c'est là que j'ai eu le pb d'affichage.
Ensuite lorsque la vente flash fut terminée et que j'en ai fait une autre sur un nouveau produit, je n'ai plus eu de pb d'affichage.
J'espère avoir été clair... wink.gif
Je crois que c'est vraiment un cas particulier et rare.

Par contre, le pb de prix dans le panier est plus gênant. Pour l'instant, je reste sur ma solution d'activer promotion et vente flash (j'ai masqué l'affichage de la promotion pour avoir que la vente flash sur la page d'accueil) qui me semble marcher à 100%. Mais je reste à l'écoute de l'évolution de la contribution.

Bon courage.

Écrit par : Gyakutsuki 9 Apr 2005, 22:02

Une 2.3 est sortie et résoud ces pbs cf oscommerce.com
Attention, un nouveau champs est à mettre dans la BD

En attendant une 2.4 voici quelques autres modifications intervenant dans les boxes.

boxes/specials.php

CODE
// #################### Added Flash Selling ###############
//  if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
 if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and (s.status_flash_selling = '0' or now()> flash_selling_end_date) order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
// #################### End Added Flash Selling ###############


Dans what_new.php

rajouter ceci a près la ligne 20 :
CODE
// ############### Added Flash Selling ############    
   $random_product['specials_price_flash_selling'] = tep_get_products_special_price_flash_selling($random_product['products_id']);
// ############### End added flash selling ##########

puis remplacer ceci :

CODE
if (tep_not_null($random_product['specials_new_products_price'])) {
     $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
     $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
   } else {
     $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
   }


par

CODE
// ############### Added Flash Selling ############
   if (tep_not_null($random_product['specials_price_flash_selling'])) {
    $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
     $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_price_flash_selling'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
// ############### End Added Flash Selling ############
   }elseif (tep_not_null($random_product['specials_new_products_price'])) {
     $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
     $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
   } else {
     $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
   }


Mais il y a encore de quoi faire !

Écrit par : Gyakutsuki 13 Apr 2005, 21:48

Une 2.4 beta est disponible sur oscommerce.com
j'ai encore un pt problème à résoudre dans module/new_products.php
Su ce fichier l'automatisation n'est pas encore incluse. (donc à faire manuellement)

Écrit par : Gyakutsuki 19 Apr 2005, 05:01

Une version 2.5 beta vient d'être sortie.

Écrit par : carlos101 20 Apr 2005, 21:11

Je viens de passer 2 heures sur l'instal de la contrib et je bloque sur

shopping_cart.php

J'ai installé ccgv_5_11 et lorsque je met à jour avec flash_discount_v2.5
les articles de mon panier sous tous au meme prix celui de la vente flash.

et

J ai ce message :

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/web/users/cheval-shop/www/test/catalog/includes/functions/database.php on line 99

Sous l affichage des sous catégories ou il devrais s'afficher le nouveauté du mois.

Écrit par : Gyakutsuki 21 Apr 2005, 03:30

peut être y a t'il un conflit avec ta contrib . Je vais regardé de mon côté sur une version de base.


Écrit par : carlos101 21 Apr 2005, 08:56

Merci,

Car la contribution flash est vraiment très bien faite et correspond vraiment au besoin de nouveautés sur un site pour etoffé les offres lors de newsletters.

Écrit par : Gyakutsuki 21 Apr 2005, 19:57

CCGv n'est pas en cause, il y a bien une erreur qui n'a été vue, cette erreur se situe dans le fichier modules/products_new.php. Je vais regarder ca pour résoudre le pb. Mon temps étant limité, cela risque de prendre un peu de temps alors si il y a des bonnes âmes, elles seraient les bienvenues.


Rajouter ces lignes à la fin includes/functions/specials.php si cela n'a pas été fait

CODE

// ################## flash selling ####################
////
// Sets the status of a special product
 function tep_set_specials_status_flash_selling($specials_id, $status_flash_selling) {
   return tep_db_query("update " . TABLE_SPECIALS . " set status_flash_selling = '" . $status_flash_selling . "', date_status_change_flash_selling = now() where specials_id = '" . (int)$specials_id . "'");
 }

////
[CODE]
// Auto expire products on special
 function tep_expire_specials_flash_selling() {
   $specials_query = tep_db_query("select specials_id from " . TABLE_SPECIALS . " where status_flash_selling = '1' and now() >= flash_selling_end_date and flash_selling_begnning_date > 0");
   if (tep_db_num_rows($specials_query)) {
     while ($specials = tep_db_fetch_array($specials_query)) {
       tep_set_specials_status($specials['specials_id'], '0');
     }
   }
 }


En attendant, un 2.6 a été faite pour résoudre ce pb.

Écrit par : Gyakutsuki 26 Apr 2005, 20:43

Correction de quelques bugs identifiés
Correction du fichier products_new.php
Code plus claire dans l'ntégration.

la version 2.7 est disponible sur oscommerce.com

Écrit par : Mousticks 26 Apr 2005, 23:55

je n'ai pas encore testé cette contrib car encore du taff pour terminé ce que j'ai en cours lool mais je tenais a remercier son dev car c clair que je vais l'adopter des que possible !!! donc un grand merci d'avance ! biggrin.gif

Écrit par : carlos101 30 Apr 2005, 11:59

Bonjour,
Je viens de reinstaller la contri en version 2.7 mais j ai deux bug:

1 dans le panier lorsque je mets un produits après un produit een vente flash le prix du nouveaux produits et le même que celui de la vente flash.

2 J ai ce message :
Fatal error: Call to undefined function: count_contents_virtual() in home/.../catalog/checkout_payment.php on line 80

lorsque je passes de checkout_shipping vers checkout_payment.

Carlos

Écrit par : Gyakutsuki 30 Apr 2005, 15:42

Salut,

il y a bien un bug dans le panier. la boxe shopping_cart et le total du paniel sont à priori correcte.
Seul le détail des prix semble poser un pt pb. Cela se répercute au niveau du checkout_confirmation.
je me suis centré essentiellement sur l'appartion du flash et je n'avais aps remarqué ceci, je vais faire une rectification.

pour ton 2ème pb, je pense soit tu as fais un erreur soit tu as mal installé une contrib mais chez moi la prise decommande se passe parfaitement sur une ms2 de base.


Écrit par : carlos101 30 Apr 2005, 18:46

J ai trouvé la reponse pour le deuxieme probleme j'avais transferé entirement la version de shopping-car.php de classes sans remerttre la partie script de ccgv5

le total du panier dans shopping_cart.php et en effet bon, par contre lorsque j arrive à checkout_confirmation.php le total est celui des mauvais prix.

Écrit par : Gyakutsuki 30 Apr 2005, 20:42

Oui c'est vrai et c'est fait normal, il faut résoudre le problème de l'affichage du contenu du panier puis la procédure de commande suivra son court par la suite.

Écrit par : lordbdp 4 May 2005, 02:26

Bonjour,

Je suis d'accord avec gazgull, car on peut avoir un produit (avec un prix normal, ou promo selon chacun) qu'on souhaite booster en vente (avec un prix flash). Quelle(s) seraient les modifs à faire pour revenir automatiquement au prix (normal ou promo) une fois la vente flash finie ? stp !

Écrit par : Gyakutsuki 4 May 2005, 03:06

Tout cela est géré automatiquement. Dès qu'une vente flash est finie, le prix peut revenir au prix promo si celui ci est supérieur à la fin de la vente flash sinon cela revient au prix normal.

Désolé pour ce laps de temps pour la crorrection du pb mais j'ai vraiment pas le temps en ce moment de m'y pencher, il faudra patienter un peu.

Écrit par : lordbdp 4 May 2005, 03:19

T'inquiète pas, on sait être patient quand cela vaut le coup ! wink.gif
Et comme on sait pas comment les faire les contribs (on est de vrais débutants)... blush.gif

Écrit par : d.capitaine 5 May 2005, 17:52

bonsoir, débutant dans l'utilisation de OScommerce, je viens d'essayer la contrib (v2.7). J'utilise MSFR2 de base.
Je rentre comme promo la hp laser 1100 xi à 499.99
Je fais une promo à 399
puis une vente flash à 300
Je valide tout cela et dans la zone de droite j'ai bien ces renseignements.
Je retourne sur catalogue en ligne et je vois dans la zone VENTE FLASH à gauche
La HP à 358.80 et 597.99 barré !!!!!!!!!!!!!!!!!!
Un bug ou une mauvaise manip (surement).
merci

Écrit par : fissiaux 5 May 2005, 17:59



300 = prix HT

358.8 = prix TTC

Écrit par : mesly 12 May 2005, 17:06

Bonsoir,
Bon ben moi j'ai un problème avec cette contribution et je n'ai pas trouvé de solution nulle part sur la faq ou dans le forum.
Dès que j'installe cette contrib voilà le message qui m'arrive dès que je tente d'aller sur l'admin :

QUOTE
Fatal error: Call to undefined function: tep_admin_check_login() in /www/admin/includes/application_top.php on line 213


Alors qui peut me dire avec la creload 6 quelle version de cette contribution fonctionne ?
j'ai essaye la version 2.7, puis 2.5 sans succès toujours le même message.

Puisque j'ai lu que certains l'utilisent avec la creload6 j'aimerai bien comprendre pourquoi ca marche pas chez moi.
Merci de m'aider à y voir plus clair
j'essaye depuis ce matin 8 h

Écrit par : fissiaux 12 May 2005, 20:10



La focntion tep_admin_check_login est une fonction amenée par la contribution Admin Access Level, installée en standard sur la version 6 de la creload.

Par contre, cette contribution est faite pour protéger l'admin, docn elle est isntallée dans l'admin, et donc cette fonction se trouve être dans le fichier catalog/admin/includes/functions/general.php . Vérifie.

Écrit par : mesly 12 May 2005, 20:32

Si je comprend bien, cette fonction disparait du general.php ? en tout cas une fois que j'installe la contribution ?

Écrit par : fissiaux 12 May 2005, 20:50



Si par installation de la contribution, tu entends prendre le fichier de la contribution et écraser celui que tu avais avant, oui cette fonction disparait.

Quand on installe une contribution, on travaille par delta, c'est à dire que l'on regarde les modifications apportées par la contribution et on les applique sur sa propre version, sinon, c'est la cata.

Écrit par : mesly 12 May 2005, 21:21

c'est en effet ce que j'ai fait. Mais bon j'ai tout réinstallé sans la contrib.
Pour ce qui est du general.php
j'ai imprimé les fichiers de discount et de creload6 pour les comparer.
discount = 1320 lignes (12/07/2003)
creload6 = 1548 lignes (18/09/2003)
ils ne sont pas du tout fait pareil alors comment et ou peut on trouver ce qui a ete ajouter pour que je puisse modifier ?

Écrit par : Gyakutsuki 12 May 2005, 21:53

Il existe un outil qui s'appelle beyond compare. Concernant ton pb, je ne vois pas ou il y aurait une incompatibilité avec admin access level, tu as du faire une erreur quelque part.
Sinon j'ai encore un pt pb à résoudre avec le flash et le shopping cart.

Écrit par : mesly 12 May 2005, 21:58

j'ai effectivement ecrasé les fichier de la creload par ceux de la contribution.
Je suis en train de les visionner ligne par ligne et celui de la creload me semble plus complet que la contrib.
sinon j'ai suivi pas à pas l'incorporation des fichier et je l'ai meme refait 3 fois avec le meme message qui réaparait.
mais dans le fichier de la contrib il n'y a pas les lignes du début juqu'à admin end

Écrit par : mesly 12 May 2005, 22:29

je viens de télécharger beyond compare, et en effet c'est pas mal pour comparer les fichiers.
donc si j'ai bien compris, avant de faire des betises, je dois ajouter dans les fichiers d'origine (creload6) ce que j'ai en plus dans ceux de la contrib ? mrgreen.gif

Écrit par : Gyakutsuki 12 May 2005, 22:41

Tu compare les fichiers un à un et tu fais attention quand tu ajoutes du code. Attention la creload diffère sur de nombreux points avec la ms2. Pour tout pb avec ca, il faudra t'adresser sur le forum des creloadiens.

a+

Écrit par : mesly 12 May 2005, 22:45

merci et bien je crois que c'est pas gagné pour ma part. Moi qui suis sur la creload5, pas de comparaison possible. Mes fonctionnalités de la creaload 6 me plaisent et surtout me sont indispensables ca je crois pas que le catalogue en pdf et le partenariat se trouvent sur la MS2 ? sinon je laisse tomber la creload pour la ms2

Écrit par : lordbdp 13 May 2005, 01:03

il est où le forum de la creloded 6, et où télécharger "beyond compare"? Je suis infichu de les trouver ! blink.gif

Tks

Écrit par : Maverick 13 May 2005, 06:44

Salut biggrin.gif

http://www.scootersoftware.com/

http://www.oscommerce-fr.info/forum/index.php?showforum=18

Une petite recherche sur Google pour le premier et sur le forum pour le 2ème....

wink.gif

Écrit par : mesly 14 May 2005, 14:08

Bonjour,
J'ai refais tout ca en faisant attention.
j'ai trouvé le petite bete dans les promotions.
Mais j'ai 2 fois le produit qui s'affiche dans la liste, je dois avoir un doublon dans un fichier là ? ou je me trompe ?

Bon pour le test ca va pas tarder (en principe à s'activer) ...... a suivre

Niet la promo s'affiche mais pas la vente flash. rien ne s'active.

Ensuite :

QUOTE

A propos je suis sous creload 6 et ça marche bien.
Pour installer la boxe il faut pas faire l'include dans Colum left, il faut passer par l'admin et la gestion des infobox en ayant mis d'abord boxe/flash_selling.php dans le répertoire des boxes de son template, et pour productinfo.php, il faut modifier productinfo.tpl.php

Wen y pourrait passer le dossier complet ? ce serait sympas pour tous sur la creload 6 surtout si tout fonctionne

Écrit par : Gyakutsuki 14 May 2005, 20:13

En attendant une future version béta, veuillez trouver ci dessous la résolution du problème du shopping cart.

Dans catalog/includes/classes remplacer le fichier par celui-ci.


CODE

<?php
/*
 $Id: shopping_cart.php,v 1.35 2003/06/25 21:14:33 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class shoppingCart {
   var $contents, $total, $weight, $cartID, $content_type;

   function shoppingCart() {
     $this->reset();
   }

   function restore_contents() {
     global $customer_id;

     if (!tep_session_is_registered('customer_id')) return false;

// insert current cart contents in database
     if (is_array($this->contents)) {
       reset($this->contents);
       while (list($products_id, ) = each($this->contents)) {
         $qty = $this->contents[$products_id]['qty'];
         $product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
         if (!tep_db_num_rows($product_query)) {
           tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')");
           if (isset($this->contents[$products_id]['attributes'])) {
             reset($this->contents[$products_id]['attributes']);
             while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
               tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");
             }
           }
         } else {
           tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $qty . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
         }
       }
     }

// reset per-session cart contents, but not the database contents
     $this->reset(false);

     $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
     while ($products = tep_db_fetch_array($products_query)) {
       $this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity']);
// attributes
       $attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");
       while ($attributes = tep_db_fetch_array($attributes_query)) {
         $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];
       }
     }

     $this->cleanup();
   }

   function reset($reset_database = false) {
     global $customer_id;

     $this->contents = array();
     $this->total = 0;
     $this->weight = 0;
     $this->content_type = false;

     if (tep_session_is_registered('customer_id') && ($reset_database == true)) {
       tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
       tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'");
     }

     unset($this->cartID);
     if (tep_session_is_registered('cartID')) tep_session_unregister('cartID');
   }

   function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {
     global $new_products_id_in_cart, $customer_id;

     $products_id = tep_get_uprid($products_id, $attributes);
     if ($notify == true) {
       $new_products_id_in_cart = $products_id;
       tep_session_register('new_products_id_in_cart');
     }

     if ($this->in_cart($products_id)) {
       $this->update_quantity($products_id, (int)$qty, $attributes); // BUG sur quantité de produit ajouté (int)
     } else {
       $this->contents[] = array($products_id);
       $this->contents[$products_id] = array('qty' => $qty);
// insert into database
       if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')");

       if (is_array($attributes)) {
         reset($attributes);
         while (list($option, $value) = each($attributes)) {
           $this->contents[$products_id]['attributes'][$option] = $value;
// insert into database
           if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");
         }
       }
     }
     $this->cleanup();

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
     $this->cartID = $this->generate_cart_id();
   }

   function update_quantity($products_id, $quantity = '', $attributes = '') {
     global $customer_id;

     if (empty($quantity)) return true; // nothing needs to be updated if theres no quantity, so we return true..

     $this->contents[$products_id] = array('qty' => $quantity);
// update database
     if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");

     if (is_array($attributes)) {
       reset($attributes);
       while (list($option, $value) = each($attributes)) {
         $this->contents[$products_id]['attributes'][$option] = $value;
// update database
         if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
       }
     }
   }

   function cleanup() {
     global $customer_id;

     reset($this->contents);
     while (list($key,) = each($this->contents)) {
       if ($this->contents[$key]['qty'] < 1) {
         unset($this->contents[$key]);
// remove from database
         if (tep_session_is_registered('customer_id')) {
           tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
           tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
         }
       }
     }
   }

   function count_contents() {  // get total number of items in cart
     $total_items = 0;
     if (is_array($this->contents)) {
       reset($this->contents);
       while (list($products_id, ) = each($this->contents)) {
         $total_items += $this->get_quantity($products_id);
       }
     }

     return $total_items;
   }

   function get_quantity($products_id) {
     if (isset($this->contents[$products_id])) {
       return $this->contents[$products_id]['qty'];
     } else {
       return 0;
     }
   }

   function in_cart($products_id) {
     if (isset($this->contents[$products_id])) {
       return true;
     } else {
       return false;
     }
   }

   function remove($products_id) {
     global $customer_id;

     unset($this->contents[$products_id]);
// remove from database
     if (tep_session_is_registered('customer_id')) {
       tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
       tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
     }

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
     $this->cartID = $this->generate_cart_id();
   }

   function remove_all() {
     $this->reset();
   }

   function get_product_id_list() {
     $product_id_list = '';
     if (is_array($this->contents)) {
       reset($this->contents);
       while (list($products_id, ) = each($this->contents)) {
         $product_id_list .= ', ' . $products_id;
       }
     }

     return substr($product_id_list, 2);
   }

   function calculate() {
     $this->total = 0;
     $this->weight = 0;
     if (!is_array($this->contents)) return 0;

     reset($this->contents);
     while (list($products_id, ) = each($this->contents)) {
       $qty = $this->contents[$products_id]['qty'];

// products price
       $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
       if ($product = tep_db_fetch_array($product_query)) {
         $prid = $product['products_id'];
         $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
         $products_price = $product['products_price'];

         $products_weight = $product['products_weight'];

// ###############" Start flash selling ###############

         $product_specials_query0 = tep_db_query("select status, status_flash_selling from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'  or status_flash_selling = '1' ");
    if (tep_db_num_rows ($product_specials_query0)) {
      $product_specials0 = tep_db_fetch_array($product_specials_query0);
     if (($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '0'))  {
       $product_specials_query = tep_db_query("select specials_new_products_price, status  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'  ");

      if (tep_db_num_rows ($product_specials_query)) {
       $product_specials = tep_db_fetch_array($product_specials_query);
       $products_price = $product_specials['specials_new_products_price'];
      }
     } elseif ($product_specials0['status_flash_selling'] == '1')  {
       $product_specials_query = tep_db_query("select specials_price_flash_selling, status_flash_selling  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status_flash_selling = '1' and flash_selling_end_date > now() ");

      if (tep_db_num_rows ($product_specials_query)) {
       $product_specials = tep_db_fetch_array($product_specials_query);
       $products_price = $product_specials['specials_price_flash_selling'];

   } else {

     $product_specials_query_product1 = tep_db_query("select specials_new_products_price, specials_price_flash_selling, status_flash_selling, flash_selling_end_date  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status_flash_selling = '1' and flash_selling_end_date < now() ");

    if (tep_db_num_rows ($product_specials_query_product1)) {
     $product_specials = tep_db_fetch_array($product_specials_query_product1);
     $products_price = $product_specials['specials_new_products_price'];
       }


      }
     }
    }
   
// ###############" End flash selling ###############
         $this->total += tep_add_tax($products_price, $products_tax) * $qty;
         $this->weight += ($qty * $products_weight);
       }

// attributes price
       if (isset($this->contents[$products_id]['attributes'])) {
         reset($this->contents[$products_id]['attributes']);
         while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
           $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
           $attribute_price = tep_db_fetch_array($attribute_price_query);
           if ($attribute_price['price_prefix'] == '+') {
             $this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
           } else {
             $this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
           }
         }
       }
     }
   }

   function attributes_price($products_id) {
     $attributes_price = 0;

     if (isset($this->contents[$products_id]['attributes'])) {
       reset($this->contents[$products_id]['attributes']);
       while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
         $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
         $attribute_price = tep_db_fetch_array($attribute_price_query);
         if ($attribute_price['price_prefix'] == '+') {
           $attributes_price += $attribute_price['options_values_price'];
         } else {
           $attributes_price -= $attribute_price['options_values_price'];
         }
       }
     }

     return $attributes_price;
   }

   function get_products() {
     global $languages_id;

     if (!is_array($this->contents)) return false;

     $products_array = array();
     reset($this->contents);
     while (list($products_id, ) = each($this->contents)) {
       $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

       if ($products = tep_db_fetch_array($products_query)) {

         $prid = $products['products_id'];
         $products_price = $products['products_price'];


// ############### Start flash sellling #############
//          if (tep_db_num_rows($specials_query0)) {
//           $specials = tep_db_fetch_array($specials_query0);


       $product_specials_product = tep_db_query("select specials_new_products_price, specials_price_flash_selling, status,  status_flash_selling  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1' or  status_flash_selling ='1' ");
   $product_specials_product = tep_db_fetch_array($product_specials_product);

   if (($product_specials_product['status'] == '1') && ($product_specials_product['status_flash_selling'] == '0'))  {
     $product_specials_query_product1 = tep_db_query("select specials_new_products_price, status  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'  ");

    if (tep_db_num_rows ($product_specials_query_product1)) {
     $product_specials = tep_db_fetch_array($product_specials_query_product1);
     $products_price = $product_specials['specials_new_products_price'];

    }
   } elseif ((($product_specials_product['status'] == '1') && ($product_specials_product['status_flash_selling'] == '1')) || (($product_specials_product['status'] == '0') && ($product_specials_product['status_flash_selling'] == '1'))) {
     $product_specials_query_product1 = tep_db_query("select specials_price_flash_selling, status_flash_selling, flash_selling_end_date  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status_flash_selling = '1' and flash_selling_end_date > now() ");

    if (tep_db_num_rows ($product_specials_query_product1)) {
     $product_specials = tep_db_fetch_array($product_specials_query_product1);
     $products_price = $product_specials['specials_price_flash_selling'];

   } else {

     $product_specials_query_product1 = tep_db_query("select specials_new_products_price, specials_price_flash_selling, status_flash_selling, flash_selling_end_date  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status_flash_selling = '1' and flash_selling_end_date < now() ");

    if (tep_db_num_rows ($product_specials_query_product1)) {
     $product_specials = tep_db_fetch_array($product_specials_query_product1);
     $products_price = $product_specials['specials_new_products_price'];
       }
      }
     }

//     }

// ############### End  flash sellling #############

         $products_array[] = array('id' => $products_id,
                                   'name' => $products['products_name'],
                                   'model' => $products['products_model'],
                                   'image' => $products['products_image'],
                                   'price' => $products_price,
                                   'quantity' => $this->contents[$products_id]['qty'],
                                   'weight' => $products['products_weight'],
                                   'final_price' => ($products_price + $this->attributes_price($products_id)),
                                   'tax_class_id' => $products['products_tax_class_id'],
                                   'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
       }
     }

     return $products_array;
   }

   function show_total() {
     $this->calculate();

     return $this->total;
   }

   function show_weight() {
     $this->calculate();

     return $this->weight;
   }

   function generate_cart_id($length = 5) {
     return tep_create_random_value($length, 'digits');
   }

   function get_content_type() {
     $this->content_type = false;

     if ( (DOWNLOAD_ENABLED == 'true') && ($this->count_contents() > 0) ) {
       reset($this->contents);
       while (list($products_id, ) = each($this->contents)) {
         if (isset($this->contents[$products_id]['attributes'])) {
           reset($this->contents[$products_id]['attributes']);
           while (list(, $value) = each($this->contents[$products_id]['attributes'])) {
             $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$products_id . "' and pa.options_values_id = '" . (int)$value . "' and pa.products_attributes_id = pad.products_attributes_id");
             $virtual_check = tep_db_fetch_array($virtual_check_query);

             if ($virtual_check['total'] > 0) {
               switch ($this->content_type) {
                 case 'physical':
                   $this->content_type = 'mixed';

                   return $this->content_type;
                   break;
                 default:
                   $this->content_type = 'virtual';
                   break;
               }
             } else {
               switch ($this->content_type) {
                 case 'virtual':
                   $this->content_type = 'mixed';

                   return $this->content_type;
                   break;
                 default:
                   $this->content_type = 'physical';
                   break;
               }
             }
           }
         } else {
           switch ($this->content_type) {
             case 'virtual':
               $this->content_type = 'mixed';

               return $this->content_type;
               break;
             default:
               $this->content_type = 'physical';
               break;
           }
         }
       }
     } else {
       $this->content_type = 'physical';
     }

     return $this->content_type;
   }

   function unserialize($broken) {
     for(reset($broken);$kv=each($broken);) {
       $key=$kv['key'];
       if (gettype($this->$key)!="user function")
       $this->$key=$kv['value'];
     }
   }

 }
?>

Écrit par : carlos101 14 May 2005, 21:35

Merci beaucoup pour ton boulot.
tous marche bien maintenant.

Seul problème mais qui n'a pas completement à voir avec la contribution c'est l 'apparition du message :
1064 - Erreur de syntaxe près de '-9, 9' à la ligne 1

select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and s.status = '1' order BY RAND() limit -9, 9

[TEP STOP]

sur l 'index quand aucune promo n'est en ligne.
je crois que c'est un problème mysql mais je ne sais comment le resoudre?

Écrit par : Gyakutsuki 14 May 2005, 23:32

Concernant le shopping_cart dans classes il faut modifier 2 petites requêtes :

vers la ligne 311 :

Mettre celle-ci à la place de l'autre

CODE

       $product_specials_product = tep_db_query("select specials_new_products_price, specials_price_flash_selling, status,  status_flash_selling  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "'  ");


vers la ligne 222 celle-ci

CODE

         $product_specials_query0 = tep_db_query("select status, status_flash_selling from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "'  ");


Pour ton pb faire ceci, ceci est pb sur osc dès qu'il n'y a plus de produit dans une colonne, c'est du à une volution de mysql, ca vaut pour tous les autre fichier qui ont des colonne comme special

dans admin/specials.php

chercher

CODE

   $specials_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $specials_query_raw, $specials_query_numrows);
   $specials_query = tep_db_query($specials_query_raw);


remplacer par

CODE

   $specials_query = tep_db_query($specials_query_raw);
   $specials_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $specials_query_raw, $specials_query_numrows);


Voilà pour le shopping_cart, un pt pb a été identifié, j'ai vu un autre pt bug sur les nouveautés, je vais regarder ca un peu plus tard.

a+

Écrit par : carlos101 15 May 2005, 07:47

Comment faire pour mettre sous l'affichage du module flah le même décompte que sur la fiche produits ex j= -3 h.

Merci.
J'ai trouvé une méthode pour afficher le pourcentage de remise de la vente Flash :

CODE

<?php
/*
 $Id: specials.php,v 1.31 2003/06/09 22:21:03 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() < s.flash_selling_end_date order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
?>
<!-- specials //-->
        <table width='450' border='1' cellspacing='0' cellpadding='0'>
   <tr bgcolor='dbf2df'>
           <td>
 
<?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_FLASH_SELLING);

   new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_FLASH_SELLING));
echo"<center><img src='http://www.cheval-shop.com/test/catalog/includes/languages/french/images/buttons/button_flash_selling.gif' width='137' height='21'></center>";
   $info_box_contents = array();

 //formule remise
 $remise=(1-($random_product['specials_price_flash_selling']/$random_product['products_price']))*100;
 //fin de la formule + fin de ligne 33
   $info_box_contents[] = array('align' => 'center',
                                'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_price_flash_selling'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span><br><font color=fff0000>Profitez d\'une remise de <br><font size=3><b>- '.round($remise,2).'</font><font color=fff0000 size=2> %</font><b>');

   new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- specials_eof //-->
<?php
 }
?>


Mais je n'arrive pas à insérer le decompte du temps.

Lorsque je programme une vente Flash pour le lendemain par exemple, elle est visible dans le module Flash discount dès sa création donc avant sa mise en service ( mais il n'y pas de message qui donne le délais du début de la vente flash sur la fiche produit cela peut mettre un doute au client).

Ce n'est surtout pas des critiques je suis trop content du travail que tu as fais c'est seulement pour faire avancer la contribution comme testeur biggrin.gif

Écrit par : Gyakutsuki 15 May 2005, 18:39

Tu trouveras l'exemple dans product info.php . L'idéal est de faire une fonction, pour l'instant j'ai laissé le code "brut " en attedant de terminer les nouveautés et product listing.

En résumé il faut prendre la date de la promotion et la date d 'aujourd'hui puis faire la différence.


Écrit par : badibad 18 May 2005, 10:31

bonjour tout le monde
j'essaye d'instaler flash sur crea 6 mais voilla sa m'a mis deux erreur
une sur ma page d'acceuil

Fatal error: main(): Failed opening required 'templates/TEMPLATENAME_BOX' (include_path='/var/www/free.fr/1/5/badibad/include:.') in /var/www/free.fr/1/5/badibad/includes/boxes/categories.php on line 142
est la deuxieme c'est quand j'assaye d'acceder a mon admin j'ai ce message suivant
Fatal error: Call to undefined function: tep_admin_check_login() in /var/www/free.fr/1/5/badibad/admin/includes/application_top.php on line 213

merci d'avance si vous pouvais m'aider

Écrit par : carlos101 18 May 2005, 19:21

p tit probleme, lorsque je mais en place une vente flash a l avance par exemple 1 jour avant son début. le prix de vente du produits est déjà au prix flsh lorsque je le met dans le panier.

Écrit par : Gyakutsuki 18 May 2005, 22:00

Je l'ai signalé plus haut, j'ai encore ce pt pb à rectifier sur l'affichage dans la page index.php des tarifs et product listing.

Pour ton cas, ben mea culpa, il y a pt pb. Comme quoi le dév de cette contrib n'est pas aussi simple que l'on peut le croire !

Écrit par : YANN06 20 May 2005, 00:47

salut Gyakutsuki

tout d'abord merci de partager ainsi ton travail.

voila, j'ai installé ta contrib, dans l'admin tout va bien mais dans la box je n'ai pas le temps restant affiché confused.gif
ni le gif clignotant que tu as rajouté

est-ce du au fait que je sois sous creload ou dois-je modifier le code??(là j'en ai pour 1 an au moins blush.gif )

enfin bref c'est la galère et j'aime beaucoup le principe de la vente flash rolleyes.gif


Écrit par : Gyakutsuki 20 May 2005, 01:55

Je ne peux m'avancer sur la creload. Je laisse le soin au creloadien de te répondre, une fois terminé surune ms2 et bugs corrigés, il sera plus facile de la porter sur la creload.

Écrit par : carlos101 20 May 2005, 08:39

As tu une idée sur mon problème de date sur le dèbut de la vente flash, pour le problème du prix qui repasse à zero après la date de vente il suffit d'appliquer 0% de remise sur le tarifs promotion, comme cela après la vente flash le produits reprends son tarifs normal ou celui de la promo si il y a une promo (même si un client rusé en a mis un exemplaire dans son panier et attend deux jours pour passer sa commande!, cela vient de m'arriver je n'avais pas mis de % dans le tarif promo résultat deux clients mon passés des produits à 0 € !! , bizarre ils n'avaient pas vu blink.gif !). Seul le problème du début de flash subsiste le prix du flash s'affiche avant la date.


Écrit par : Gyakutsuki 21 May 2005, 23:26

C'est un pb dans la condition je pense, je vais regarder ça.

Écrit par : vilain_mamuth 23 May 2005, 09:49

Salut,

peut on m'expliquer la difference de cette contrib par rapport à celle ci :

SaleMaker 2.2 MS2 v1.01
Author: IMarcel van Lieshout

qui est incluse dans creloaded6

a+

Écrit par : carlos101 2 Jun 2005, 08:10

Bonjour,
As tu pu regarder pour le début de la vente Flash.
Je n'arrive pas modifier le démarrage.


Écrit par : Gyakutsuki 3 Jun 2005, 02:39

Désolé j'ai peu de temps en ce moment, c'est pour cela que ca traîne

Écrit par : yopyop22 15 Jun 2005, 16:37

Bonjour,
premièrement super contrib sa va être très intéressent à utiliser

j'ai 1 problèmes , j'ai bien lut tout les échanges mais je n'ai pas vu la solution. J'en avais plus mais je les ai réglé avec les échanges dans ce message. Enfaite j'ai le même problème que carlos101

Si je place plus d'une vente flash à des dates différentes elles apparaissent tous dans l'espace vente flash. Il faudrait que sa soit seulement celle du jours qui soit la.

Carlos101 suggère de pouvoir montrer les promo futur sans pouvoir les acheter tout de suite au prix spécial, bien sur en mentionnant la date de disponibilité.

Mais coté visite sa serais mieux de faire paraître seulement celle du jour.

ex : Car si on leur montre les promo des 3 prochains jours ils ne reviendront pas avant 3 jours pour voir les prochaine et en les montrant pas ils vont revenir à tous les jours. Donc plus de change qu'ils voient les autres produits plus souvent et plus de chance de vendre autre chose que les produits qui sont en promotion

Moi je vend de la pub a certain fournisseur et plus j'ai de page vue mieux c'est ...

Écrit par : yopyop22 15 Jun 2005, 16:56

Bonjour,
désolé de vous avoir posé la question voila seulement quelques minutes. Mais je me considère pas bon en PHP et au lieux de tenter de trouver la solution je vous ai écris.

Je me suis enlevé les doigt de ou je pense -smile.gif) et j'ai trouvé le petit bobo

J'ai changé 2 pages

dans catalog/includes/boxes/flash_selling.php

J'ai changé la ligne 13

if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() < s.flash_selling_end_date order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {

Par

if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() > s.flash_selling_beginning_date and now() < s.flash_selling_end_date order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {


en faite j'ai ajouté
and now() > s.flash_selling_beginning_date

Et j'ai ajouté la même chose dans

catalog/flash_selling.php

à la ligne 58

$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() < s.flash_selling_end_date order by s.specials_date_added DESC";

je l'ai changé pour

$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() > s.flash_selling_beginning_date and now() < s.flash_selling_end_date order by s.specials_date_added DESC";


Sa semble bien fonctionner

J'ai ajouté plusieurs produit a différente date et tout roule. Il me reste a voir demain si le produit que j'ai placé pour demain va être bien la et pas un autre.

J'ai pensé que sa pourrait peut-être aider quelqu'un d'autre

Écrit par : Gyakutsuki 16 Jun 2005, 21:12

J'ai plus de temps pour continuer à développer cette contribution mais si quelqu'un souhaite prendre la relève et proposer les évolutions sur osc.com, c'est avec plaisir que j'essaierais de l'aider afin de la finaliser car les modfications touchent à beaucoup de fichiers sur osc et elles ne sont pas des moindre.

Écrit par : YANN06 29 Jun 2005, 16:41

Salut a tous biggrin.gif

trop content le yann biggrin.gif ça fonctionne bien sous creload(merci Gyakutsuki)

je mets les dates "a la main" (merci ryu pour le script)

mais voila........................

lorsque j'atteinds la date d'expiration , mon module(enfin le produit et du coup mon module est en vrac) degage de ma main_page
et ca me fout en l'air le design .

serait-il possible d'inclure une condition pour que lorsque la date de fin arrive ,
il y ait en lieu et place du produit, une image "vente flash terminée"

si vous avez une idée..............

car je parle le php autant que je ne comprends ma nana laugh.gif twisted.gif shock.gif

ps: un petit doute, sur la ms2 vous avez la date de debut de vente dans la box????
si oui il me faut verifier mon integration a la creload

Merci encore a vous tous

a plus

Écrit par : Fenris 17 Aug 2005, 10:20

Bonjour,

Je propose ici une simplification de code. Dans product_info.php (ou product_info.tpl.php pour les creload)

On peux remplacer cette partie de code :

QUOTE

    $special_flash_selling_end_date = tep_get_products_special_flash_selling_end_date($product_info['products_id']);
    $special_flash_selling_end_date1 = tep_get_products_special_flash_selling_end_date($product_info['products_id']);
   
    $jend_days = substr($special_flash_selling_end_date1,8,2); // le jour
    $jend_month = substr($special_flash_selling_end_date1,5,2); // puis le mois
    $jend_year = substr($special_flash_selling_end_date1,0,4); // et l\'annee
    $jend_hour = substr($special_flash_selling_end_date1,11,2); // et l\'heure
    $jend_minute = substr($special_flash_selling_end_date1,14,2); // et la minute
    $jend_second = substr($special_flash_selling_end_date1,17,2); // et la seconde
     
    $timestamp_end_flash_selling_date = mktime($jend_hour,$jend_minute,$jend_second,$jend_month,$jend_days,$jend_year);
   
    // Flash discount start Date
    $special_flash_selling_beginning_date = tep_get_products_special_flash_selling_beginning_date($product_info['products_id']);
    $special_flash_selling_beginning_date1 = tep_get_products_special_flash_selling_beginning_date($product_info['products_id']);
   
    $jbeginning_days = substr($special_flash_selling_beginning_date1,8,2); // le jour
    $jbeginning_month = substr($special_flash_selling_beginning_date1,5,2); // puis le mois
    $jbeginning_year = substr($special_flash_selling_beginning_date1,0,4); // et l\'annee
    $jbeginning_hour = substr($special_flash_selling_beginning_date1,11,2); // et l\'heure
    $jbeginning_minute = substr($special_flash_selling_beginning_date1,14,2); // et la minute
    $jbeginning_second = substr($special_flash_selling_beginning_date1,17,2); // et la seconde

    $timestamp_beginning_flash_selling_date  = mktime($jbeginning_hour,$jbeginning_minute,$jbeginning_second,$jbeginning_month,$jbeginning_days,$jbeginning_year);



Par ceci :

QUOTE

    // Flash discount end Date
    $special_flash_selling_end_date1 = tep_get_products_special_flash_selling_end_date($product_info['products_id']);
   
    $jend_days = (int)substr($special_flash_selling_end_date1,8,2); // le jour
    $jend_month = (int)substr($special_flash_selling_end_date1,5,2); // puis le mois
    $jend_year = (int)substr($special_flash_selling_end_date1,0,4); // et l\'annee
    $jend_hour = (int)substr($special_flash_selling_end_date1,11,2); // et l\'heure
    $jend_minute = (int)substr($special_flash_selling_end_date1,14,2); // et la minute
    $jend_second = (int)substr($special_flash_selling_end_date1,17,2); // et la seconde
     
    $timestamp_end_flash_selling_date = mktime($jend_hour,$jend_minute,$jend_second,$jend_month,$jend_days,$jend_year);
   
    // Flash discount start Date
    $timestamp_beginning_flash_selling_date  = strtotime(tep_get_products_special_flash_selling_beginning_date($product_info['products_id']));



Attention : La fonction strtotime() n'accepte que des date au format ANGLAIS.

En espérant que ça interessera/aidera quelqu'un.

Écrit par : Fenris 17 Aug 2005, 16:21

Re bonjour. Un compte à rebours Javascript qui décompte jusqu'à la date de fin de vente flash ça vous intéresse?

Alors dans products_info.php (products_info.tpl.php pour creload) rechercher ces lignes :

QUOTE

if (SHOW_HEADING_TITLE_ORIGINAL=='yes') {
$header_text = '&nbsp;';
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
            <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>



Et les remplacer par :
QUOTE

if (SHOW_HEADING_TITLE_ORIGINAL=='yes') {
$header_text = '&nbsp;';
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
            <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
          </tr>
<!--Modif by Fenris : ajout délai restant avant fin vente flash BOF-->
<script type="text/javascript">
function decompteur(jour,mois,annee,heure,minute,seconde) {
      Resultat = "";
      now = new Date();
      goal = new Date(annee,mois-1,jour,heure,minute,seconde);

      ts = Math.abs((now.getTime()/1000)-(goal.getTime()/1000));

        fjour = Math.floor(ts/(3600*24));
        if(fjour<=1) {
                Resultat = fjour + " jour ";
        } else {
                Resultat = fjour + " jours ";
        }

        ts = ts - (fjour*24*3600);
        fheure = Math.floor((ts/3600));
        if(fheure<10) {
                Resultat += " 0" + fheure + "h ";
        } else {
                Resultat += " " + fheure + "h ";
        }

        ts = ts - (fheure*3600);
        minutes = Math.floor((ts/60));
        if(minutes<10) {
                Resultat += "0" + minutes + "m ";
        } else {
                Resultat += minutes + "m ";
        }

        ts = ts - (minutes*60);
        fseconde = Math.floor(ts);
        if(fseconde<10) {
                Resultat += "0" + fseconde + "s"
        } else {
                Resultat += fseconde + "s"
        }

        return Resultat
}

function startX() {
  document.getElementById("ctp").innerHTML=decompteur(<?php echo $jend_days.','.$jend_month.','.$jend_year.','.$jend_hour.','.$jend_minute.','.$jend_second; ?>);
  setTimeout("startX()",1000);
}   

window.onload = startX;
</script>

<?php if (($status_flash_selling =='1')  && ($new_price > $new_price_flash_selling) && ($timestamp_end_flash_selling_date > $today) && ($timestamp_beginning_flash_selling_date < $today)){ ?>
          <tr>
            <td class="pageHeading" align="left"><br><?php echo tep_image(DIR_WS_IMAGES . 'button_flash_selling.gif', IMAGE_BUTTON_FLASH_SELLING); ?><br>Temps restant avant la fin : <span id= "ctp" type="text" disabled="disabled" class="smallText" size="28"></span></td>
          </tr>
<?php } ?>
<!--Modif by Fenris : ajout délai restant avant fin vente flash EOF-->
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>



Peut être une ou deux modifs à apporter, comme par exemple faire un refresh quand le compte arrive à zéro, ou la mise en page.

Je vais essayer de faire de même pour la page flash_selling.php

Bye

Écrit par : YANN06 18 Aug 2005, 14:02

biggrin.gif biggrin.gif MERCI FENRIS biggrin.gif biggrin.gif

ça marche nickel wink.gif

Écrit par : Fenris 18 Aug 2005, 14:18

Je t'en pris, c'est étudié pour.

J'ai effectué une légère modification : la page se recharge automatiquement à la fin du compte à rebours, faisant du même coup disparaître tout ce qui est en rapport avec la vente flash maintenant terminée :

QUOTE

<!--Modif by Fenris : ajout délai restant avant fin vente flash BOF-->
<?php if (($status_flash_selling =='1')  && ($new_price > $new_price_flash_selling) && ($timestamp_end_flash_selling_date > $today) && ($timestamp_beginning_flash_selling_date < $today)){ ?>
<script type="text/javascript">
function decompteur(jour,mois,annee,heure,minute,seconde) {
      Resultat = "";
      now = new Date();
      goal = new Date(annee,mois-1,jour,heure,minute,seconde);

      ts = Math.abs((now.getTime()/1000)-(goal.getTime()/1000));
 
  if((goal.getTime()/1000) < (now.getTime()/1000)){
      location.reload();
  }

 
        fjour = Math.floor(ts/(3600*24));
        if(fjour<=1) {
                Resultat = fjour + " jour ";
        } else {
                Resultat = fjour + " jours ";
        }

        ts = ts - (fjour*24*3600);
        fheure = Math.floor((ts/3600));
        if(fheure<10) {
                Resultat += " 0" + fheure + "h ";
        } else {
                Resultat += " " + fheure + "h ";
        }

        ts = ts - (fheure*3600);
        minutes = Math.floor((ts/60));
        if(minutes<10) {
                Resultat += "0" + minutes + "m ";
        } else {
                Resultat += minutes + "m ";
        }

        ts = ts - (minutes*60);
        fseconde = Math.floor(ts);
        if(fseconde<10) {
                Resultat += "0" + fseconde + "s"
        } else {
                Resultat += fseconde + "s"
        }
  /*if (fjour == 0 && fheure == 0 && minutes == 0 && fseconde ==0) {
  location.reload();
  }*/
        return Resultat
}

function startX() {
  document.getElementById("ctp").innerHTML=decompteur(<?php echo $jend_days.','.$jend_month.','.$jend_year.','.$jend_hour.','.$jend_minute.','.$jend_second; ?>);
  setTimeout("startX()",1000);
}   

window.onload = startX;
</script>

          <tr>
            <td class="pageHeading" align="left"><br><?php echo tep_image(DIR_WS_IMAGES . 'button_flash_selling.gif', IMAGE_BUTTON_FLASH_SELLING); ?><br>Temps restant avant la fin : <span id= "ctp" type="text" disabled="disabled" class="smallText" size="28"></span></td>
          </tr>
<?php } ?>
<!--Modif by Fenris : ajout délai restant avant fin vente flash EOF-->


Ca consiste en fait simplement à déplacer la condition "if" au plus haut (afin d'éviter une erreur javascript) et à l'ajout d'un test pour recharger la page lors de la fin du décompte.

Je m'attaque désormais à la page "flash_selling.php" histoire de voir si ça peux fonctionner avec plusieurs objets en même temps. Je mettrais le code ici si j'y arrive.

Au revoir.

Écrit par : YANN06 18 Aug 2005, 14:57

pour product_info c'est top biggrin.gif


t'aurais pas une idée du même accabit pour le flash_selling dans mainpage_module(là j'rajoute la date à la main) et la box wink.gif


a plus

Écrit par : Fenris 18 Aug 2005, 15:06

C'est fait pour l'affichage du compte à rebours dans la box. Par contre ça fait déplacer la fonction "decompteur" dans le code de la box et non plus dans celui de product_info.tpl.php

Ceci parce que le code de la box est inclus avant celui de la page centrale. Je vais faire une batterie de tests voir si ça pose problème. Je poste déjà le code pour que vous fassiez vos propres tests de votre coté.

fichier product_info.php (product_info.tpl.php creload), code réduit à ça.

QUOTE

<!--Modif by Fenris : ajout délai restant avant fin vente flash BOF-->
<?php if (($status_flash_selling =='1')  && ($new_price > $new_price_flash_selling) && ($timestamp_end_flash_selling_date > $today) && ($timestamp_beginning_flash_selling_date < $today)){ ?>
<script type="text/javascript">

function startX() {
  document.getElementById("ctp").innerHTML=decompteur(<?php echo $jend_days.','.$jend_month.','.$jend_year.','.$jend_hour.','.$jend_minute.','.$jend_second; ?>);
  document.getElementById("ctpbox").innerHTML=decompteur(<?php echo $jend_days_box.','.$jend_month_box.','.$jend_year_box.','.$jend_hour_box.','.$jend_minute_box.','.$jend_second_box; ?>);
  setTimeout("startX()",1000);
}   

window.onload = startX;
</script>

          <tr>
            <td class="pageHeading" align="left"><br><?php echo tep_image(DIR_WS_IMAGES . 'button_flash_selling.gif', IMAGE_BUTTON_FLASH_SELLING); ?><br>Temps restant avant la fin : <span id= "ctp" type="text" class="smallText" size="28"></span></td>
          </tr>
<?php } ?>
<!--Modif by Fenris : ajout délai restant avant fin vente flash EOF-->


Pour le fichier catalog/includes/boxes/flash_selling.php (catalog/templates/nom_theme/boxes/flash_selling.php creload)

Remplacer :
QUOTE

if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() > s.flash_selling_beginning_date and now() < s.flash_selling_end_date order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {?>
<!-- specials //-->
          <tr>
            <td>
<?php
    $info_box_contents = array();
    $info_box_contents[] = array('text' => BOX_HEADING_FLASH_SELLING);

    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_FLASH_SELLING));

    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'center',
                                'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_price_flash_selling'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>');

    new infoBox($info_box_contents);


par :
QUOTE

if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() > s.flash_selling_beginning_date and now() < s.flash_selling_end_date order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {

//::::::::::::::::::::::::::: Modif by Fenris : ajout délai restant avant fin vente flash EOF :::::::::::::::::::::::::
// Flash discount end Date
$special_flash_selling_end_date = tep_get_products_special_flash_selling_end_date($random_product['products_id']);

$jend_days_box = (int)substr($special_flash_selling_end_date,8,2); // le jour
$jend_month_box = (int)substr($special_flash_selling_end_date,5,2); // puis le mois
$jend_year_box = (int)substr($special_flash_selling_end_date,0,4); // et l\'annee
$jend_hour_box = (int)substr($special_flash_selling_end_date,11,2); // et l\'heure
$jend_minute_box = (int)substr($special_flash_selling_end_date,14,2); // et la minute
$jend_second_box = (int)substr($special_flash_selling_end_date,17,2); // et la seconde
?>

<!-- flash_selling //-->

<script type="text/javascript">
function decompteur(jour,mois,annee,heure,minute,seconde) {
      Resultat = "";
      now = new Date();
      goal = new Date(annee,mois-1,jour,heure,minute,seconde);

      ts = Math.abs((now.getTime()/1000)-(goal.getTime()/1000));

  if((goal.getTime()/1000) < (now.getTime()/1000)){
      location.reload();
  }
   
        fjour = Math.floor(ts/(3600*24));
        if(fjour<=1) {
                Resultat = fjour + " jour ";
        } else {
                Resultat = fjour + " jours ";
        }

        ts = ts - (fjour*24*3600);
        fheure = Math.floor((ts/3600));
        if(fheure<10) {
                Resultat += " 0" + fheure + "h ";
        } else {
                Resultat += " " + fheure + "h ";
        }

        ts = ts - (fheure*3600);
        minutes = Math.floor((ts/60));
        if(minutes<10) {
                Resultat += "0" + minutes + "m ";
        } else {
                Resultat += minutes + "m ";
        }

        ts = ts - (minutes*60);
        fseconde = Math.floor(ts);
        if(fseconde<10) {
                Resultat += "0" + fseconde + "s"
        } else {
                Resultat += fseconde + "s"
        }
        return Resultat
}

function startXbox() {
  document.getElementById("ctpbox").innerHTML=decompteur(<?php echo $jend_days_box.','.$jend_month_box.','.$jend_year_box.','.$jend_hour_box.','.$jend_minute_box.','.$jend_second_box; ?>);
  setTimeout("startXbox()",1000);
}   

window.onload = startXbox;
</script>
          <tr>
            <td>
<?php
    $info_box_contents = array();
    $info_box_contents[] = array('text' => BOX_HEADING_FLASH_SELLING);

    new infoBoxHeading($info_box_contents, false, infoBoxHeadingShoppingCartBoxe, false, false, box_flash_selling2, tep_href_link(FILENAME_FLASH_SELLING, '', 'NONSSL'));

    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'center',
                                'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_price_flash_selling'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span><br><span id= "ctpbox" type="text" class="smallText" size="28"></span>');
//::::::::::::::::::::::::::: Modif by Fenris : ajout délai restant avant fin vente flash EOF :::::::::::::::::::::::::
    new infoBox($info_box_contents, infoBoxContentsShoppingCartBoxe, infoBoxShoppingCartBoxe);


Le code de la box change légèrement entre versionde base et version creload (comme les appels newinfoBox), mais globalment devriez vous y retrouver.

Je le répète : version en cours de test. Backup is your life.

Écrit par : YANN06 29 Aug 2005, 17:18

salut fenris wink.gif


petit souci ..... blush.gif

QUOTE
ça fait déplacer la fonction "decompteur" dans le code de la box et non plus dans celui de product_info.tpl.php. Ceci parce que le code de la box est inclus avant celui de la page centrale.


effectivement.J'ai placé le script dans mon header en éspèrant que ça débourre ce problème mais NADA....

de plus, dans mon product _info, j'ai placé un module de scrolling des produits de la même categorie et là, pouffffff!!!!! plus de date

conflit de javascript...
et ce même dans mon accueil lorsque la box flash_selling est là.

au cas ou voilci le code du scrolling_products:

<?php
if ( DISPLAY_SCROLLING_HEADER_PRODUCTS > 0 ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle"><script type="text/javascript">
//Specify the slider's width (in pixels)
var sliderwidth="380";
//Specify the slider's height
var sliderheight="150";
//Specify the slider's slide speed (larger is faster 1-10)
var slidespeed=2;
//configure background color:
slidebgcolor="#ffffff";

//Specify the slider's images
var leftrightslide=new Array();
var finalslide='';
<?php
$union = array();
$union[] = "SELECT p2c.products_id FROM ".TABLE_PRODUCTS_TO_CATEGORIES." p2c WHERE p2c.categories_id='".$current_category_id."'";
# Get the subcategory ID's
# $sub_cats parameter will be populated with subcategory ID's
tep_get_subcategories($sub_cats, $current_category_id);
# Loop the $sub_cats array and start compiling the UNION query
if (!empty($sub_cats)) {
foreach ($sub_cats as $index => $cat_id){
$union[] = "SELECT p2c.products_id FROM ".TABLE_PRODUCTS_TO_CATEGORIES." p2c WHERE p2c.categories_id='".$cat_id."'";
}
}
# implode the UNION query to get the final string
$union_str = implode(" UNION ", $union) . " ORDER BY products_id desc";
# unset some stuff...clean as we go
unset($sub_cats, $union);
# execute the query
$products_id_query = tep_db_query($union_str);
# Loop the array and populate the $prod_array with product ID's
while($prods = tep_db_fetch_array($products_id_query)){
$prod_array[] = $prods['products_id'];
}
# free the result...clean as we go
tep_db_free_result($products_id_query);
$header_products_query = tep_db_query("select p.products_id, p.products_image, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id in ('" . implode("', '", $prod_array) . "') and p.products_id = pd.products_id order by rand() limit " . DISPLAY_SCROLLING_HEADER_PRODUCTS);
$x = 0;
$height = SMALL_IMAGE_HEIGHT;
$totalwidth = 0;
while ( $header_products = tep_db_fetch_array($header_products_query) ) {
$width = SMALL_IMAGE_WIDTH;
// Get the image's information:
if ($image_size = @getimagesize(DIR_WS_IMAGES . $header_products['products_image'])) {
$ratio = $image_size[1] / $image_size[0];

// Scale the image if larger than the set width or height:
if ($image_size[0] > $width || $image_size[1] > $height) {
$rx = $image_size[0] / $width;
$ry = $image_size[1] / $height;

if ($rx < $ry) {
$width = intval($height / $ratio);
}
}

$totalwidth += $width;
}

$alt = str_replace("'","\'",$header_products['products_name']);
echo ' leftrightslide[' . $x++ . ']=\'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $header_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $header_products['products_image'], $alt, $width, $height, ' valign="middle"') . '</a>\';' . "\n";
}
?>
if (sliderwidth > <?php echo $totalwidth; ?>)
sliderwidth = <?php echo $totalwidth; ?>;
//Specify gap between each image (use HTML)
var imagegap="&nbsp;";
//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=0;
var copyspeed=slidespeed;
leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>';
var iedom=document.all||document.getElementById;
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>');
var actualwidth='';
var cross_slide, ns_slide;

function fillup() {
if (iedom) {
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2;
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3;
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide;
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth;
cross_slide2.style.left=actualwidth+slideshowgap+"px";
} else if (document.layers) {
ns_slide=document.ns_slidemenu.document.ns_slidemenu2;
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3;
ns_slide.document.write(leftrightslide);
ns_slide.document.close();
actualwidth=ns_slide.document.width;
ns_slide2.left=actualwidth+slideshowgap;
ns_slide2.document.write(leftrightslide);
ns_slide2.document.close();
}
lefttime=setInterval("slideleft()",30);
}
window.onload=fillup;

function slideleft() {
if (iedom) {
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+cool.gif)
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px";
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px";

if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+cool.gif)
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px";
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px";
} else if (document.layers) {
if (ns_slide.left>(actualwidth*(-1)+cool.gif)
ns_slide.left-=copyspeed;
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap;

if (ns_slide2.left>(actualwidth*(-1)+cool.gif)
ns_slide2.left-=copyspeed;
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap;
}
}

if (iedom||document.layers) {
with (document) {
write('<table border="0" cellspacing="0" cellpadding="0"><td>');
if (iedom) {
write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">');
write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">');
write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>');
write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>');
write('</div></div>');
} else if (document.layers) {
write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>');
write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>');
write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>');
write('</ilayer>');
}
document.write('</td></table>');
}
}
</script></td></center>
</tr>
</table>
<?php
}
?>
</td>
</tr>


p... d'ou vient ce conflit.

HELP!!!! blush.gif

Écrit par : YANN06 29 Aug 2005, 18:01

pour le product_info.tpl, j'ai "resolu" le souci avec un:

if ($status_flash_selling =='1'){ echo tep_draw_separator('pixel_trans.gif', '100%', '1');

} else {


mais dans mon index j'ai besoin de garder le srolling avec le module ou la box flash-selling.

je râme dur blush.gif

Écrit par : philou83 6 Sep 2005, 13:35

Bonjour,
Je viens d'installer cette contribution sur mon site de dev. Je n'ai pas eu de problème d'installation et je commence à faire des tests, en particulier je regarde si les bugs évoqués dans le forum sont résolus. Je suis surpris de voir, que depuis plusieurs mois, plus personnes ne communique sur cette contribution, celà veut-il dire que tout est OK ou au contraire qu'il y a un problème majeur difficile à résoudre.
Ce serait dommage car je pense que cette contribution est vraiment utile.

Écrit par : philou83 8 Sep 2005, 14:02

Au cas où ça intéresse quelqu'un j'ai ajouté la date de début de la vente flash dans la boxe. modification à apporter à includes/boxes/flash_selling.php :

Ajouter dans le select ligne 13 : flash_selling_beginning_date

// mise en forme date
list($date, $time) = explode(" ", $random_product["flash_selling_beginning_date"]);
list($annee, $mois, $jour) = explode("-", $date);
list($heure, $minute, $seconde) = explode(":", $time);
$months = array("janvier", "février", "mars", "avril", "mai", "juin",
"juillet", "août", "septembre", "octobre", "novembre", "décembre");
$mois = $months[$mois-1];

modifier l'affichage :
$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
'text' => BOX_FLASH_SELLING . '<br>' . $jour . ' ' . $mois . ' &agrave; ' . $heure . 'h'. $minute . '<br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_price_flash_selling'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>');

Écrit par : Fenris 11 Sep 2005, 09:38

YANN06 : Je crois que je vois le soucis.

Pour que l'affichage du compte à rebour soit dynamique (encoreheureux hein?) il y a un appel à une fonction qui est fait toutes les secondes, cette fonction met à jour chacun des comptes à rebours.

C'est cette sectionde code :

QUOTE

function startX(){
    document.getElement blablabla
  setTimeout("startX()",1000);
}

window.onload = startX


Tu vois qu'au chargement de la page, la fonction startX() est executée, et que l'une de ses instructions, est de se relanceer au bout d'1 seconde (1000 millièmes en fait), après avoir lancer la fonction décompteur.

J'ai pas trop le temps de lire en détail le code que t'as fourni (désolé) mais je crois que l'équivalent de startX() et du setTimeout, c'est ça :

QUOTE

--ca c'est à la fin de fillup()--
lefttime=setInterval("slideleft()",30);
}
window.onload=fillup;


Je pense que ton soucis vient de ce que la fonction relancée à intervalles réguliers se retrouve être celle du scroll, l'autre, startX(), est remplacée. Donc plus de mise à jour de la date, donc plus d'affichage.

La solutionconsisterait à repérer la fonction équivalente au startX() pour ton scroll. Tu regarde quelle fonction elle lance toutes les secondes (dans le flash selling c'est compteur() )

Tu as alors le choix de garder startX() ou l'autre. Mais dans les deux cas va falloir faire une "fusion" : c'est à dire que, si tu garde startX(), elle devrat lancer ET la fonction compteur, ET celle du scroll.

Tout ça repose sur des hypothèses, j'en ai bien peur, mais ça parait se tenir. Le seu soucis majeur c'est si la fonction du scroll ne se fait pas toutes les secondes, comme le decompte. Mais t'en est pas encore là, je pense.

Par contre pour ton soucis de placement de fonction, j'ia pas tout saisi, mais j'avoue que j'avasi à l'époque pas pensé à la solutionla plus simple : placer la fonction decompteur() dans le fichier includes/javascript/general.js

(je l'ai pas fait emoi même, j'ai arreté mon stage avant, et ça fonctionnait très bien sans, mais ça peut résoudre ton soucis)

J'espère pas avoir été trop long ou trop brouillon... dry.gif

Écrit par : YANN06 12 Sep 2005, 14:36

biggrin.gif Salut fenris.

Merci pour tes lumières idea.gif et pour ta reponse qui n'est pas trop longue,au contraire(pour un neu² comme moi c'est juste ce qu'il faut wink.gif).

j'vais essayer de regarder ça ....... et dés que j'trouve je post...

Merci encore
A plus

Écrit par : Phocea 3 Oct 2005, 12:55

Je viens juste de tester cette contrib, car mon epouse voudrait faire des promos dans le genre d ici peu.

J ai releve un bug important (ou alors une erreur dans l install mais j ai bien verifie).
L'erreur apparait lorsqu une vente flash est perimee.
Le prix correct est affiche pour le produit, mais celui du shopping cart est faux. en fait il semblerait qu il y esteu une desynchronisation du code existant dans product_info pour trouver le prix a afficher et celui dans la classe shopping_cart

Pour fixer ca j ai mis dans shopping_cart.php le code suivant:

CODE

 $status_flash_selling = tep_get_products_special_status_flash_selling($prid);
 $status_special = tep_get_products_special_status_flash($prid);
 $special_flash_selling_end_date = tep_get_products_special_flash_selling_end_date($prid);
 $special_flash_selling_end_date1 = tep_get_products_special_flash_selling_end_date($prid);

   
 $jend_days = substr($special_flash_selling_end_date1,8,2); // le jour
 $jend_month = substr($special_flash_selling_end_date1,5,2); // puis le mois
 $jend_year = substr($special_flash_selling_end_date1,0,4); // et l\'annee
 $jend_hour = substr($special_flash_selling_end_date1,11,2); // et l\'heure
 $jend_minute = substr($special_flash_selling_end_date1,14,2); // et la minute
 $jend_second = substr($special_flash_selling_end_date1,17,2); // et la seconde
     
 $timestamp_end_flash_selling_date = mktime($jend_hour,$jend_minute,$jend_second,$jend_month,$jend_days,$jend_year);
   
 // Flash discount start Date
 $special_flash_selling_beginning_date = tep_get_products_special_flash_selling_beginning_date($prid);
 $special_flash_selling_beginning_date1 = tep_get_products_special_flash_selling_beginning_date($prid);
   
 $jbeginning_days = substr($special_flash_selling_beginning_date1,8,2); // le jour
 $jbeginning_month = substr($special_flash_selling_beginning_date1,5,2); // puis le mois
 $jbeginning_year = substr($special_flash_selling_beginning_date1,0,4); // et l\'annee
 $jbeginning_hour = substr($special_flash_selling_beginning_date1,11,2); // et l\'heure
 $jbeginning_minute = substr($special_flash_selling_beginning_date1,14,2); // et la minute
 $jbeginning_second = substr($special_flash_selling_beginning_date1,17,2); // et la seconde

 $timestamp_beginning_flash_selling_date  = mktime($jbeginning_hour,$jbeginning_minute,$jbeginning_second,$jbeginning_month,$jbeginning_days,$jbeginning_year);

 // Now
 $today =time();
     
// $special_expires_date  = tep_get_products_special_expires_date($prid);

 if ($status_flash_selling =='1'){
$new_price_flash_selling = tep_get_products_special_price_flash_selling($prid);
 } else {
$new_price_flash_selling = 0;
 }

 $new_price = tep_get_products_special_price($prid);

if (($status_special =='0') && ($status_flash_selling =='1') && ($timestamp_end_flash_selling_date > $today)  && ($timestamp_beginning_flash_selling_date < $today))  {
 $products_price = $new_price_flash_selling;
 } elseif (($status_special =='1') && ($status_flash_selling =='0')) {
$products_price = $new_price;
 } elseif(($status_special =='1') && ($status_flash_selling =='1')  && ($new_price > $new_price_flash_selling) && ($timestamp_end_flash_selling_date > $today) && ($timestamp_beginning_flash_selling_date < $today)) {
$products_price = $new_price_flash_selling;
 } elseif(($status_special =='1') && ($status_flash_selling =='1')  && ($timestamp_end_flash_selling_date < $today)) {
$products_price =  $new_price;
}


a la place de

CODE
         $product_specials_query0 = tep_db_query("select status, status_flash_selling from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'  or status_flash_selling = '1' ");
         if (tep_db_num_rows ($product_specials_query0)) {
           $product_specials0 = tep_db_fetch_array($product_specials_query0);

 if (($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '0'))  {
  $product_specials_query = tep_db_query("select specials_new_products_price, status  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'  ");
  if (tep_db_num_rows ($product_specials_query)) {
     $product_specials = tep_db_fetch_array($product_specials_query);
     $products_price = $product_specials['specials_new_products_price'];
  }
 } elseif ($product_specials0['status_flash_selling'] == '1')  {
  $product_specials_query = tep_db_query("select specials_price_flash_selling, status_flash_selling  from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status_flash_selling = '1'  ");
  if (tep_db_num_rows ($product_specials_query)) {
     $product_specials = tep_db_fetch_array($product_specials_query);
     $products_price = $product_specials['specials_price_flash_selling'];
  }
 }
   }


Si quelqu un pouvait confirmer l erreur et aussi tester (j ai essaye tout les cas de figure mais on sait jamais !)

Tout ca meriterai de se retrouverer dans une belle fonction a part ....

Écrit par : thematrixisme 3 Oct 2005, 13:28

QUOTE
précision juridique pour les Belges : Les ventes flash ne peuvent se faire que pendant 24h et 1 seule fois par semaine. Il est donc interdit de faire une vente flash entre 10h00 et 18h00... c'est nécessairement 1journée complète : Vendredi par exemple.

Faites-y attention.

Écrit par : Phocea 3 Oct 2005, 14:05

Bon ignorer mon message precedent (meme si cette solution marche).
J ai ensuite eux le meme probleme dans le listing produit etc .. j ai donc cherche un peu plus.

Le probleme est que la fonction qui se charge "d'auto" desactiver les flash discount (de la meme maniere que les promo sont desactive), n est pas utilise.

Alors il faut rajouter dans application_top.php la ligne suivant:

CODE
 // Flash discount
tep_expire_specials_flash_selling();


Juste apres

CODE
// auto expire special products
 require(DIR_WS_FUNCTIONS . 'specials.php');
 tep_expire_specials();


Pour que ca marche il faudra aussi corriger la fonction tep_expire_specials_flash_selling() dans includes/functions/specials.php qui est fausse:

CODE
////
// Auto expire products on special
 function tep_expire_specials_flash_selling() {
   $specials_query = tep_db_query("select specials_id from " . TABLE_SPECIALS . " where status_flash_selling = '1' and now() >= flash_selling_end_date and flash_selling_beginning_date > 0");
   if (tep_db_num_rows($specials_query)) {
     while ($specials = tep_db_fetch_array($specials_query)) {
       tep_set_specials_status_flash_selling($specials['specials_id'], '0');
     }
   }
 }


Il y avait une erreur de frappe dans un nom de colonne, et la mauvaise fonction etait appele pour mettre a jour le status ...

Avec ca plus besoin du gros bordel dont je parlais avant (et je pense meme que product_info devrait pouvoir etre simplifier)

Écrit par : Phocea 4 Oct 2005, 09:04

Petite update dans les fonctions specials afin de regler le probleme des flash qui s affichent alors qu ils ne sont pas encore valide.

CODE
////
// Auto expire products on special
 function tep_expire_specials_flash_selling() {
   // disable flash discount that are out of the date range
   $specials_query = tep_db_query("select specials_id from " . TABLE_SPECIALS . " where status_flash_selling = '1' and ( now() >= flash_selling_end_date or now() < flash_selling_beginning_date )");
   if (tep_db_num_rows($specials_query)) {
     while ($specials = tep_db_fetch_array($specials_query)) {
       tep_set_specials_status_flash_selling($specials['specials_id'], '0');
     }
   }
   // disable flash discount that are out of the date range
   $specials_query = tep_db_query("select specials_id from " . TABLE_SPECIALS . " where status_flash_selling = '0' and ( now() < flash_selling_end_date and now() >= flash_selling_beginning_date )");
   if (tep_db_num_rows($specials_query)) {
     while ($specials = tep_db_fetch_array($specials_query)) {
       tep_set_specials_status_flash_selling($specials['specials_id'], '1');
     }
   }
 }


A chaque refresh la commande est appele et verifie le status des ventes flash dans la base .. selon si une vente doit etre active ou pas, elle met a jour sont statut.

Avec ce changement plus besoin de se prendre la tete dans les conditions pour verifier si une vente est en route ou pas ... si elle est inactive, c est qu elle est en dehors des dates.
ATTENTION: Avec cette methode, si vous mettez une vente a off manuellement mais ne changez pas les dates de validite, elle sera reactivez automatiquement

Écrit par : philou83 5 Oct 2005, 15:32

Bonjour,

Je voudrais que la fin de la vente flash désactive aussi la promo afin de revenir en prix normal.
Or il faut également pouvoir avoir des promotions hors vente flash, donc je voudrais pouvoir mettre le status promotion à 0 quand la vente flash s'arrête mais pouvoir faire une promotion alors que la vente flash est désactivé.
Ce que je voudrais gérer c'est le changement d'état de la vente flash.
Je me demande si c'est bien clair ce que je souhaite faire.
Pour l'instant j'ai pas trouvé

Écrit par : Phocea 6 Oct 2005, 10:46

Relis mes 2 derniers messages, c est exactement ce que mes changements font.

Les promos normal sont desactives auto quand elles arrivent en fin
Les promos flash sont actives auto que pendant leurs dates de validite.

Tu peux faire des ventes flash sans renseigner de nouveaux prix pour la promo , du coup a la fin de la vente flash ca reviens au prix vente normal.
PAreil tu peux faire des promo sans renseigner de details pour le flahs, ce qui te permet d avoir des promos toutes seules.

Par contre, faites attention car avant que tout marche en produciton j'au du changer pratiquement tout les fichiers de la contrib.
Les fonctions pour que ca fonctionne comme il faut existent pratioquement toutes mais ne sont pas appele dans l'etat de la derniere version du code. Je pense que Gyakutsuki n'a simplement pas eu le temps de nettoyer son code et remplacer tout les if imbriques en appel de fonction. Ce qui rend tout ca beaucoup plus simple a gere et debuger d ailleurs!!

Le plus gros bug se situe au niveau de la classe shopping cart. Ceci avait pour effet de changer le prix de tout les articles dans le panier, au moment de la confirmation (avant ca s affichait correctement). Le nouveaux prix etait celui de la premiere vente flash recupere par la query SQL !!!

Heureusement quand ca m est arrive c etait une collegue de bureau qui le faisaait et ca lui avait double le prix wink.gif

Si kkun veut les voir en action avec un code il est sur mon site h**p://www.eboutik.net just qu au 12 Octobre.

La semaine prochaine quand je reviens de week end je tacherai de ressortir toutes les modifs pour les remettre au propre.
J'ai integre le javascript sur la page product_info, et rajouter des info de fin statiques dans le listing produit.

Écrit par : philou83 6 Oct 2005, 12:45

J'avais effectivement ajouter les modifications dans specials.php mais ça ne marche pas quand même. C'est sans doute parceque je n'ai pas modifié le reste du code.
Quand la vente flash est arrêté je passe automatiquement en promotion.

Écrit par : Phocea 6 Oct 2005, 13:29

Quand tu ajoutes ton produit, ne donne pas de date de fin ou de prix pour la promo, rentre les donnees piur le flash.
ensuite sur la vu globale, clique sur l icone rouge pour la PROMO, pour qu elle soit bien a OFF.
Normalement, avant et apres la vente flash ca devrait repasser en mode normal

Écrit par : philou83 11 Oct 2005, 08:59

c'est résolu. J'ai rajouté des tests sur les dates d'expiration du flash et de la promo. Depuis ça marche bien. Par contre il faut que pour les ventes flash j'active également la promo,mais sans mettre de date.
C'est pas génant dans la mesure où on fait soit l'un soit l'autre.

Écrit par : Phocea 11 Oct 2005, 13:34

Apres une semaine de test tout marche comme il faut et le code est beaucoup plus simple.
Toute les conditions if imbriques testant si une promo est active, et si flash l est et si c est dans les dates sont devenus redondantes.

Il n'est plus non plus necessaire de modifier le fichier index.php

Si quelqu un a besoin de ca en urgence qu il me contacte, sinon j essaye de remettre ca au propre pour la fin de semaine.
La j ai 40 nouvelles descriptions d articles a traduire donc pas trop le temps !

Écrit par : .:[GeNiUs]:. 30 Dec 2005, 16:57

hello

Apres 6 tentative d'instal et moulte comparaison j'ai tjrs pas reussi a installer ce superbe addon

j'obtient tjrs cette erreur

QUOTE

1054 - Champ 's.date_status_change_flash_selling' inconnu dans field list
select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, flash_selling_beginning_date, flash_selling_end_date, specials_price_flash_selling, s.date_status_change, s.status, s.status_flash_selling, s.date_status_change_flash_selling from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = s.products_id order by pd.products_name limit 0, 6


dans la partie admin kan je click sur promotions.

mais des ke je remet mon ancien special.php plus ce probleme.

j'essaie de voir d'ou ca viens mais la je galere.

J'ai bien lu la FAQ et c 'est pas un probleme du "limit -20, 20" qui a deja ete patcher chez moi.

Voilou
merci

Écrit par : .:[GeNiUs]:. 30 Dec 2005, 17:08

bon en faite j'ai reussi a trouver une solution mais elle apporte un autre probleme

j'ai remis la table sql specials a zero avec le fichier sql fourni,la j'ai plus l'erreur mais des ke je veux inclure un produit c'est la que vient l'autre erreur

j'obtient ceci

QUOTE

1054 - Champ 'products_price_flash_selling' inconnu dans field list
select products_id, products_price_flash_selling from products where products_id = '283'
[TEP STOP]


je regarde car j'ai du oublie kkchose mais la meme avec beynd compare je trouve rien

Merci

Écrit par : isnogood 30 Dec 2005, 19:25


En regardant vite fait dans le specials.php de l'admin, effcetivement il y a bien l'ordre sql qui te génère l'erreur.

Bizare que personne ne soit jamais tombé dessus.

Écrit par : isnogood 2 Jan 2006, 20:38

La correction de l'erreur est dans ce post :

http://www.oscommerce-fr.info/forum/index.php?showtopic=28702

Loic, si tu nous écoutes, ..... biggrin.gif , tu pourras créer une 2.8 !

Écrit par : .:[GeNiUs]:. 4 Jan 2006, 00:18

j'ai trouvé aussi ce system de compte a rebours comme sur un grand site cd*******

CODE

<script language="javascript">
//////////////////////////////////////////////////////////////////////////////
//    Fonction horloges pour ventes flash (TV)      //
//////////////////////////////////////////////////////////////////////////////

   function formatageDate(chaine) {
    var resultat
     if (chaine<=9) {
      resultat="0"+chaine
    }
    else {
     resultat = chaine
    }
    return resultat;
   }

   function calculdiff(idclock,datedeb,datefin) {
    var T1=datedeb.split('-');
    var T2=datefin.split('-');

    var NewDateDeb = new Date('20' + T1[0] + '/' + T1[1] + '/' + T1[2] + ' ' + T1[3] + ':' + T1[4] + ':' + T1[5])
    var NewDateFin = new Date('20' + T2[0] + '/' + T2[1] + '/' + T2[2] + ' ' + T2[3] + ':' + T2[4] + ':' + T2[5])

    var Diff = Math.floor((NewDateFin - NewDateDeb)/1000)
   
    //Gestion du probl? de fin de mois dans le calcul de la date
    //if ((T1[1] == '05' && T2[1] == '06')||(T1[1] == '08' && T2[1] == '09')) {
    // Diff = Diff + 86400
    // }
    //if ((T1[1] == '06' && T2[1] == '07')||(T1[1] == '09' && T2[1] == '10')) {
    // Diff = Diff - 86400
    // }
     
    affReste(idclock,Diff);
   }

   function affReste(idclock,reste) {
    var texte = ''
    var id_clock = 'clock' + idclock
   
    //On garde le temps restant pour le timeout
    var sec_reste = reste - 1
   
    //On transforme les secondes en date j/hh/mm/sec
    var j
    var h
    var m
    var s
    var tps = reste - 1
   
     if (tps>3600) {
       h=Math.floor(tps/3600);
      tps=tps % 3600;
      }
      else {
       h=0;
      }

      if (tps>60) {
       m=Math.floor(tps/60);
       tps=tps % 60;
      }
      else {
       m=0;
      }

     s=Math.floor(tps);

    //On construit la chaine
   
    if (j>0) {
     texte = j + "j " + formatageDate(h) +":" + formatageDate(m) +":" + formatageDate(s) //+"s"
    }
    else if (h>0) {
     texte = texte + formatageDate(h) +"h " + formatageDate(m) +"m " + formatageDate(s) +"s"
    }
    else if (m>0) {
     texte = texte + formatageDate(m) +"m " + formatageDate(s) +"s"
    }
    else {
     texte = texte + formatageDate(s) +"s"
    }
   
    //On affiche maintenant
    if (idclock=='nes') {
       // Pas IE
     document.writeln('<font face="Arial" size="2" color="white"><b>Plus que<br>'+texte+'</b></font>');
      }
    else {
       // Internet Explorer
     if (sec_reste >= 0) {
        document.all[id_clock].innerHTML='Plus que<br>'+texte;
      setTimeout("affReste('"+idclock+"','"+sec_reste+"')", 1000);
      }
     else {
        document.all[id_clock].innerHTML='Trop tard !';
     }
    }
   }

   function disp_clock (idclock,dateact,datefin) {
    if (document.all) {
       // Internet Explorer
       document.writeln('<div id="clock' + idclock + '" style="font:bold 10pt Arial;color:white;"></div>');
     setTimeout("calculdiff('"+idclock+"','"+dateact+"','"+datefin+"')",200);
    }
    else {
       // Le reste
     calculdiff('nes',dateact,datefin);
    }
   
   }
   
   
  </script>


et on active le decompte par

CODE

<script LANGUAGE="javascript">disp_clock('1','03-01-06-14-35-55','04-01-06-14-35-55');</SCRIPT>




Quelques Explications:

disp_clock('1','03-01-06-14-35-55','04-01-06-14-35-55')


<script LANGUAGE="javascript">disp_clock('1','Date du debut-Heure complete avec sec','date de fin-Heure de fin avec sec');</SCRIPT>

je pense qu'il doit y avoir un moyen d'adapter ceci avec la modife de Fenris ,je regarde et je vous dit koi.

Écrit par : Gyakutsuki 7 Jan 2006, 21:52

QUOTE (isnogood @ 02 jan 2006, 19:38)

Loic, si tu nous écoutes, ..... biggrin.gif , tu pourras créer une 2.8 !

Désolé, de ne pas faire plus vite.

En cas vous avez un super boulot, félicitation pour la coopération.

Dès que je peux j'essaierai d'un faire une nouvelle, si entre temps si quelqu'un a dejà les fichiers tout prêt, il peut soit me les envoyer ou soit les mettre sur oscommerce.com dans la section de flash discount.


Écrit par : AL1 10 Jan 2006, 13:39

Bonjour les dévelloppeurs... et MEILLEURS VOEUX... Bon super cette contribe qui fonctionne nickel... félicitation à tous... Moi je suis une brèle, alors à part pomper le bouleau des autres.... cool.gif ...

J'ai juste besoin d'une petite piste, j'ai du faire une connerie, la vente flash se déroule nickel mais quand j'utilise uniquement la "promo", tout est ok sauf dans le panier ou j'ai le prix normal, sans promo quoi cry.gif et quand je vais chercher l'article dans le menu déroulant, il s'affiche sans la promo, par contre quand je vais le chercher dans sa boite "promo" là c'est nickel mrgreen.gif Mais je vois pas bien quel fichier bidouiller... Si un des seigneurs passe par là... Merciiii

Attention je parle de la "promo" pas de la vente flash qui elle "enregistre" bien la réduc dans le panier...

Alain

Écrit par : grant 11 Jan 2006, 20:57

Bonjour,



Quelqu'un peut-il me suggérer comment procéder pour que cette superbe contrib peut faire la Vente Flash non pas sur un produit donné mais sur une ou plusieurs catégories choisie dans la boutique et par conséquent Vente Flash sur tous les produits appartenant à la catégorie choisie.

Merci pour vos idées

Écrit par : philou83 19 Jan 2006, 14:57

Bonjour et bonne année à tous,

Y at-il une version plus récente que la 2.7 datant du 26 Avril 2005.
J'avais cru comprendre que oui en suivant le forum.

A+

Écrit par : philou83 20 Jan 2006, 15:47

coucou me revoilou,

Je relance ma question concernant une version plus récente de la contrib, J'ai travaillé dessus à l'automne et il faudrait que je l'installe maintenant. Le site ayant pas mal évolué, je reprend tout à zéro. C'est pourquoi je cherche s'il y a une version plus récente intégrant les améliorations des différents intervenants.

Phocea evoque une version optimisée dans un post du 11 octobre 2005. Est-elle disponible quelquepart ?

Bon week-end A+

Écrit par : Phocea 20 Jan 2006, 18:03

C'est en cours de nettoyage smile.gif Au pire si j ai pas encore le temps ce week end j enverrai le tout a Gyakutsuki sur son courriel, donc faudra encore etre un poil patient.

Elle tourne en ce moment sur le site dont je m occupe

Écrit par : philou83 24 Jan 2006, 08:31

Bonjour,
Je devrais normalement réinstaller cette contribution à partir d'aujourd'hui.
Je me demande si je diffère encore ou si je me contente de l'adaptation que j'avais fait en octobre.
Les changements de la nouvelle version concernent-ils que le front-office ou également l'admin ?
A+

Écrit par : Phocea 24 Jan 2006, 22:02

Bon voilou, j ai tout mis dans un zip et envoye ca a philou ainsi que Gyakutsuki qui vont j'espere pouvoir faire avancer le truc.

Etant sur creloaded avec beaucoup de modif je prefere que d'autres essaye l install sur une ms2 fraiche (ou presque) avant que ce ne soit mis sur osc (surtout qu il faudra encore faire les install en donnant la version ms2 puis pour une version avec BTS installé pour qu il ne la vire pas!!)

Ce n est donc plus qu une question de jour, courage wink.gif

Écrit par : YANN06 24 Jan 2006, 22:08

Bravo phocea laugh.gif

voila qui fera du bien à mon admin/categories.php avec master_products en plus j'm'en sors plus
(c'est le chantier blush.gif )


Écrit par : philou83 25 Jan 2006, 10:29

Bonjour,
Et d'abord merci à Phocea.

J'ai regardé le contenu du zip et je constate des différences par rapport à mon architecture oscomerce, différences entre creload et ms2 peut-être :

je n'ai pas de répertoire template, dans ma version les fichiers de catalogue/templates/content/ se trouvent à la racine et ceux de catalogue/templates/template_name/boxes/ dans includes/boxes/

Je n'ai pas de fichier catalogue/includes/modules/product_listing_col.php et je ne sais donc pas à quoi il correspond

Les fichiers de catalogue/admin/includes/languages/ sont dans ma version à :
admin/includes/languages
Mon répertoire catalogue /admin/ est vide et est lier à /admin

Je commence déjà à installer l'admin pour avancer

Écrit par : Phocea 25 Jan 2006, 12:30

Salut, moi non plus je n ai pas de repertoire catalogue, mais le plus souvent dans les install de contrib on le met quand meme pour faire voir ou est le root.

Tu as tout compris pour les boxes et les fichier dans templates/content, tu prend direct includes/boxes ou tes fichier dans le root, les lignes a change devraient etre les meme.

Pour product_listing_col, ca doit etre une contribution sur la ms2, tu dois surement avoir un product_listing.php dans le meme repertoire. La seule difference est la presentation, product_listing affiche les articles en lignes, l autre en colonne.
Je ne me sert pas de l affichage en ligne, alors il faudra peut etre comparer les 2 codes et voir ce que tu veux afficher sur tes lignes pour faire voir qu une vente flash est en cours (reprendre l icone horloge avec le temps restant ou pas)

Écrit par : philou83 25 Jan 2006, 14:00

Dans ma version je n'ai pas de product_listing.php. L'édition des produits d'une catégorie est faite par index.php, en ligne pas en colonne.
Quel est ton site que je vois ce que fait product_listing.php.
J'ai products_new.php qui correspond à la liste des produits nouveaux, mais on ne l'utilise pas.

Écrit par : philou83 26 Jan 2006, 11:52

Pour l'instant je n'arrive pas à créer une vente flash. Chaque fois que je modifie un produit dans l'admin et que j'actualise celui-ci disparait des produit en promotion ! je sèche

Écrit par : Phocea 26 Jan 2006, 13:47

Tu as un lien ou acces pour qu on regarde ?
Attention car comme je te l ai dis dans mon email, les ventes flash se mette en route automatiquement selon leur dates / heures de debut et fin. Il y a un changement a faire dans application_top.php qui se charge d activer/descativer les ventes flash

Écrit par : philou83 27 Jan 2006, 09:56

J'ai repris ma version d'octobre, que j'essaye d'adapter au site actuel. Il faut que ça marche ce soir ...
Le serveur de dev sur lequel je travaille n'est pas accessible de l'extérieur.

Écrit par : taeky 29 Jan 2006, 13:41

bonjour, félicitation pour cette super contrib.

Je rencontre 2 difficultés:

1) Lorsque je lance une vente Flash la box que j'ai dans la colonne de gauche se démultiplie en s'intercalant entre chaques box affichées.

2) Est-ce que vous êtes arrivé a adapter un compte a rebours dynamique comme sur le site cd****** , car je n'arrive pas a faire fonctionner la modif de FENRIS
Lorsque je mets son code dans product_info.tpl.php la vente flash ne s'affiche pas cry.gif

Merci d'avance

Écrit par : Phocea 30 Jan 2006, 11:02

Gyakutsuki est en train de remettre ca au propre pour une MS2, apparement les differences sont assez importantes avec ma version creloaded

Je te mets ici la section du code qui s occupe d afficher le compte a rebours sur product_info.tpl.php. A inserer ou tu veux que ca s affiche:

CODE
<?php // ############## Added Flash selling #############

       $status_flash_selling = tep_get_products_flash_selling($product_info['products_id']);
       if ($status_flash_selling == '1') {
?>
     <tr>
       <td class="smallText" align="center" valign="bottom" colspan ="2">
<?php
 
       //Time to stp
       $ecart_secondes = ($timestamp_end_flash_selling_date - $today);
       $ecart_days = floor($ecart_secondes / (60*60*24));
       $ecart_hour = floor($ecart_secondes / (60*60));
       $ecart_minutes = floor($ecart_secondes / (60));

       //Time to beginning
       $ecart_secondes_beginning = ($timestamp_end_flash_start_date - $today);
       $ecart_days_beginning = floor($ecart_secondes / (60*60*24));
       $ecart_hour_beginning = floor($ecart_secondes / (60*60));
       $ecart_minutes_beginning = floor($ecart_secondes / (60));
?>
<?php
       if (($today > $timestamp_beginning_flash_selling_date) && ($today < $timestamp_end_flash_selling_date)) {
if (($special_flash_selling_end_date != '') && ($special_flash_selling_end_date != '0000-00-00 00:00:00') && ($timestamp_end_flash_selling_date > $today)) {
?>
<script>
function decompteur(jour,mois,annee,heure,minute,seconde) {
     Resultat = "";
     now = new Date();
     goal = new Date(annee,mois-1,jour,heure,minute,seconde);

     ts = Math.abs((now.getTime()/1000)-(goal.getTime()/1000));
 
 if((goal.getTime()/1000) < (now.getTime()/1000)){
     location.reload();
 }
 
       fjour = Math.floor(ts/(3600*24));
       if(fjour<=1) {
               Resultat = fjour + " jour ";
       } else {
               Resultat = fjour + " jours ";
       }

       ts = ts - (fjour*24*3600);
       fheure = Math.floor((ts/3600));
       if(fheure<10) {
               Resultat += " 0" + fheure + "h ";
       } else {
               Resultat += " " + fheure + "h ";
       }

       ts = ts - (fheure*3600);
       minutes = Math.floor((ts/60));
       if(minutes<10) {
               Resultat += "0" + minutes + "m ";
       } else {
               Resultat += minutes + "m ";
       }

       ts = ts - (minutes*60);
       fseconde = Math.floor(ts);
       if(fseconde<10) {
               Resultat += "0" + fseconde + "s"
       } else {
               Resultat += fseconde + "s"
       }
 /*if (fjour == 0 && fheure == 0 && minutes == 0 && fseconde ==0) {
 location.reload();
 }*/
       return Resultat
}

function startX() {
 document.getElementById("countdown").innerHTML=decompteur(<?php echo $jend_days.','.$jend_month.','.$jend_year.','.$jend_hour.','.$jend_minute.','.$jend_second; ?>);
 setTimeout("startX()",1000);
}  
window.onload = startX;
</script>

<?php  
 
   echo  tep_image_button('button_flash_selling.gif', IMAGE_BUTTON_FLASH_SELLING);
?>
       <br/>
<span id= "countdown" type="text" disabled="disabled" class="boldText" size="28"></span>
<?php  
}
       }
?>
       </td>
     </tr>
<?php
       } else {
             if ($status_flash_selling == '0')
?>
     <tr>
       <td class="smallText" align="right" valign="top" colspan="2">
<?php
       $special_flash_selling_end_date = tep_get_products_special_flash_selling_end_date($product_info['products_id']);
       if (($special_flash_selling_end_date != '') && ($special_flash_selling_end_date != '0000-00-00 00:00:00')) {
echo '<span class="inputRequirement">' . TEXT_DATE_EXPIRE;
echo tep_date_long($special_flash_selling_end_date) . ' </span>';
       }
?>
       </td>
     </tr>
<?php
       }
?>
<?php // ############## End Added Flash selling #############   ?>


Note qu il te faudra avoir auparavant evaluer la variable $timestamp_end_flash_selling_date (date de fin de la flash sale)

Écrit par : taeky 30 Jan 2006, 14:27

Merci pour ta réponse

Il y a du mieux mais ...
J'ai paramétrer dans l'admin une vente flash avec date et heure de départ et date et heure de fin. J'ai bien inséré ton code a l'endroit ou je souhaite que ça s'affiche.
j'ai bien l'affichage de l'image button_flash_selling.gif mais je n'ai pas l'affichage du temps restant.cry.gif


Un peu plus haut dans product_info.tpl j'ai aussi ce bout de code


QUOTE
// ##################### Added Flash Selling ##################
/*
    if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
      $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
    } else {
      $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
    }
*/

$new_price = tep_get_products_special_price($product_info['products_id']);

    $status_flash_selling = tep_get_products_special_status_flash_selling($product_info['products_id']);
    $status_special = tep_get_products_special_status_flash($product_info['products_id']);
    $special_flash_selling_end_date = tep_get_products_special_flash_selling_end_date($product_info['products_id']);
    $special_flash_selling_end_date1 = tep_get_products_special_flash_selling_end_date($product_info['products_id']);
   
    $jend_days = substr($special_flash_selling_end_date1,8,2); // le jour
    $jend_month = substr($special_flash_selling_end_date1,5,2); // puis le mois
    $jend_year = substr($special_flash_selling_end_date1,0,4); // et l\'annee
    $jend_hour = substr($special_flash_selling_end_date1,11,2); // et l\'heure
    $jend_minute = substr($special_flash_selling_end_date1,14,2); // et la minute
    $jend_second = substr($special_flash_selling_end_date1,17,2); // et la seconde
     
    $timestamp_end_flash_selling_date = mktime($jend_hour,$jend_minute,$jend_second,$jend_month,$jend_days,$jend_year);
   
    // Flash discount start Date
    $special_flash_selling_beginning_date = tep_get_products_special_flash_selling_beginning_date($product_info['products_id']);
    $special_flash_selling_beginning_date1 = tep_get_products_special_flash_selling_beginning_date($product_info['products_id']);
   
    $jbeginning_days = substr($special_flash_selling_beginning_date1,8,2); // le jour
    $jbeginning_month = substr($special_flash_selling_beginning_date1,5,2); // puis le mois
    $jbeginning_year = substr($special_flash_selling_beginning_date1,0,4); // et l\'annee
    $jbeginning_hour = substr($special_flash_selling_beginning_date1,11,2); // et l\'heure
    $jbeginning_minute = substr($special_flash_selling_beginning_date1,14,2); // et la minute
    $jbeginning_second = substr($special_flash_selling_beginning_date1,17,2); // et la seconde

    $timestamp_beginning_flash_selling_date  = mktime($jbeginning_hour,$jbeginning_minute,$jbeginning_second,$jbeginning_month,$jbeginning_days,$jbeginning_year);

      // Now
      $today =time();
     
// $special_expires_date  = tep_get_products_special_expires_date($product_info['products_id']);

if ($status_flash_selling =='1'){
  $new_price_flash_selling = tep_get_products_special_price_flash_selling($product_info['products_id']);
  } else {
  $new_price_flash_selling = 0;
  }

if (($status_special =='0') && ($status_flash_selling =='0')) {
        $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
  } elseif (($status_special =='0') && ($status_flash_selling =='1') && ($timestamp_end_flash_selling_date > $today)  && ($timestamp_beginning_flash_selling_date < $today))  {
        $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price_flash_selling, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
  } elseif (($status_special =='1') && ($status_flash_selling =='0')) {
        $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
  } elseif(($status_special =='1') && ($status_flash_selling =='1')  && ($new_price > $new_price_flash_selling) && ($timestamp_end_flash_selling_date > $today) && ($timestamp_beginning_flash_selling_date < $today)) {
        $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price_flash_selling, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
  } elseif(($status_special =='1') && ($status_flash_selling =='1')  && ($timestamp_end_flash_selling_date < $today)) {
        $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
  } else {
        $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
  }
// ################# end Added Flash Selling ##################


est-ce que j'ai quelque chose a modifier dedans ?

Je vous avoue que mon niveau en php est quasi nul

Écrit par : philou83 31 Jan 2006, 15:53

bonjour,
c'est ok ça fonctionne à quelques détails prés.
Je voudrais avoir un compte à rebours plus esthétique. je n'ai rien trouvé d'interessant. quelqu'un aurait-il une adresse où trouver ça, ou carrement un compte à rebours avec des chiffres sous forme d'images, après on fait ce qu'on veut ( ce qu'on peut ?) esthétiquement.

Merci

Écrit par : Gyakutsuki 2 Feb 2006, 04:20

La V2.8 BETA est sortie :
http://www.oscommerce.com/community/contributions,2888

Des corrections suite aux éléments que m'a donné Phocéa incluse dans la MS2
Un répertoire consacré à la Creload

Écrit par : Phocea 2 Feb 2006, 08:23

MErci Gyakutsuki, je tente la re-install sur une creload toutes propre ce week end.
Par contre j ai bien peur que si tu as mis un repertoire creload plutot qu un repertoire BTS, ton fichier ne sera jamais approuvé sur osc sad.gif

Écrit par : christian21 2 Feb 2006, 10:33

Bonjour

Je n'ai pas trouvé la version 2.8 BETA sur le lien confused.gif

Pas encore en place peut être huh.gif


Cordialement

Écrit par : philou83 2 Feb 2006, 12:53

bonjour,
Quelqu'un a-t-il essayer d'integrer le cmpte à rebours dans la box flash-selling.
j'essaye mais rien ne s'affiche.
Je récupère bien mes paramètres de fin de vente dans :

CODE

function startX() {
 document.getElementById("ctp").innerHTML=decompteur(02,02,2006,18,00,00);
 setTimeout("startX()",1000);


peut-être qu'il faut déplacer le window.onload = startX;

Écrit par : fscalda 3 Feb 2006, 15:11

J'ai installer la contrib version flash_discount_v2.8_1 sur 2.2-MS2.

Et je comprends pas un truc, tout fonctionne parfaitement sur la fiche produit elle même exemple : gif, % de remise plus compte à rebours biggrin.gif mais, en fait, je n'ai plus de sous rubriques de tout les produits eux même.

J'ai ce message d'erreur :

QUOTE


1054 - Unknown column 'final_price' in 'order clause'

select p.products_model, p.products_image, p.products_quantity, pd.products_name, m.manufacturers_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id, products_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '30' order by final_price limit 0, 20

[TEP STOP]



J'en ai eu quelques un different que j'ai régler grace au different poste du forum.
Si j'enleve ma promo, tout refonctionne à merveille . confused.gif

Écrit par : fscalda 3 Feb 2006, 15:26

Bonn en fait je n'ai ce message que si je donne une date de fin à la vente flash. Si ça peut aider à me dire ou j'ai fait une boulette.

Écrit par : Phocea 3 Feb 2006, 15:52

Dans quel fichier exactement tu as l erreur ?
Le select de ta requete ne reference pas la colonne final_price d ou l erreur.

Écrit par : fscalda 3 Feb 2006, 16:22

J'ai l'erreur sur index.php quand je selectionne une rubrique, puis une sous rubrique. Peut être le fait que j'ai choisis l'affichage par prix ...

Écrit par : Gyakutsuki 3 Feb 2006, 17:15

Il y a bien bug à ce niveau, l'affichage par prix pose un problème au niveau de la requête sql.

Écrit par : fscalda 3 Feb 2006, 17:34

Bon, ben pour l'instant je vais faire avec, si je régle pas tout les parametres tel que la date de fin ça fonctionne biggrin.gif merci encore pour cette contribution smile.gif

Écrit par : Phocea 3 Feb 2006, 18:00

Ah ok... effectivement meme sur la version creload je n ai pas fait le changement necessaire dans shop_by_price.php pour que ca fonctionne. Pas de bug mais le montant de la vente flash ne s'affiche pas.
Par contre Gyakutsuki je ne vois nulle part dans ton code ou tu as mis un order by final_price ??

Fscalda, le seul soucis en ne mettant pas de date de fin est que tes flash sale ne se desactiveront jamais, il faudra que tu les effaces a la main dans l'admin (les desactiver dans l'admin ne sert a rien non plus puisque le status est remis a jour a chaque visite d'une page

Écrit par : fissiaux 3 Feb 2006, 20:18

Cedla fait 1 mois hier que mon compagnon d'arme a donné l
a solution :

http://www.oscommerce-fr.info/forum/index.php?showtopic=28702

Merci isnogood biggrin.gif

PS : dans le fil actuel, isnogood avait donné un lien vers la solution. FAUT LIRE !!

Écrit par : Gyakutsuki 4 Feb 2006, 04:27

Merci Fissiaux :

Voici la requête rectifiée :

CODE

// #################### Added Flash Selling ###################
  $product_specials_query0 = tep_db_query("select status, status_flash_selling, flash_selling_end_date from " . TABLE_SPECIALS . " where status = '1'  or status_flash_selling = '1' ");
  if (tep_db_num_rows ($product_specials_query0)) {
  $product_specials0 = tep_db_fetch_array($product_specials_query0);
 if (($product_specials0['status'] == '0') || ($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '1')  )  {
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m , " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  } else {
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
    }
  } else {
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  }
// #################### End Added Flash Selling ###################
     } else {
// We show them all
// #################### Added Flash Selling ###################
  $product_specials_query0 = tep_db_query("select status, status_flash_selling, flash_selling_end_date from " . TABLE_SPECIALS . " where status = '1'  or status_flash_selling = '1' ");
  if (tep_db_num_rows ($product_specials_query0)) {
  $product_specials0 = tep_db_fetch_array($product_specials_query0);
 if (($product_specials0['status'] == '0') || ($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '1')  )  {
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as final_price  from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c  where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
 } else {
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  }
 } else {
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  }
// #################### End Added Flash Selling ###################


la MAJ est sur osc.com

Écrit par : mikado 5 Feb 2006, 00:52

bonjour ! rolleyes.gif

tout fonctionne tres bien avec la derniere version !
juste un petir pb:

dessous les images ventes flash j'ai "TEXT_IN_STOCK' qui s'affiche!


9.00EUR
8.10EUR
2 Jour(s)
TEXT_IN_STOCK

j'ai cherche dans tous les fichiers de la contrib mais ne trouve pas ou corriger ce pb!
merci d'avance pour votre aide!

Écrit par : YANN06 5 Feb 2006, 01:28

salut, il doit te manquer un define dans filenames wink.gif

Écrit par : fissiaux 5 Feb 2006, 10:19

Un define oui très probablement, mais pas dans filenames.php

Écrit par : mikado 5 Feb 2006, 13:14

merci pour vos reponses! rolleyes.gif

j'ai regarde dans filenames mais ne trouve pas!
ca ne doit pas etre dans ce fichier!

logiquement cela devrait afficher "en stock" ou "stock epuise"!

est que je me trompe?

Écrit par : YANN06 5 Feb 2006, 14:23

Oups. Pardon sad.gif ce doit etre dans ton repertoire languages..............(french.php ou product_info.php)

Utilise un bon editeur et ça ira tout seul.

Écrit par : mikado 5 Feb 2006, 16:20

OK! MERCI YANN06!

je vais chercher la bestiole! wink.gif

Écrit par : mikado 5 Feb 2006, 16:41

j'ai trouve dans le fichier" flashselling.php ceci: blink.gif
est ce que cela vient de ce code?
--------------------------------------------------------------
<?php
$row = 0;
$specials_query = tep_db_query($specials_split->sql_query);
while ($specials = tep_db_fetch_array($specials_query)) {
$row++;

echo ' <td align="center" width="33%" class="smallText"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $specials['products_image'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . $specials['products_name'] . '</a><br><s>' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($specials['specials_price_flash_selling'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span><br/>';
echo tep_image(DIR_WS_IMAGES.'Horloge.gif') . '&nbsp;'.tep_get_products_flash_timer($specials['products_id']) . '<br>';
$stock_level = tep_get_products_stock($specials['products_id']);
if ((STOCK_CHECK == "true")&&($stock_level < 1) ) {
echo '<span class="markProductOutOfStock"><b>' . TEXT_OUT_OF_STOCK . '</b></span><br/>';
} elseif ((STOCK_CHECK == 'true')&&($stock_level > 0 )) {
echo '<span class="markProductInStock"><b>' . TEXT_IN_STOCK . '</b></span><br/>';
}


if ((($row / 3) == floor($row / 3))) {
?>

-------------------------------------------------------------------------------

Écrit par : YANN06 5 Feb 2006, 22:01

Rajoute:
define('TEXT_IN_STOCK, 'Demandez-nous');
define(TEXT_OUT_OF_STOCK', 'fin de stock');


Dans includes/languages/flash_selling.php

il doit aussi te manquer l'horloge.gif

Écrit par : Phocea 6 Feb 2006, 08:43

erm c'est a moi cette betises ... j'affiche ne fait un texte qui montre si le produit est en stock ou pas et en copiant le code de la derniere version de la contrib j'ai pas enleve ca apparement smile.gif

Bref pour qeu ca marche comme il faut il faut rajouter
le code suivante dansa ton stylesheet:

CODE
SPAN.markProductOutOfStock {
 font-family: Tahoma, Verdana, Arial, sans-serif;

 font-size: 12px;
 color: #c76170;
 font-weight: bold;
}

SPAN.markProductInStock{
 font-family: Tahoma, Verdana, Arial, sans-serif;

 font-size: 12px;
 color: white;
 font-weight: bold;
}



puis dans includes/languages/french.php

CODE
define('TEXT_IN_STOCK', 'En stock');
define('TEXT_OUT_OF_STOCK', 'Indisponible');


et dans includes/languages/english.php
CODE
define('TEXT_IN_STOCK', 'In stock');
define('TEXT_OUT_OF_STOCK', 'Out of stock');


Par contre cette modif n'a rien a voiravec flash discount, c'est simplement pour que le client puisse voir facilement si un produit est ou pas disponible facilement. Si tu ne veux pas avoir ca il te suffit d'enlever le bout de code suivante de flash_Selling.php

CODE
if ((STOCK_CHECK == "true")&&($stock_level < 1) ) {
echo '<span class="markProductOutOfStock"><b>' . TEXT_OUT_OF_STOCK . '</b></span><br/>';
} elseif ((STOCK_CHECK == 'true')&&($stock_level > 0 )) {
echo '<span class="markProductInStock"><b>' . TEXT_IN_STOCK . '</b></span><br/>';
}

Écrit par : mikado 6 Feb 2006, 17:56

biggrin.gif merci Phocea!

je vais mettre a jour les fichiers!

merci a tous pour votre aide!

@ plus

Écrit par : YANN06 6 Feb 2006, 19:24

Ben tant que faire ce peut vu que Phocea passe par là......

Aurais-tu une combine pour desactiver le cache de mes pages s'il y a une vente flash??........

Du genrer if ($status_flash_selling =='1'){...

Aprés bien des essais je capitule blush.gif

Merci d'avance

Ps je sais que je peux desactiver le cache dans l'admin mais il me faudrait surveiller H24 mes promos et je manque dèja de sommeil alors...... tongue.gif

Écrit par : tchaoo 7 Feb 2006, 15:57

Bjr,

je viens d'entendre parler d'une version Creload 6.1xxx sur la page d'avant... Mais rien sur Os commerce.com...

Qqu'un aurait un lien pour la charger ? merci

Écrit par : Phocea 7 Feb 2006, 17:41

Heuu Yann je sais pas trop ..essaye de faire une recherche sur USE_CACHE dans tes fichiers, c'est la variable qui est utilise pour include les fonctions de cache ou pas. Ensuite sur les fichier ou tu ne veux pas utiliser le cache il suffira de rajouter un truc du style if USE_CACHE == true && $status_flash_selling !='1' .. si tu vois ce que je veux dire.

Par contre je capte pas ou tu veux faire ca. Il fait quoi qui ne va pas le cache ?

tchaoo, pour creload c est sur www.crelaod.com pour la version 6.15. Sinon oneil a une version fr 6.04 je crois

Écrit par : Gyakutsuki 13 Feb 2006, 16:16

Je n'ai pu mettre une version creaload dans le pack. Il refuse maintenant de mettre les forks.

Écrit par : YANN06 14 Feb 2006, 13:14

CITATION(Phocea @ 7 Feb 2006, 05:41 PM) [snapback]155891[/snapback]

il suffira de rajouter un truc du style if USE_CACHE == true && $status_flash_selling !='1' .. si tu vois ce que je veux dire.

Par contre je capte pas ou tu veux faire ca. Il fait quoi qui ne va pas le cache ?



Tchô phocea,

Ben en fait j'ai bien testé if $status_flash_selling !='1' et plein d'autres choses....
Mais ça ne marche pô laugh.gif

J'ai fait un module flash activable pour ma main_page( index_nested) sur la base de la box mais le décompte des jours est sujet au cache........
(que je suis obligé de garder car mon code n'est pas trés propre et comme un debutant que je suis, j'en ai mis partout des contribs, des images etc.....et ça râme dur sans cache)

Donc, voilou, j'aimerais desactiver le cache juste sur la partie compteur si c'est possible ou bien pour le module en entier.ce qui est bizarre à comprendre pour un newbie comme moi c'est que le compteur de la fiche produit n'est pas sujet au cache lui!!! alors que toute la page product_info l'est???
c'est juste le mini compteur:
echo tep_image(DIR_WS_IMAGES. 'horloge.gif') .'<br>'.tep_get_products_flash_timer($specials['products_id']) . '<br>';

Merci wink.gif

Écrit par : krysds 4 May 2006, 15:47

Tout d'abord merci à Gyakutsuki pour cette superbe contribution.

J'ai eu un tout petit probléme à l'instal de la version 2.9 "1109 table p inconnu" ; qui était causé par la ligne 196 du code de index.php ou il manque un espace

CODE
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling from " . TABLE_PRODUCTS . " pleft join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";


Remplacer par

CODE
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

Écrit par : goukouni 22 Jun 2006, 10:27

Bonjour,
Je rame pour trouver le flag, la condition ou la fonction qui indique ou non la présence d'une vente flash...
ex : if $status_flash_selling !='1' qui n'a pas l'air d'être adapté.
Ca doit être évident mais pas pour moi...
Merci de votre aide.
Goukouni

Écrit par : fissiaux 22 Jun 2006, 19:52

Dans quel fichier es tu à ce moment là ?

Écrit par : goukouni 23 Jun 2006, 07:33

Bonjour,
Je suis dans index.php, le but étant de substituer la vente flash au contenu de l'accueil (quand il y en a une de vente flash).
Merci
Goukouni

Écrit par : Yann06 23 Jun 2006, 10:13

CITATION
le but étant de substituer la vente flash au contenu de l'accueil (quand il y en a une de vente flash)


Humf....... wink.gif

Le statut "flash" determine si dans tes promos, il y a une vente flash donc dans ton accueill, as-tu un module specials.php ??? si oui, c'est là qu'il te faut agir(a priori blush.gif )

Sinon, je crois que dans ce topic tu as quelques idées pour te créer un module flash_selling.php (une copie de la boxe du même nom) et le placer dans ta page centrale wink.gif

Bon code.........

Écrit par : goukouni 23 Jun 2006, 16:26

En accueil, j'ai un "produit phare", je n'ai pas de boxe specials dans les colonnes.
j'ai revu le flash_selling.php qui devrait s'insérer à la place du produit_phare.php quand il y a vente flash.
Mais la conditions coince.

Merci pour la piste, je vais chercher.
Goukouni


Écrit par : serialou 4 Jul 2006, 21:56

au risque de parettre stupide, ou trouver horloge.gif, je ne l'ai pas et elle n'est pas dans la contrib ?
Merci.

Écrit par : fissiaux 4 Jul 2006, 22:34

Sur un bon moteur de recherche (g**gle, m*n, y**oo), tu trouveras facilement une image qui ira avec le look de ton site. biggrin.gif

Écrit par : Phocea 5 Jul 2006, 07:29

CITATION(serialou @ 4 Jul 2006, 15:56) [snapback]182846[/snapback]

au risque de parettre stupide, ou trouver horloge.gif, je ne l'ai pas et elle n'est pas dans la contrib ?
Merci.

Petit oubli de Gyakutsuki lorsqu il a mergé les changements que j'avais apporté sur une version creload

le gif est dispo ici:
http://www.eboutik.net/images/Horloge.gif

Écrit par : mtayac 21 Jul 2006, 11:14

Bonjour,

J'ai installé voilà 2 jours cette contrib, sans pb. Merci à tous ceux qui ont participé à l'oeuvre.

Voici mon souci que je n'arrive pas à résoudre, mais qui ne doit pas être très compliqué (pour les supers initiés en php, dont je ne suis pas) :

Je met 1 produit en promo classique et 1 produit en flash.
Sur la page index le prix normal de l'article en promo n'est plus barré
alors que celui de la vente flash l'est,
et le prix promo n'apparaît pas
alors que celui de la vente flash apparaît

Je clique sur l'image de l'article et je passe dans product_info.php :
l'affichage de l'article en promo est correct (prix normal barré, prix promo en rouge, % de remise)
par contre pour l'article en flash seul le prix normal apparaît non barré et si je commande, c'est le prix flash qui va dans le panier.(voir ci-dessous)

Je pense qu'il s'agit d'un pb d'affichage ???

Si quelqu'un a une idée, merci d'avance.

Max




Re

je viens d'enlever un pb :

Pour que le prix flash apparaisse, il faut mettre dans l'admin off (rouge) le produit colonne "Etat" de la promo. Donc point rouge pour Promo et vert pour flash

Écrit par : Valerie 7 Aug 2006, 16:24

bonjour

après install, lorsque j'appelle la page Special dans l'admin, j'obtiens :

CITATION
1054 - Unknown column 's.customers_group_id' in 'field list'

select p.products_id, pd.products_name, p.products_price, s.specials_id, s.customers_group_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = s.products_id order by pd.products_name limit -15, 15

[TEP STOP]



et en dessous, la barre de titre de menu :
CITATION
Produits Prix du Produits Statut Vente Flash Prix Flash Action



Ca vient donc du fait que j'ai la contrib Separate customer group d'installée.


Lors de l'install, j'ai pu voir que chaque fois qu'il fallait coller ce type de code :


CODE
//      tep_db_query("update " . TABLE_SPECIALS . " set specials_new_products_price = '" . tep_db_input($specials_price) . "', specials_last_modified = now(), expires_date = '" . tep_db_input($expires_date) . "' where specials_id = '" . (int)$specials_id . "'");
      tep_db_query("update " . TABLE_SPECIALS . " set specials_new_products_price = '" . tep_db_input($specials_price) . "', specials_last_modified = now(), expires_date = '" . tep_db_input($expires_date) . "', flash_selling_beginning_date = '" . tep_db_input($flash_selling_beginning_date) . "', flash_selling_end_date = '" . tep_db_input($flash_selling_end_date) . "', specials_price_flash_selling = '" . tep_db_input($specials_price_flash_selling) . "' where specials_id = '" . (int)$specials_id . "'");
// ############## End Flash selling #############


j'avais sur la ligne juste après :

CODE
tep_db_query("update " . TABLE_SPECIALS . " set specials_new_products_price = '" . tep_db_input($specials_price) . "', customers_group_id = '" . $customers_group . "', specials_last_modified = now(), expires_date = '" . tep_db_input($expires_date) . "' where specials_id = '" . (int)$specials_id . "'");



Que faut il faire ? faut il grouper les 2 ensemble du style :

CODE
       tep_db_query("update " . TABLE_SPECIALS . " set specials_new_products_price = '" . tep_db_input($specials_price) . "', customers_group_id = '" . $customers_group . "', specials_last_modified = now(), expires_date = '" . tep_db_input($expires_date) . "', flash_selling_beginning_date = '" . tep_db_input($flash_selling_beginning_date) . "', flash_selling_end_date = '" . tep_db_input($flash_selling_end_date) . "', specials_price_flash_selling = '" . tep_db_input($specials_price_flash_selling) . "' where specials_id = '" . (int)$specials_id . "'");


et faut il rajouter un code sur la base de donnée ? si oui, le quel ?


merci de vos conseils






Écrit par : Valerie 7 Aug 2006, 16:40

en fait je suis en train de répondre un peu à mes questions, oui il faut réunir les lignes de code...
dites moi si c'est faux.

et oui, il doit falloir ajouter customer separate dans la bdd de specials, mais là je bloque....

et y aurait il autre chose ?

Écrit par : eric.balandraud 22 Aug 2006, 11:40

Les ventes flash ne s'affiche dans product_listing.php.
ma version ms2 creload 1.2.
le rste fonctionne.

en fait le test : if (tep_not_null($listing['specials_price_flash_selling'])) est toujpurs faux.

le champ 'specials_price_flash_selling' est vide.

il manquerait à mon avis une requete sql quelque part !

help me

Écrit par : Yann06 22 Aug 2006, 13:17

Salut,

Dans ton index aurais-tumis ça:

CODE
$product_specials_query0 = tep_db_query("select status, status_flash_selling, flash_selling_end_date from " . TABLE_SPECIALS . " where status = '1'  or status_flash_selling = '1' ");
   if (tep_db_num_rows ($product_specials_query0)) {
   $product_specials0 = tep_db_fetch_array($product_specials_query0);
        if (($product_specials0['status'] == '0') || ($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '1')  )  {
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_retail_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_new_products_price, NULL) as specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_listing_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";

Écrit par : eric.balandraud 22 Aug 2006, 13:34

merci pour ta reponse,

oui ce code est mis dans index.php,

Probléme non resolu cry.gif

Écrit par : lfo 10 Oct 2006, 12:17

Bonjour,
Je suis en train d’installer flash_discount_v2.9 et je bloque sur ce message :

1054 - Unknown column 'products_price_flash_selling' in 'field list'

select products_id, products_price_flash_selling from products where products_id = '30'

comme je vais ajouter un article en vente flash, effectivement la colonne 'products_price_flash_selling n’existe pas dans la table products et je ne trouve pas dans le package.
Avez-vous une idée ?

lfo

Écrit par : fissiaux 10 Oct 2006, 18:48



C'est un bug !!!

Tu travailles avec des % ?

Écrit par : lfo 10 Oct 2006, 19:35

Merci
"Tu travailles avec des % "? je suis en phase de test et d’apprentissage mais j’ai vu que le % ne fonctionne pas
J’ai eu cette erreur comme je mets l’article en solde et en vente flash à la fois

Ps il y aune correction de ce bug quelque part ?

Écrit par : Arafael 27 Oct 2006, 04:37

Bonjour,

J'ai installé ce module version 2.9 (sans être méchant, mettre un txt contenant directement les modifications à faire serait largement plus facile... pour tout le monde).

Seulement voilà, j'ai un petit problème:

ma version de includes/modules/new_products.php est la 1.34; or celle du module est la 1.35 !

Ne pouvant pas changer ma version de new_products.php, que dois-je faire ?

Écrit par : Phocea 27 Oct 2006, 16:30


Et bien Arafael voila une super initiative .. au boulot on attend ton fichier d instructions individulles smile.gif

Écrit par : Arafael 28 Oct 2006, 18:17

Ce n'est pas de la mauvaise volonté, mais je souhaiterai d'abord faire fonctionner cet add-on avant de vouloir m'engager à quoi que ce soit. wink.gif

Écrit par : mirastoul 4 Nov 2006, 09:39

Bonjour,

Après installation de la version 2.9 de flash discount, le tri par prix ne marche pas (affichage dans le désordre complet). En local, celà marche correctement. Problème de bd ?
Quelqu'un pourrait-il m'aider, svp ?
En vous remerciant d'avance.

Écrit par : kaloo70 21 Feb 2007, 17:09

bonjour,

cette contrib est super !!! j'aurais voulu savoir comment faire pour que ça défile dans la boxe et pour avoir le compte a rebour aussi dedans.

Merci beaucoup

Écrit par : lab8 1 Apr 2007, 05:04

Bon boulot, j ai installé la version Flash Discount 2.9 mais j'ai trouvé un ptit bug dedans.
En fait, lorsque l on clique sur une categorie, on peut voir les reductions de prix due aux ventes flash, mais plus les eventuelles promotions sur les produits que l on peut mettre sur la version standard d oscommerce 2.2.

Il semble que la ligne 229 du fichier index.php qui soit en cause:
Il faut remplacer la ligne suivante:
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

en:

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price,
NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ,
IF(s.status_flash_selling, s.specials_price_flash_sell
ing, NULL) as specials_price_flash_selling from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABL
E_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int
)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";



Car cette ligne ci permet de gerer les promotions.
J espere qu il n y pas d autre bug ailleurs....

En tout cas merci pour cette contrib.

bye


Écrit par : polo 4 Apr 2007, 11:58

Bonjour et bravo pour cette contribution, qui risque de m'interesser une fois qu'elle sera fonctionnel, j'ai un drôle de truc qui va vous faire sourire blink.gif une fois ajouté un produit en promo avec la date de début et la date d'arrivé, le décompte s'oppert correctement dans product_info, j'ai également mis 50 sur le prix flash promo mais ce prix ne s'affiche pas dans product info (juste dans le box), en fait c'est le prix promo standard qui reste le seul est unque prix valable dans la page product info, avant , prendant et après le décompte. (donc 100)

Voici mes réglages dans l'admin special.php

Produit : slip kangourou (126.00 €)
Prix promotionnel : 100
Date d'expiration : j'ai laissé vide
Vente Flash
Date de début du Flash J-04 M-04 A-2007 H-11 Mn-30 S-0
Date de fin Flash J-04 M-04 A-2007 H-12 Mn-30 S-0
Flash Promotionnel : 50

J'ai un peu de mal à comprendre au niveau du back office si il faut que j'indique quelques chose dans "prix promotionnel" ou non car il n'est pas sencé être fait pour le flash non ?

Merci pour votre aide rolleyes.gif

Écrit par : polo 4 Apr 2007, 16:04

Bon apparemment je n'arrive toujours pas à afficher le prix de la promo flash (specials_price_flash_selling) dans product info, c'est un oubli ou c'est normale ? mrgreen.gif De plus quand je change le status des flash promo (on ou off) çà ne change rien shock.gif le compte à rebour s'affiche toujours...

Écrit par : polo 5 Apr 2007, 08:35

Bonjour,


Bon j'ai refait l'installe de cette page product info et çà passe maintenant, je comprend mieu l'affichage des prix maintenant.

Par contre pour le module product_listing.php, quand je prend celui livré dans la contrib il ne m'affiche que les promo flash et plus les promos standard dry.gif et moi de mon coté en bisoullant j'arrive seulement à afficher les promo standard et non pas les promos flash, comment faire pour afficher les 2 ?, voici le code que j'ai mis pour pouvoir affiher les 2 type de promo, un pro du php peut il m'aider à établir une correction ? merci de votre aide mellow.gif

CODE
// ################### Added Flash selling #############                      
   if (tep_not_null($listing['specials_price_flash_selling'])) {
    $lc_text = '&nbsp;<s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($listing['specials_price_flash_selling'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>&nbsp;';
   } elseif
// ################### end added Flash selling #############                      
                            
                               (tep_not_null($listing['specials_new_products_price']))
            
            {$lc_text .= '<font color="#FF0000"><span class="smalltext"><s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>&nbsp;</span><span class="productSpecialPriceList">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span></font>';}
            else
            {$lc_text .= '<span class="PriceList">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>&nbsp;</td>';}

Écrit par : thematrixisme 2 May 2007, 10:29

la solution au problème de pourcentage est très simple:

fichier : admin/specials.php
ligne : 100 à 106:

nouveau code:

CODE
if (substr($specials_price_flash_selling, -1) == '%') {
          $new_special_flash_selling_insert_query = tep_db_query("select products_id, products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
          $new_special_flash_selling_insert = tep_db_fetch_array($new_special_flash_selling_insert_query);

          $products_price_flash_selling = $new_special_flash_selling_insert['products_price'];
          $specials_price_flash_selling = ($products_price_flash_selling - (($specials_price_flash_selling / 100) * $products_price_flash_selling));
        }

Écrit par : francois21 29 May 2007, 10:28

Bonjour
J'ai installe cette contrib
Tres beau travail!!!
Cependant quand j'ajoute un produit qui est en vente flash au caddie, dans le caddie j'ai le prix normal du produit et en bas "sous total" qui correspond au prix en vente flash.
Mais quand je valide la commande, ça ne tiens pas compte du tout de la vente flash et ça finalise la commande a son prix normal.
Une idée???

En page principale, j'ai promo du moi de Mai en centrale.
Les prix affiches sont les prix en promo mais pas "vente flash" pourtant les produit sont en vente flash et quand on clique dessus j'arrive bien sur la page du produit avec le compteur vente flash.

Enfin j'ai mis le module news dans la colonne droite avec un scroll. les nouveaute en vente flash sont affichees aleur pris normal

sur la page "flash_selling.php" sous le produit, j'avais
TEXT_OUT_OF_STOCK
ou
TEXT_IN_STOCK


en rajoutant
define ('TEXT_OUT_OF_STOCK' ,'Sur commande');
define ('TEXT_IN_STOCK' ,'En stock');

dans includes-->languages-->french-->flash_selling.php
c'est OK


Merci pour votre aide

Francois

Écrit par : francois21 29 May 2007, 13:12

pour le caddie [resolu]

J'avais un problème avec chèque cadeaux

Pour promo j'ai toujours le problème et la boxe dans la colonne disparait si je met toutes les promo en vente flash.
Si je met une seule promo en vente flash, la boxe promo réapparait avec les autres promo.

Je cherche mais si vous pouvez m'aiguiller, merci d'avance

Écrit par : francois21 29 May 2007, 16:27

Apres recherche et corrections tout est OK


Écrit par : polo 11 Jul 2007, 14:36

Bonjour
J'ai un petit soucis au niveau "javascript" avec thickbox + celui de flash discount (j'avais pas fait attention sur l'instant)

Au lieu d'avoir le temps du chronomètre (il reste 8 jours, 50 minutes et 10 sec..) , j'ai ceci: Na NAanAa nA (un truc du genre...) evil.gif

J'ai beau passer des nuits blanches dessus, et retourner tous dans tous les sens, de jouer avec les Onload.. init() de mon <Body> je ne vois pas d'ou cela vien, y'a t'il une incompatibilitée avec flash discount et thick box ?? je sais pas.. excl.gif


Si quelqu'un utilise ces 2 contribs ensemble avec succès , je serais cureux de savoir comment il fait. blush.gif

1000 merci à vous tous !!!

Écrit par : Dizin 26 Jul 2007, 15:43

Bonjour

J'ai installé la contribution sur ma boutique il y a peu de temps et ça marche plutôt bien. Je tiens à féliciter les personnes qui ont bossé dessus wink.gif

Ayant au préalable déjà installer la contribution TotalB2B, j'ai du durant l'installation de Flash Discount associer les 2, je m'en suis plutôt pas mal sortie sauf qu'il me reste un petit problème.

Le problème survient lorsqu'un client faisant partie d'un groupe ayant droit à une remise voit cette remise appliquée dans la page flash_selling et dans la boxe sur la gauche, par contre elle ne l'est pas dans le panier et lors de la commande. Pour moi au final je me trouve avec le bon prix mais c'est le client qui doit se poser des questions du fait que le prix change au moment de finaliser l'achat.

Donc je voulais savoir si quelqu'un avait installé ces 2 contributions sur sa boutique s'il retrouve cette erreur. Et si quelqu'un voulez bien m'aidé à trouver le problème je peux poster le code des pages concernées.

Merci
A bientôt

Écrit par : rtony30 28 Oct 2007, 16:10

bonjour
je voudrais installer la contribution flash.
j ai fait une copie de mon site (icodia)sur un autre serveur(lycos)puis j ai essayer d installer flash-discount v2.9.
j ai suivi la doc a la lettre(Insérer le code qui se trouve entre
##################### added Flash Selling ###############
##################### End added Flash Selling #############)
mais j ai plein de message d erreur.
cette version est elle opérationnel ou il faut faire d autre modification?

je vient de tout reinstaller,mais jy arrive toujours pas
j ai pas les promotion qui saffiche,jai plus les nouvauté qui scroll dans la boxe
pouvais vous me donner un coup de main svp
http://membres.lycos.fr/rtony30/index.php

Écrit par : rtony30 29 Oct 2007, 20:29

bonjour
quand je met un produit en vente flash dans mon pannier c est le prix original qui est prit en compte.
avez vous une idée?
j ai les promo qui ne s afiche pas
voici le code
[codebox]<?php
/*
$Id: specials.php,v 1.31 2003/06/09 22:21:03 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/

$rp_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc");
if (tep_db_num_rows($rp_query)) {
// #################### Added Flash Selling ###############
// if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and (s.status_flash_selling = '0' or now()> flash_selling_end_date) order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
// #################### End Added Flash Selling ###############

?>

<!-- specials //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_SPECIALS);

// Nom du fichier image à indiquer pour l'afficher en haut de la boxe
// new infoBoxHeading($info_box_contents, image_de_gauche, nom_du_css, affichage_text_box, image_de_droite, image_du_lien, adresse_du_lien);
new infoBoxHeading($info_box_contents, false, infoBoxHeadingSpecials, false, false, Box_specials, tep_href_link(FILENAME_SPECIALS, '', 'NONSSL'));

if (tep_not_null($random_product['specials_new_products_price'])) {
$whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
$whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
} else {
//$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));


}
while ($random_product = tep_db_fetch_array($rp_query)) {
$rp .= '<center><br><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'specials_new_products_id=' . $random_product['specials_new_products_id']) . '">' . $random_product['products_name'] . '</a><br><s><font color="#1d1b73">' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</font></s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));

}

$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
'text' => '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "50" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$rp.'</span></MARQUEE>');

// Nom des css pour l'intérieure de la boxe et le cadre
// new infoBox($info_box_contents, nom_de_la_css_pour_l'intérieure, nom_de_la_css_pour_le_cadre);
new infoBox($info_box_contents, infoBoxContentsSpecials, infoBoxSpecials);

// Nom du fichier image à indiquer pour l'afficher en bas de la boxe
// new infoBoxHeading($info_box_contents, image, nom_du_css);
new infoBoxHeading($info_box_contents, bas, infoBoxHeadingSpecials);
?>
</td>
</tr>
<!-- specials_eof //-->
<?php
}
?>
[/codebox]
merci

Écrit par : polo 29 Oct 2007, 22:09

CITATION(Dizin @ 26 Jul 2007, 16:43) [snapback]244864[/snapback]
Bonjour

J'ai installé la contribution sur ma boutique il y a peu de temps et ça marche plutôt bien. Je tiens à féliciter les personnes qui ont bossé dessus wink.gif

Ayant au préalable déjà installer la contribution TotalB2B, j'ai du durant l'installation de Flash Discount associer les 2, je m'en suis plutôt pas mal sortie sauf qu'il me reste un petit problème.

Le problème survient lorsqu'un client faisant partie d'un groupe ayant droit à une remise voit cette remise appliquée dans la page flash_selling et dans la boxe sur la gauche, par contre elle ne l'est pas dans le panier et lors de la commande. Pour moi au final je me trouve avec le bon prix mais c'est le client qui doit se poser des questions du fait que le prix change au moment de finaliser l'achat.

Donc je voulais savoir si quelqu'un avait installé ces 2 contributions sur sa boutique s'il retrouve cette erreur. Et si quelqu'un voulez bien m'aidé à trouver le problème je peux poster le code des pages concernées.

Merci
A bientôt


Salut,

Je ne connais pas Total B2B, elle utilise du Java, n'y aurait il pas un conflict ? reprend l'installe dans ta page shopping cart.php et checkout_process.php, pour voir. blush.gif

Écrit par : Dizin 30 Oct 2007, 13:59

La contribution Total B2B permet la création de groupes clients par l'administrateur, l'affectation de conditions commerciales différenciées aux groupes de clients et aux clients, l'affectation possible de plusieurs prix pour un même produit et la gestion de la visualisation des prix par les simples visiteurs.

Elle n'utilise pas de Java et c'est tout à fait possible qu'il y ai conflit car au moment de l'installation de Flash Discount il y avait du code à mettre au même endroit que le code de la contribution Total B2B, et j'ai donc essayer d'adapter les 2 à ces endroits là.

Écrit par : rtony30 30 Oct 2007, 16:05

bonjour
j ai toujours des problème a installer la contribution flash discount
j ai du code au même endroit
je sais pas comment faire
pouvais vous m aider svp
merci

Écrit par : rtony30 1 Nov 2007, 19:09

j aurais besoin de votre aide svp
je me bat avec cette contribution,je vient de reinstaller pour x fois mais ca marche toujour pas.
quand je clique sur le bouton ajouter dans le panier de l article en flash ,j ai un message d erreur:
Warning: Cannot modify header information - headers already sent by (output started at /data/members/free/multimania/fr/r/t/o/rtony30/htdocs/products_new.php:12) in /data/members/free/multimania/fr/r/t/o/rtony30/htdocs/includes/functions/general.php on line 33
voici une partie de mon fichier general.php

Code
...

Écrit par : loopz 4 Oct 2008, 00:35

Bonjour et un grand BRAVO à Gyakutsuki et à tous ceux qui ont travaillé sur cette contrib biggrin.gif

J'ai installé la version 2.9 et ça marche correctement mis à part quelques petits bugs (comme par exemple l'absence de changement lorsqu'on active ou désactive le bouton rouge/vert de la vente flash. On doit donc arrêter la vente flash en changeant la date de fin, mais bon, ce n'est pas très grave)

J'aurais cependant 2 questions svp :

1- Quelqu'un sait t'il comment faire pour suprimer l'affichage de la remise en % svp ?

2- Comment faire apparaître le compte à rebours un peu plus grand et de couleur plus voyante (il est actuellement petit et gris, ce qui n'est pas top).
En ce qui concerne la taille du compte à rebours, j'ai beau modifier cette ligne : <span id= "ctpbox" type="text" class="smallText" size="28"></span> en remplaçant le 28 par une autre valeur. Il n'ya aucun changement.

Merci d'avance pour vos réponses.

Écrit par : gazoboss 6 Oct 2008, 20:00

hello, je viens d'installer cette contrib mais je bloque car j'ai ce message :
Fatal error: Call to undefined function: tep_get_products_special_price_flash_selling() in /home.2/gazoline/www/newsite/catalog/products_new.php on line 82


quelqu'un peut il m'aider d'avance merci

Écrit par : loopz 6 Oct 2008, 20:07

Peut être pourrais-tu commencer par regarder ce qui pourrait clocher à la ligne 82 de ton fichier products_new.php rolleyes.gif

Écrit par : gazoboss 8 Oct 2008, 10:25

eh bien je sais pas trop :
ligne 82 : if ($new_price = tep_get_products_special_price_flash_selling($products_new['products_id'])) {

Écrit par : loopz 8 Oct 2008, 10:36

attention, regarde aussi un peu au dessus et au dessous car le compteur des éditeurs diffère parfois légèrement des messages d'erreur.

Écrit par : Franck95 22 Jan 2009, 16:49

Bonjour a tous.

Super contrib et très beau travail déjà pour commencer mais et oui il y a un mais ... et je sèche un peu..

Je possède la version 2.9 sur un oscommerce-2.2rc1-FR-w3c-3 et quand je me retrouve sur la page des produits et qu'il y a, et seulement dans ce cas la un produit en vente flash, et que je desire afficher la liste des produits classés par prix j'ai ce message.

1054 - Champ 'final_price' inconnu dans order clause

select p.products_image, pd.products_name, p.products_id, p.manufacturers_id,
p.products_price, p.products_tax_class_id, IF(s.status_flash_selling,
s.specials_price_flash_selling, NULL) as specials_price_flash_selling
from products_description pd, products p left join manufacturers m on
p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id
= s.products_id, products_to_categories p2c where p.products_status = '1'
and p.products_id = p2c.products_id and pd.products_id = p2c.products_id
and pd.language_id = '4' and p2c.categories_id = '22' order by final_price ,
pd.products_name limit 0, 20

[TEP STOP]



la page qui doit etre en cause est l'index.php mais je ne trouve pas l'erreur si quelqu'un pourrais regarder ou se trouve la coquille.

Voici mon index.php

CODE
<?php
/*
$Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/

require('includes/application_top.php');

// the following cPath references come from application_top.php
$category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$cateqories_products = tep_db_fetch_array($categories_products_query);
if ($cateqories_products['total'] > 0) {
$category_depth = 'products'; // display products
} else {
$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
$category_parent = tep_db_fetch_array($category_parent_query);
if ($category_parent['total'] > 0) {
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
}
}

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>
<body>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" summary="" width="1000" cellspacing="0" cellpadding="3" align="center">
<tr>
<td width="200" valign="top" bgcolor="#251633"><table border="0" summary="" width="200" cellspacing="0" cellpadding="2">
</tr>
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<?php
if ($category_depth == 'nested') {
$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
$category = tep_db_fetch_array($category_query);
?>
<td width="100%" valign="top"><table border="0" summary="" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" summary="" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" summary="" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" summary="" width="100%" cellspacing="0" cellpadding="2">
<tr>
<?php
if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
$category_links = array_reverse($cPath_array);
for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$categories = tep_db_fetch_array($categories_query);
if ($categories['total'] < 1) {
// do nothing, go through the loop
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
break; // we've found the deepest category the customer is in
}
}
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
}

$number_of_categories = tep_db_num_rows($categories_query);

$rows = 0;
while ($categories = tep_db_fetch_array($categories_query)) {
$rows++;
$cPath_new = tep_get_path($categories['categories_id']);
$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";
if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
}
}

// needed for the new products module shown below
$new_products_category_id = $current_category_id;
?>
</tr>
</table></td>
</tr>

<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
</tr>
</table></td>
</tr>
</table></td>
<?php
} elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

asort($define_list);

$column_list = array();
reset($define_list);
while (list($key, $value) = each($define_list)) {
if ($value > 0) $column_list[] = $key;
}

$select_column_list = '';

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
switch ($column_list[$i]) {
case 'PRODUCT_LIST_MODEL':
$select_column_list .= 'p.products_model, ';
break;
case 'PRODUCT_LIST_NAME':
$select_column_list .= 'pd.products_name, ';
break;
case 'PRODUCT_LIST_MANUFACTURER':
$select_column_list .= 'm.manufacturers_name, ';
break;
case 'PRODUCT_LIST_QUANTITY':
$select_column_list .= 'p.products_quantity, ';
break;
case 'PRODUCT_LIST_IMAGE':
$select_column_list .= 'p.products_image, ';
break;
case 'PRODUCT_LIST_WEIGHT':
$select_column_list .= 'p.products_weight, ';
break;
}
}

// show the products of a specified manufacturer
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category




// #################### Added Flash Selling ###################
$product_specials_query0 = tep_db_query("select status, status_flash_selling, flash_selling_end_date from " . TABLE_SPECIALS . " where status = '1' or status_flash_selling = '1' ");
if (tep_db_num_rows ($product_specials_query0)) {
$product_specials0 = tep_db_fetch_array($product_specials_query0);
if (($product_specials0['status'] == '0') || ($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '1') ) {
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_new_products_price, NULL) as specials_new_products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
}else{
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
}
}else{
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
}
// #################### End Added Flash Selling ###################




} else {
// We show them all




// #################### Added Flash Selling ###################
$product_specials_query0 = tep_db_query("select status, status_flash_selling, flash_selling_end_date from " . TABLE_SPECIALS . " where status = '1' or status_flash_selling = '1' ");
if (tep_db_num_rows ($product_specials_query0)) {
$product_specials0 = tep_db_fetch_array($product_specials_query0);
if (($product_specials0['status'] == '0') || ($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '1') ) {
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling from " . TABLE_PRODUCTS . " pleft join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
}else{
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
}
}else{
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
}





}
} else {
// show the products in a given categorie
if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory



// #################### Added Flash Selling ###################
$product_specials_query0 = tep_db_query("select status, status_flash_selling, flash_selling_end_date from " . TABLE_SPECIALS . " where status = '1' or status_flash_selling = '1' ");
if (tep_db_num_rows ($product_specials_query0)) {
$product_specials0 = tep_db_fetch_array($product_specials_query0);
if (($product_specials0['status'] == '0') || ($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '1') ) {
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m , " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
} else {
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
}
} else {
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
}
// #################### End Added Flash Selling ###################





} else {
// We show them all






// #################### Added Flash Selling ###################
$product_specials_query0 = tep_db_query("select status, status_flash_selling, flash_selling_end_date from " . TABLE_SPECIALS . " where status = '1' or status_flash_selling = '1' ");
if (tep_db_num_rows ($product_specials_query0)) {
$product_specials0 = tep_db_fetch_array($product_specials_query0);
if (($product_specials0['status'] == '0') || ($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '1') ) {
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
} else {
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
}
} else {
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
}
// #################### End Added Flash Selling ###################



}
}

if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
$HTTP_GET_VARS['sort'] = $i+1 . 'a';
$listing_sql .= " order by pd.products_name";
break;
}
}
} else {
$sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
$sort_order = substr($HTTP_GET_VARS['sort'], 1);

switch ($column_list[$sort_col-1]) {
case 'PRODUCT_LIST_MODEL':
$listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_NAME':
$listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
break;
case 'PRODUCT_LIST_MANUFACTURER':
$listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_QUANTITY':
$listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_IMAGE':
$listing_sql .= " order by pd.products_name";
break;
case 'PRODUCT_LIST_WEIGHT':
$listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_PRICE':
$listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
}
}
?>
<td width="100%" valign="top"><table border="0" summary="" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" summary="" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<?php
// optional Product List Filter
if (PRODUCT_LIST_FILTER > 0) {
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
} else {
$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
}
$filterlist_query = tep_db_query($filterlist_sql);
if (tep_db_num_rows($filterlist_query) > 1) {
echo ' <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . '&nbsp;';
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
$options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
} else {
echo tep_draw_hidden_field('cPath', $cPath);
$options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
}
echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
while ($filterlist = tep_db_fetch_array($filterlist_query)) {
$options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
}
echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
echo tep_hide_session_id() . '</form></td>' . "\n";
}
}

// Get the right image for the top-right
$image = DIR_WS_IMAGES . 'table_background_list.gif';
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
$image = tep_db_fetch_array($image);
$image = $image['manufacturers_image'];
} elseif ($current_category_id) {
$image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$image = tep_db_fetch_array($image);
$image = $image['categories_image'];
}
?>
<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
</tr>
</table></td>
<?php
} else { // default page
?>
<td width="100%" valign="top"><table border="0" summary="" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" summary="" width="100%" cellspacing="0" cellpadding="0">
<tr>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>
</tr>
<tr>
<td><table border="0" summary="" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
</tr>
<?php
include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>
</table></td>
</tr>
</table></td>
<?php
}
?>
<!-- body_text_eof //-->
<td width="200" valign="top" bgcolor="#251633"><table border="0" summary="" width="200" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
</tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Merci d'avance.

Écrit par : jp914 16 Apr 2009, 08:42

Citation (loopz @ 6 Oct 2008, 21:07) *
Peut être pourrais-tu commencer par regarder ce qui pourrait clocher à la ligne 82 de ton fichier products_new.php rolleyes.gif



salut il te manque simplement le code a integrer dans le fichier includes/fonction/general.php et la fonction tep_get_products_special_price_flash_selling

Écrit par : milerwan 3 May 2009, 17:08

Avec la contrib v2.9,

pour les ventes flash, j'ai bien le prix + l'anim flash qui disparaissent (en temps réel) à la fin de la date programmée en revanche il faut que j'actualise la page product_info.php (F5) pour avoir l'affichage qui apparait passée la date de début...

Est-ce normal ?
Et si oui, existe-t-il une routine qui permettrait que l'offre s'affiche en temps réel au même titre que celle-ci s'enlève ?

Écrit par : Rik2009 3 May 2009, 20:52


A tu activer le cache car moi je les d'installer et je n'est pas se problème. mais mon cache n'est pas activer. Si le tient est activer fait un éssais sans le cache.

Écrit par : sornsam 25 May 2009, 06:01

Bonjour,

super comme contribe, mais j'aimerais avoir une image gif dans le product listing, comment faire, quel code ajouter?

Merci

Écrit par : graale44 6 Oct 2009, 21:03

Bonjour,

Je viens d'installer et adapter cette contrib sur mon osc. Tout fonctionne comme je veux.

Le hic car il y en a un est que j'ai installé le compte à rebours javascript sur la page flash_selling.php en reprenant le code de celui de product_info.php. Le compte a rebours ne fonctionne que sur le 1er produit. Donc, si je lance par exemple 2 ventes flash, elles apparaissent bien toutes les 2 sur la page flash_selling.php mais seule la première dispose du compte à rebours javascript.

Et je sèche pour reussir à l'afficher sur chaque produit.

Donc, si quelqu'un avait réussi ce tour de passe passe, je lui serais très reconnaissant de m'indiquer la piste à suivre

Par avance , merci

Voici le code à partir de la ligne 64 de la page flash_selling.php

if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>

<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_FLASH); ?></td>
<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
<tr>
<td class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_SPECIALS). '">' . TEXT_FLASH_LINK_SPECIALS . '</a>' ; ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
?>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<script type="text/javascript">
function decompteur(jour,mois,annee,heure,minute,seconde) {
Resultat = "";
now = new Date();
goal = new Date(annee,mois-1,jour,heure,minute,seconde);

ts = Math.abs((now.getTime()/1000)-(goal.getTime()/1000));

if((goal.getTime()/1000) < (now.getTime()/1000)){
location.reload();
}

fjour = Math.floor(ts/(3600*24));
if(fjour<=1) {
Resultat = fjour + " jour ";
} else {
Resultat = fjour + " jours ";
}

ts = ts - (fjour*24*3600);
fheure = Math.floor((ts/3600));
if(fheure<10) {
Resultat += " 0" + fheure + "h ";
} else {
Resultat += " " + fheure + "h ";
}

ts = ts - (fheure*3600);
minutes = Math.floor((ts/60));
if(minutes<10) {
Resultat += "0" + minutes + "m ";
} else {
Resultat += minutes + "m ";
}

ts = ts - (minutes*60);
fseconde = Math.floor(ts);
if(fseconde<10) {
Resultat += "0" + fseconde + "s"
} else {
Resultat += fseconde + "s"
}
return Resultat
}

function startXbox() {
document.getElementById("ctppflash").innerHTML=decompteur(<?php echo $jend_days_box.','.$jend_month_box.','.$jend_year_box.','.$jend_hour_box.','.$jend_minute_box.','.$jend_second_box; ?>);
document.getElementById("ctpbox").innerHTML=decompteur(<?php echo $jend_days_box.','.$jend_month_box.','.$jend_year_box.','.$jend_hour_box.','.$jend_minute_box.','.$jend_second_box; ?>);
setTimeout("startXbox()",1000);
}

window.onload = startXbox;
</script>
<?php
$row = 0;
$specials_query = tep_db_query($specials_split->sql_query);
while ($specials = tep_db_fetch_array($specials_query)) {
$row++;
//Modif F.B Formater la taille de l'image
$FormatImg=tep_formatImag(DIR_WS_IMAGES . $specials['products_image'],SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
//Fin modif
echo ' <td align="center" width="33%" class="smallText"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $specials['products_image'], $specials['products_name'], $FormatImg['W'], $FormatImg['H']) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' .
//debut modif by paddybl for ecotax
$specials['products_name'] . '</a><br><s>' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id']),$specials['ecotax_rates_id']) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($specials['specials_price_flash_selling'], tep_get_tax_rate($specials['products_tax_class_id']),$specials['ecotax_rates_id']) . '</span><br/>';
//fin modif by paddybl for ecotax

// echo '<b>' . TEXT_END_TIME . '</b>&nbsp;'. '<b>' .tep_get_products_flash_timer($specials['products_id']) . '</b>' . '<br>';
//$stock_level = tep_get_products_stock($specials['products_id']);
echo '<span id= "ctppflash" type="text" class="compteurflash"></span>' . '</b>' . '<br>';
$stock_level = tep_get_products_stock($specials['products_id']);
if ((STOCK_CHECK == "true")&&($stock_level < 1) ) {
echo '<span class="markProductOutOfStock"><b>' . TEXT_OUT_OF_STOCK . '</b></span><br/>';
} elseif ((STOCK_CHECK == 'true')&&($stock_level > 0 )) {
echo '<span class="markProductInStock"><b>' . TEXT_IN_STOCK . '</b></span><br/>';
}


if ((($row / 3) == floor($row / 3))) {
?>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<?php
}
}
?>
</tr>
</table></td>
</tr>
<?php
if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<tr>
<td><br><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_FLASH); ?></td>
<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table></td>
</tr>
<?php
}
?>
</table></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
</tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Écrit par : hagen 20 May 2011, 00:48

YouP !

Il commençait presque à prendre la poussière ce post biggrin.gif

Je souhaiterais savoir si des personnes ont testé cette contrib sur un OsC 2.3.1 récemment ?

Ou peut être existe t-il une autre contrib plus récente de vente flash que je n'aurais pas trouvé sur le net ?

Sur ce, bonne nuit smile.gif

HaGeN !

Écrit par : hagen 23 May 2011, 16:27

De retour aux nouvelles !!

Finalement, j'ai réussi à adapter cette contrib pour la 2.3.1 après pas mal de galère, de test, et parfois un peu de bidouille ^^ tongue.gif

Merci aux infos présente dans ce fil de discussion et celles présentes sur http://www.oscommerce-fr.info/forum/index.php?showtopic=44841&st=0

HaGeN

Écrit par : jlb59226 11 Dec 2012, 15:43

Bonjour

j'ai installé la contribution flash discount 2.9 elle fonctionne sauf au niveau de l'affichage par liste !
Exemple : je n'ai pas d'affichage du prix en "promotion flash", dans la liste en affichant, par exemple, tout les produits d'un fabricant

Quelqu'un aurait il rencontré ce probléme ?

je sais c'est un vieux post !

merci

Écrit par : Team SPL 11 Feb 2013, 02:57

Bonjour,
j'ai besoin de vos lumières parce que je but sur un truc, c'est dans index.php.
J'aurais besoin de faire cohabiter Flash Discount et SPPC

dans mon index.php j'ai ça (modif inseré pour SPPC) :

Code
// BOF Separate Pricing Per Customer
    if ($status_product_prices_table == true) { // ok in mysql 5
    $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd , " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";        
    } else { // either retail or no need to get correct special prices -- changed for mysql 5
    $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
    } // end else { // either retail...
// EOF Separate Pricing Per Customer
      } else {
// We show them all
// BOF Separate Pricing Per Customer
        if ($status_product_prices_table == true) { // ok in mysql 5
        $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";    
    } else { // either retail or no need to get correct special prices -- changed for mysql 5
        $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
    } // end else { // either retail...
// EOF Separate Pricing Per Customer
      }
    } else {
// show the products in a given categorie
      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory;  
// BOF Separate Pricing Per Customer
        if ($status_product_prices_table == true) { // ok for mysql 5
        $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";    
        } else { // either retail or no need to get correct special prices -- ok in mysql 5
        $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
        } // end else { // either retail...
// EOF Separate Pricing Per Customer
      } else {
// We show them all
// BOF Separate Pricing Per Customer --last query changed for mysql 5 compatibility
        if ($status_product_prices_table == true) {
    // original, no need to change for mysql 5
    $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
        } else { // either retail or no need to get correct special prices -- changed for mysql 5
        $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
      } // end else { // either retail...
// EOF Separate Pricing per Customer


et j'aimerais y fusionner ça (Flash Discount) :
Code
// #################### Added Flash Selling ###################
   $product_specials_query0 = tep_db_query("select status, status_flash_selling, flash_selling_end_date from " . TABLE_SPECIALS . " where status = '1'  or status_flash_selling = '1' ");
   if (tep_db_num_rows ($product_specials_query0)) {
   $product_specials0 = tep_db_fetch_array($product_specials_query0);
        if (($product_specials0['status'] == '0') || ($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '1')  )  {
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_new_products_price, NULL) as specials_new_products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
         }else{
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
          }
         }else{
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
        }
// #################### End Added Flash Selling ###################
      } else {
// We show them all
// #################### Added Flash Selling ###################
   $product_specials_query0 = tep_db_query("select status, status_flash_selling, flash_selling_end_date from " . TABLE_SPECIALS . " where status = '1'  or status_flash_selling = '1' ");
   if (tep_db_num_rows ($product_specials_query0)) {
   $product_specials0 = tep_db_fetch_array($product_specials_query0);
        if (($product_specials0['status'] == '0') || ($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '1')  )  {
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling                                                                              from " . TABLE_PRODUCTS . " pleft join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
        }else{
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
        }
        }else{
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
        }
// #################### End Added Flash Selling ###################
      }
    } else {
// show the products in a given categorie
      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
// #################### Added Flash Selling ###################
   $product_specials_query0 = tep_db_query("select status, status_flash_selling, flash_selling_end_date from " . TABLE_SPECIALS . " where status = '1'  or status_flash_selling = '1' ");
   if (tep_db_num_rows ($product_specials_query0)) {
   $product_specials0 = tep_db_fetch_array($product_specials_query0);
        if (($product_specials0['status'] == '0') || ($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '1')  )  {
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m , " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
            } else {
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
          }
            } else {
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
            }
// #################### End Added Flash Selling ###################
      } else {
// We show them all
// #################### Added Flash Selling ###################
   $product_specials_query0 = tep_db_query("select status, status_flash_selling, flash_selling_end_date from " . TABLE_SPECIALS . " where status = '1'  or status_flash_selling = '1' ");
   if (tep_db_num_rows ($product_specials_query0)) {
   $product_specials0 = tep_db_fetch_array($product_specials_query0);
        if (($product_specials0['status'] == '0') || ($product_specials0['status'] == '1') && ($product_specials0['status_flash_selling'] == '1')  )  {
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status_flash_selling, s.specials_price_flash_selling, NULL) as specials_price_flash_selling                                                                              from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c  where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
        } else {
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
        }
     } else {
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
     }
// #################### End Added Flash Selling ###################


Help me please blush.gif

Écrit par : Chrys1 16 Mar 2013, 14:01

Bonjour j'ai exactement le même souci je souhaiterais faire co-habiter les deux contributions SPPC et Flash discount. Qui peut nous aider? Merci infiniment.

Écrit par : chti_poupon 16 Mar 2013, 18:31

Bonjour
Je comprends que vous voulez afficher les produits flash aux conditions (prix...) du client en ligne. Et éventuellement l'affichage standard.
$listing_sql, au sortir de la modif SPCC contient les produits aux conditions client qui vont bien.
Pourquoi ne pas comparer ce tableau à celui des produits répondant aux conditions flash pour en extraire $listing_sql_flash, intersection des 2 tableaux ?
Est-ce-si lourd ?
Chti poupon


Écrit par : Team SPL 20 Mar 2013, 21:56

Citation (chti_poupon @ 16 Mar 2013, 18:31) *
Bonjour
Je comprends que vous voulez afficher les produits flash aux conditions (prix...) du client en ligne. Et éventuellement l'affichage standard.
$listing_sql, au sortir de la modif SPCC contient les produits aux conditions client qui vont bien.
Pourquoi ne pas comparer ce tableau à celui des produits répondant aux conditions flash pour en extraire $listing_sql_flash, intersection des 2 tableaux ?
Est-ce-si lourd ?
Chti poupon


J'avais déjà comparé et testé, j'ai rien compris à ce qu'il falait modifier :-/

Écrit par : mihelicjm 19 Jun 2015, 23:42

Bonjour à tous,

Je tente d'adapter cette contribution sur une version OsCommerce Bootstrap 2.3.4 sauf que je bûche sur un point qui a déjà été survolé mais qui n'a pas été développé. En fait je voudrais reproduire le compte-à-rebours du product_info sur catalogue/includes/modules/flash_selling.php et catalogue/flash_selling.php. L'idée survolée a été de créer une fonction, je suis donc parti sur cette idée mais je m'embrouille un peu les pinceaux... Pour l'instant j'en suis là:

par exemple dans catalogue/includes/modules/flash_selling.php j'ai créé la fonction osc_decompte:

CODE
if (strlen(strip_tags($product['products_description'])) > 0 && PRODUCT_LIST_DESCRIPTION_GRID > 0) {
if (strlen(strip_tags($product['products_description'])) > PRODUCT_LIST_DESCRIPTION_GRID) {
$p_desc_grid = '<div class="product-description description-grid">'.mb_substr(strip_tags($product['products_description']), 0, PRODUCT_LIST_DESCRIPTION_GRID, 'UTF-8').'...'.'</div>';
$p_desc_grid = '<div align="center">'.tep_image(DIR_WS_IMAGES . 'Horloge.gif', ''). '&nbsp;'.osc_decompte($specials['products_id']) .'</div><div class="product-description description-list">'.mb_substr(strip_tags($product['products_description']), 0, PRODUCT_LIST_DESCRIPTION_LIST, 'UTF-8').'...'.'</div>';
}
else {
$p_desc_grid = '<div class="product-description description-grid">'.strip_tags($product['products_description']).'</div>';
$p_desc_grid = '<div align="center">'.tep_image(DIR_WS_IMAGES . 'Horloge.gif', ''). '&nbsp;'.osc_decompte($specials['products_id']) .'</div><div class="product-description description-list">'.mb_substr(strip_tags($product['products_description']), 0, PRODUCT_LIST_DESCRIPTION_LIST, 'UTF-8').'...'.'</div>';
}
} else {
$p_desc_grid ='';
}

ensuite - et c'est là que ça se complique un peu, dans includes/functions/general.php je suis parti sur cette idée que je ne parviens pas à faire aboutir:
CODE
function osc_decompte($special_flash_selling_beginning_date1) {
$special_flash_selling_end_date1 = tep_get_products_special_flash_selling_end_date($product_id);

$jend_days = substr($special_flash_selling_end_date1,8,2); // le jour
$jend_month = substr($special_flash_selling_end_date1,5,2); // puis le mois
$jend_year = substr($special_flash_selling_end_date1,0,4); // et l\'annee
$jend_hour = substr($special_flash_selling_end_date1,11,2); // et l\'heure
$jend_minute = substr($special_flash_selling_end_date1,14,2); // et la minute
$jend_second = substr($special_flash_selling_end_date1,17,2); // et la seconde

$timestamp_end_flash_selling_date = mktime($jend_hour,$jend_minute,$jend_second,$jend_month,$jend_days,$jend_year);

// Flash discount start Date
$special_flash_selling_beginning_date1 = tep_get_products_special_flash_selling_beginning_date($product_id);
$jbeginning_days = substr($special_flash_selling_beginning_date1,8,2); // le jour
$jbeginning_month = substr($special_flash_selling_beginning_date1,5,2); // puis le mois
$jbeginning_year = substr($special_flash_selling_beginning_date1,0,4); // et l\'annee
$jbeginning_hour = substr($special_flash_selling_beginning_date1,11,2); // et l\'heure
$jbeginning_minute = substr($special_flash_selling_beginning_date1,14,2); // et la minute
$jbeginning_second = substr($special_flash_selling_beginning_date1,17,2); // et la seconde

$timestamp_beginning_flash_selling_date = mktime($jbeginning_hour,$jbeginning_minute,$jbeginning_second,$jbeginning_month,$jbeginning_days,$jbeginning_year);
// Now
$today =time();

//Time to end of flash sale
$ecart_secondes = ($timestamp_end_flash_selling_date - $today);
$ecart_days = floor($ecart_secondes / (60*60*24));
$ecart_hour = floor($ecart_secondes / (60*60));
$ecart_minutes = floor($ecart_secondes / (60));

//Time to beginning
$ecart_secondes_beginning = ($timestamp_end_flash_start_date - $today);
$ecart_days_beginning = floor($ecart_secondes / (60*60*24));
$ecart_hour_beginning = floor($ecart_secondes / (60*60));
$ecart_minutes_beginning = floor($ecart_secondes / (60));
$jend_days = substr($special_flash_selling_end_date1,8,2); // le jour
$jend_month = substr($special_flash_selling_end_date1,5,2); // puis le mois
$jend_year = substr($special_flash_selling_end_date1,0,4); // et l\'annee
$jbeginning_days = substr($special_flash_selling_beginning_date1, 8, 2);
$jbeginning_month = substr($special_flash_selling_beginning_date1, 5, 2);
$jbeginning_year = substr($special_flash_selling_beginning_date1, 0, 4);
$timestamp_beginning_flash_selling_date = round((mktime($jbeginning_hour,$jbeginning_minute,$jbeginning_second,$jbeginning_month,$jbeginning_days,$jbeginning_year)-mktime($jend_hour,$jend_minute,$jend_second,$jend_month,$jend_days,$jbeginning_year))/86400);
return $timestamp_beginning_flash_selling_date >= 0 ? $timestamp_beginning_flash_selling_date : '';
}


Quelqu'un pourrait il m'aider à mettre un peu d'ordre à tout ça?

Écrit par : mihelicjm 26 Jun 2015, 10:58

Je suis en train de commencer à tenter d'adapter le compte à rebours sur catalog/flash_selling.php... mais je coince un peu. Si je fais par exemple:

CODE
<?php
/*
$Id: flash_selling.php,v 1.49 2003/06/09 22:35:33 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/
require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FLASH_SELLING);
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_FLASH_SELLING));
$content = CONTENT_FLASH_SELLING;



require(DIR_WS_INCLUDES . 'template_top.php');
?>

<h1 class="page-heading product-list"><?php echo HEADING_TITLE; ?></h1>
<div class="block-content">
<?php
// ##################### Added Flash Selling ##################
//$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() < s.flash_selling_end_date order by s.specials_date_added DESC";
$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() > s.flash_selling_beginning_date and now() < s.flash_selling_end_date order by s.specials_date_added DESC";
$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);
// ##################### END Added Flash Selling ##################




if ($specials_split->number_of_rows > 0) {
echo tep_gridlist_build();
}
if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<div class="listing-panel top-panel top-view">
<div class="row">
<div class="col-xs-6 displayText"><?php echo $specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></div>
<div class="col-xs-6"><?php echo $specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></div>
</div>
</div>
<?php
}
?>

<ul class="row product-listing">
<?php
$specials_query = tep_db_query($specials_split->sql_query);
$i=0;
while ($specials = tep_db_fetch_array($specials_query)) {
$i++;
$product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$specials['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
$product = tep_db_fetch_array($product_query);


// ##################### Added Flash Selling ##################
$special_flash_selling_end_date = tep_get_products_special_flash_selling_end_date($specials['products_id']);



$jend_days_fs = (int)substr($special_flash_selling_end_date,8,2); // le jour
$jend_month_fs = (int)substr($special_flash_selling_end_date,5,2); // puis le mois
$jend_year_fs = (int)substr($special_flash_selling_end_date,0,4); // et l\'annee
$jend_hour_fs = (int)substr($special_flash_selling_end_date,11,2); // et l\'heure
$jend_minute_fs = (int)substr($special_flash_selling_end_date,14,2); // et la minute
$jend_second_fs = (int)substr($special_flash_selling_end_date,17,2); // et la seconde
?>
<script type="text/javascript">
function decompteur(jour,mois,annee,heure,minute,seconde) {
Resultat = "";
now = new Date();
goal = new Date(annee,mois-1,jour,heure,minute,seconde);

ts = Math.abs((now.getTime()/1000)-(goal.getTime()/1000));

if((goal.getTime()/1000) < (now.getTime()/1000)){
location.reload();
}

fjour = Math.floor(ts/(3600*24));
if(fjour<=1) {
Resultat = fjour + " jour ";
} else {
Resultat = fjour + " jours + ";
}

ts = ts - (fjour*24*3600);
fheure = Math.floor((ts/3600));
if(fheure<10) {
Resultat += " 0" + fheure + "h ";
} else {
Resultat += " " + fheure + "h ";
}

ts = ts - (fheure*3600);
minutes = Math.floor((ts/60));
if(minutes<10) {
Resultat += "0" + minutes + "m ";
} else {
Resultat += minutes + "m ";
}

ts = ts - (minutes*60);
fseconde = Math.floor(ts);
if(fseconde<10) {
Resultat += "0" + fseconde + "s"
} else {
Resultat += fseconde + "s"
}
return Resultat
}

function startXbox() {
document.getElementById("countdown").innerHTML=decompteur(<?php echo $jend_days_fs.','.$jend_month_fs.','.$jend_year_fs.','.$jend_hour_fs.','.$jend_minute_fs.','.$jend_second_fs; ?>);
setTimeout("startXbox()",1000);
}

window.onload = startXbox;
</script>
<?php
// ##################### END Added Flash Selling ##################
if (strlen(strip_tags($product['products_description'])) > 0 && PRODUCT_LIST_DESCRIPTION_GRID > 0) {
if (strlen(strip_tags($product['products_description'])) > PRODUCT_LIST_DESCRIPTION_GRID) {
//$p_desc_grid = '<div class="product-description description-grid">'.mb_substr(strip_tags($product['products_description']), 0, PRODUCT_LIST_DESCRIPTION_GRID, 'UTF-8').'...'.'</div>';
}
else {
//$p_desc_grid = '<div class="product-description description-grid">'.strip_tags($product['products_description']).'</div>';
}
} else {
$p_desc_grid ='';
}
if (strlen(strip_tags($product['products_description'])) > 0 && PRODUCT_LIST_DESCRIPTION_LIST > 0) {
if (strlen(strip_tags($product['products_description'])) > PRODUCT_LIST_DESCRIPTION_LIST) {
// ##################### Added Flash Selling ##################
$p_desc_list = '<div align="center">'.tep_image(DIR_WS_IMAGES . 'Horloge.gif', ''). '&nbsp;' . $jend_days_fs .'&nbsp;Jours&nbsp;+'. ' ' . $jend_hour_fs.'h'. ' ' . $jend_minute_fs . '&nbsp;mn&nbsp;'. $jend_second_fs .'s'. '</div><div class="product-description description-list">'.mb_substr(strip_tags($product['products_description']), 0, PRODUCT_LIST_DESCRIPTION_LIST, 'UTF-8').'...'.'</div>';
// ##################### END Added Flash Selling ##################
}
else {
$p_desc_list = '<div class="product-description description-list">'.strip_tags($product['products_description']).'</div>';
}
} else {
$p_desc_list ='';
}


$products_price = $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id']));
$specials_price_flash_selling = '<span class="soloprix_normal">' . $currencies->display_price_dizaines($specials['specials_price_flash_selling'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span>';

$specials_content .= tep_product_block_build(
$productId = $specials['products_id'],
$productImage = $specials['products_image'],
$productName = $specials['products_name'],
$productAdded = '',
$productManufacturerId = $specials['manufacturers_id'],
$productManufacturerName = '',
$productPrice = $products_price,
//$productPriceNew = $products_price_promos,
$productPriceNew = $specials_price_flash_selling,
$productWeight = '',
$productQuantity = '',
$productModel = '',
$productDescription = $p_desc_list.$p_desc_grid,
$productButtons = true,
$pageComming = FILENAME_FLASH_SELLING,
$elCount = $i
);

}
echo $specials_content;
?>
</ul>
<?php
if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<div class="listing-panel bottom-panel">
<div class="row">
<div class="col-xs-6 displayText"><?php echo $specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></div>
<div class="col-xs-6"><?php echo $specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></div>
</div>
</div>
<?php
}
?>
</div>
<?php
require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

... là on est presque bon : la date est bien à jour sauf que le compte à rebours ne se déclenche pas; l'heure de fin s'affiche de façon figée (ex. 23h 56mn 56s). Cela s'explique puisque la fonction du decompteur javascript n'est pas prise en compte. J'ai donc essayé une deuxième possibilité à l'instar de product_info.php pour exploiter le decompteur javascript en remplaçant:
CODE
' . $jend_days_fs .'&nbsp;Jours&nbsp;+'. ' ' . $jend_hour_fs.'h'. ' ' . $jend_minute_fs . '&nbsp;mn&nbsp;'. $jend_second_fs .'s'. '

par
CODE
<span id= "countdown" type="text" disabled="disabled" class="boldText" size="28"></span>

ça ne marche pas... là - et uniquement sur le premier produit de la liste des ventes flash - on a un compte à rebours qui décompte bien avec une date (ex. 9 jours + 3h 54mn 25s) mais ces informations sont erronées. Sur ces deux tentatives il y a une partie de bonne dans chacune d'elle pour arriver au résultat souhaité qui serait d'afficher le même compte à rebours de product_info.php.

Une idée ou une suggestion?

Écrit par : mihelicjm 2 Jul 2015, 11:09

J'avance un peu mais besoin d'aide pour un ultime détail. Revoici ma page catalogue/flash_selling.php

CODE
<?php
/*
$Id: flash_selling.php,v 1.49 2003/06/09 22:35:33 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/
require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FLASH_SELLING);
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_FLASH_SELLING));
$content = CONTENT_FLASH_SELLING;

require(DIR_WS_INCLUDES . 'template_top.php');
?>

<h1 class="page-heading product-list"><?php echo HEADING_TITLE; ?></h1>
<div class="block-content">
<?php
//$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() < s.flash_selling_end_date order by s.specials_date_added DESC";
$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_price_flash_selling from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status_flash_selling = '1' and now() > s.flash_selling_beginning_date and now() < s.flash_selling_end_date order by s.specials_date_added DESC";
$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);

if ($specials_split->number_of_rows > 0) {
echo tep_gridlist_build();
}
if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {

?>
<div class="listing-panel top-panel top-view">
<div class="row">
<div class="col-xs-6 displayText"><?php echo $specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></div>
<div class="col-xs-6"><?php echo $specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></div>
</div>
</div>
<?php
}

?>

<ul class="row product-listing">
<?php
$specials_query = tep_db_query($specials_split->sql_query);
$i=0;
while ($specials = tep_db_fetch_array($specials_query)) {
$i++;
$product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$specials['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
$product = tep_db_fetch_array($product_query);

// ##################### Added Flash Selling ##################

$new_price = tep_get_products_special_price($specials['products_id']);
$status_flash_selling = tep_get_products_special_status_flash_selling($specials['products_id']);
$status_special = tep_get_products_special_status_flash($specials['products_id']);
$special_flash_selling_end_date = tep_get_products_special_flash_selling_end_date($specials['products_id']);
$special_flash_selling_end_date1 = tep_get_products_special_flash_selling_end_date($specials['products_id']);

$jend_days = substr($special_flash_selling_end_date1,8,2); // le jour
$jend_month = substr($special_flash_selling_end_date1,5,2); // puis le mois
$jend_year = substr($special_flash_selling_end_date1,0,4); // et l\'annee
$jend_hour = substr($special_flash_selling_end_date1,11,2); // et l\'heure
$jend_minute = substr($special_flash_selling_end_date1,14,2); // et la minute
$jend_second = substr($special_flash_selling_end_date1,17,2); // et la seconde

$timestamp_end_flash_selling_date = mktime($jend_hour,$jend_minute,$jend_second,$jend_month,$jend_days,$jend_year);

// Flash discount start Date
$special_flash_selling_beginning_date = tep_get_products_special_flash_selling_beginning_date($specials['products_id']);
$special_flash_selling_beginning_date1 = tep_get_products_special_flash_selling_beginning_date($specials['products_id']);

$jbeginning_days = substr($special_flash_selling_beginning_date1,8,2); // le jour
$jbeginning_month = substr($special_flash_selling_beginning_date1,5,2); // puis le mois
$jbeginning_year = substr($special_flash_selling_beginning_date1,0,4); // et l\'annee
$jbeginning_hour = substr($special_flash_selling_beginning_date1,11,2); // et l\'heure
$jbeginning_minute = substr($special_flash_selling_beginning_date1,14,2); // et la minute
$jbeginning_second = substr($special_flash_selling_beginning_date1,17,2); // et la seconde

$timestamp_beginning_flash_selling_date = mktime($jbeginning_hour,$jbeginning_minute,$jbeginning_second,$jbeginning_month,$jbeginning_days,$jbeginning_year);

// Now
$today =time();

$specials_query = tep_db_query("select specials_new_products_price, expires_date from " . TABLE_SPECIALS . " where products_id = '" . (int)$specials['products_id'] . "' and status = '1' order by specials_new_products_price, expires_date limit 1");
$special = tep_db_fetch_array($specials_query);
$new_price = $special['specials_new_products_price'];

if ($status_flash_selling != '') {
$new_price_flash_selling = tep_get_products_special_price_flash_selling($specials['products_id']);
} else {
$new_price_flash_selling = 0;
}

if (($status_special =='0') && ($status_flash_selling =='0')) {
//$products_price = $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id']));
$products_price_dizaines = '<span class="soloprix_normalb" itemprop="price">'.$currencies->display_price_dizaines($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])).'</span>';
} elseif (($status_special =='0') && ($status_flash_selling =='1') && ($timestamp_end_flash_selling_date > $today) && ($timestamp_beginning_flash_selling_date < $today)) {
$products_price_dizaines = '<span class="soloprix_normalb" itemprop="price">' . $currencies->display_price_dizaines($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span><br> <span class="old-price price">' . $currencies->display_price($new_price_flash_selling, tep_get_tax_rate($specials['products_tax_class_id'])) . '<br> -'. round((($specials['products_price'] - $new_price_flash_selling) / $specials['products_price']) * 100, 0) . '% </span>';
} elseif (($status_special =='1') && ($status_flash_selling =='0')) {
$products_price_dizaines = '<del class="old-price price">' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</del>&nbsp; <span class="soloprix_normalb" itemprop="price">' . $currencies->display_price_dizaines($new_price, tep_get_tax_rate($specials['products_tax_class_id'])) . '</span>';// promos
} elseif(($status_special =='1') && ($status_flash_selling =='1') && ($new_price > $new_price_flash_selling) && ($timestamp_end_flash_selling_date > $today) && ($timestamp_beginning_flash_selling_date < $today)) {
$products_price_dizaines = '<font color=red><del class="old-price price">' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</del></font>&nbsp; <span class="soloprix_normalb" itemprop="price">' . $currencies->display_price_dizaines($new_price_flash_selling, tep_get_tax_rate($specials['products_tax_class_id'])) . '</span><span><br> -'. round((($specials['products_price'] - $new_price_flash_selling) / $specials['products_price']) * 100, 0) . '% </span>';
} elseif(($status_special =='1') && ($status_flash_selling =='1') && ($timestamp_end_flash_selling_date < $today)) {
$products_price_dizaines = '<del class="old-price price">' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</del>&nbsp; <span class="soloprix_normalb" itemprop="price">' . $currencies->display_price_dizaines($new_price, tep_get_tax_rate($specials['products_tax_class_id'])) . '</span>';// promos
} else {
$products_price_dizaines = '<span itemprop="price" class="soloprix_normalb" itemprop="price">'.$currencies->display_price_dizaines($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])).'</span>';
}
// ################# end Added Flash Selling ##################
//Time to stp
$ecart_secondes = ($timestamp_end_flash_selling_date - $today);
$ecart_days = floor($ecart_secondes / (60*60*24));
$ecart_hour = floor($ecart_secondes / (60*60));
$ecart_minutes = floor($ecart_secondes / (60));

//Time to beginning
$ecart_secondes_beginning = ($timestamp_end_flash_start_date - $today);
$ecart_days_beginning = floor($ecart_secondes / (60*60*24));
$ecart_hour_beginning = floor($ecart_secondes / (60*60));
$ecart_minutes_beginning = floor($ecart_secondes / (60));
?>
<script type="text/javascript">
function decompteur(jour,mois,annee,heure,minute,seconde) {
Resultat = "";
now = new Date();
goal = new Date(annee,mois-1,jour,heure,minute,seconde);

ts = Math.abs((now.getTime()/1000)-(goal.getTime()/1000));

if((goal.getTime()/1000) < (now.getTime()/1000)){
location.reload();
}

fjour = Math.floor(ts/(3600*24));
if(fjour<=1) {
Resultat = fjour + " jour + ";
} else {
Resultat = fjour + " jours + ";
}

ts = ts - (fjour*24*3600);
fheure = Math.floor((ts/3600));
if(fheure<10) {
Resultat += " 0" + fheure + "h ";
} else {
Resultat += " " + fheure + "h ";
}

ts = ts - (fheure*3600);
minutes = Math.floor((ts/60));
if(minutes<10) {
Resultat += "0" + minutes + "mn ";
} else {
Resultat += minutes + "mn ";
}

ts = ts - (minutes*60);
fseconde = Math.floor(ts);
if(fseconde<10) {
Resultat += "0" + fseconde + "s"
} else {
Resultat += fseconde + "s"
}
return Resultat
}

function startX() {
document.getElementById("countdown").innerHTML=decompteur(<?php echo $jend_days.','.$jend_month.','.$jend_year.','.$jend_hour.','.$jend_minute.','.$jend_second; ?>);
setTimeout("startX()",1000);
}
window.onload = startX;
</script>
<?php

if (strlen(strip_tags($product['products_description'])) > 0 && PRODUCT_LIST_DESCRIPTION_LIST > 0) {
if (strlen(strip_tags($product['products_description'])) > PRODUCT_LIST_DESCRIPTION_LIST) {
$p_desc_list = '<div id="center">'.tep_image(DIR_WS_IMAGES . 'Horloge.gif', ''). '&nbsp;<span id= "countdown" type="text" disabled="disabled" class="boldText" size="28"></span></div><div class="product-description description-list">'.mb_substr(strip_tags($product['products_description']), 0, PRODUCT_LIST_DESCRIPTION_LIST, 'UTF-8').'...'.'</div>';
}
else {
$p_desc_list = '<div class="product-description description-list">'.strip_tags($product['products_description']).'</div>';
}
} else {
$p_desc_list ='';
}

$products_price = $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id']));
$specials_price_flash_selling = '<span class="soloprix_normal">' . $currencies->display_price_dizaines($specials['specials_price_flash_selling'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span>';

$specials_content .= tep_product_block_build(
$productId = $specials['products_id'],
$productImage = $specials['products_image'],
$productName = $specials['products_name'],
$productAdded = '',
$productManufacturerId = $specials['manufacturers_id'],
$productManufacturerName = '',
$productPrice = $products_price,
//$productPriceNew = $products_price_promos,
$productPriceNew = $specials_price_flash_selling,
$productWeight = '',
$productQuantity = '',
$productModel = '',
$productDescription = $p_desc_list.$p_desc_grid,
$productButtons = true,
$pageComming = FILENAME_FLASH_SELLING,
$elCount = $i
);

}
echo $specials_content;

?>
</ul>
<?php
if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<div class="listing-panel bottom-panel">
<div class="row">
<div class="col-xs-6 displayText"><?php echo $specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></div>
<div class="col-xs-6"><?php echo $specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></div>
</div>
</div>
<?php
}
?>
</div>
<?php
require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

... et là ça marche très bien sauf qu'un seul produit s'affiche!! Je pense que la boucle while est mal écrite ou mal fermée non?

Propulsé par Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)