Sign in to follow this  
Followers 0

Liste des produits dans back office

23 posts in this topic

Posted · Report post

Bonjour,

Actuellement dans le back office, la page "administrer/produits.php" propose la liste des produits par catégorie ou par "Notre Sélection / Coup de coeur?", "Top des ventes ?",...

Quelqu'un a-t'il rajouté la possibilité d'afficher la liste des produits par MARQUE ?

Si oui, pouvez-vous m'orienter sur comment faire ?

Merci

Share this post


: post
Share on other sites

Posted · Report post

Bonjour,

Actuellement dans le back office, la page "administrer/produits.php" propose la liste des produits par catégorie ou par "Notre Sélection / Coup de coeur?", "Top des ventes ?",...

Quelqu'un a-t'il rajouté la possibilité d'afficher la liste des produits par MARQUE ?

Si oui, pouvez-vous m'orienter sur comment faire ?

Merci

Peut etre recuperer la fonction de la boutique <?php affiche_select_marque(); ?> non ?

Share this post


: post
Share on other sites

Posted · Report post

non David, j'ai déjà essayé, ça serait trop simple.

Share this post


: post
Share on other sites

Posted · Report post

je parle de la fonction

function affiche_select_marque() de template.php à adapter comme select_arbo_cat de /administrer/produit.php

Apres chacun sa piste.

Cordialement

Share this post


: post
Share on other sites

Posted · Report post

ouai bonne piste...mais trop compliqué pour moi.

On ne sait jamais, si quelqu'un a la solution, je suis preneur.

Share this post


: post
Share on other sites

Posted · Report post

Je vais regarder la fonction est interressante me manque un peu de temps mais je regarde.

Cordialement,

David

Share this post


: post
Share on other sites

Posted · Report post

merci

Share this post


: post
Share on other sites

Posted · Report post

je patauge, quelqu'un aurait-il une idée/début de réponse ?

En fait je demande ça car quand comme moi on a une marque avec au moins 500 ref réparties dans 4 ou 5 catégories et que l'on veut par exemple modifier un grand nombre de truc sur ces produits, ben c'est plus facile d'afficher tous les produits de la marque sans être obligé d'aller les chercher dans les catégories au risque d'en oublier.

Share this post


: post
Share on other sites

Posted · Report post

je vais me pencher sur ta demande ce soir ....

vue que ça doit ressembler a une demande d'une autre personne du forum mais sur le front office :rolleyes:

donc une recherche par marque dans une categories ou simplement par marque toutes categories confondue ??

Share this post


: post
Share on other sites

Posted · Report post

toutes catégories confondues car en fait le but est d'afficher tous les produits de la marque.

A priori si tu trouves comment faire, je pense que cela pourra aussi servir pour la page administrer/prix.php

Encore merci

Share this post


: post
Share on other sites

Posted · Report post

de quelle version s'agit il ?

Share this post


: post
Share on other sites

Posted · Report post

a vue de nez c'est de la 5.xxx

Share this post


: post
Share on other sites

Posted · Report post

a vue de nez c'est de la 5.xxx

A mon avis, mais je me trompe peut être

Dans /administrer/produits.php > Fonction affiche_liste_produits($frm)

J'ajouterais dans un td du tableau qui affiche les critères, le code suivant (impérativement après le <form method="get" action="<?=$_SERVER['PHP_SELF']?>?page=<?echo (!empty($_GET['page'])) ? $_GET['page'] : 1;?>&mode=recherche"> et avant le </form>

<table width="760" class="tablespace">

							<tr>

								<td>Choisir la marque associ&eacute;e :</td>

							</tr>


							<tr>

								<td>

								<select  name="id_marque" style="width:760" size="5">

									<option value="0">-------------------------------------------</option>

									<?


									$select = mysql_query("SELECT id, nom_".$_SESSION['langue']." FROM peel_marques INNER JOIN peel_sites_pivots ON (marque_id = id) WHERE site_id = '".intval($_SESSION['ecom']['id'])."' ORDER BY position");


									if (mysql_num_rows($select) > 0) {


										while ($nom =  mysql_fetch_array($select)) {


											$selectionne = ($nom['id'] == $frm['id_marque']) ? " selected" : "";


											echo "<option value=\"" . $nom['id'] . "\" $selectionne>".html_entity_decode($nom['nom_'.$_SESSION['langue'].''])."</option>";


											}


										}

									?>

								</select>

								</td>

							</tr>

						</table>
Puis toujours dans la même fonction après if (isset($frm['top_search'])) {if ($frm['top_search'] != "NULL") {$where .= " AND p.on_top = '".$frm['top_search']."'";}} Je mettrais
if (isset($frm['id_marque'])) {if (!empty($frm['id_marque'])) {$where .= " AND p.id_marque= '".$frm['id_marque']."'";}}

Antoine

Share this post


: post
Share on other sites

Posted · Report post

pour moi le code tourne ....donc ce soir repos :rolleyes:

Share this post


: post
Share on other sites

Posted · Report post

(ma version est une 5,2 avec des modifs de la 5,3)

Bravo, merci AEL, cela fonctionne à merveille et c'est pile poile ce qu'il me fallait.

Merci aussi à Macao45 pour ton aide.

Vous êtes géniaux, encore merci à vous.

(si vous avez le même genre de bidouille pour mettre dans la page prix.php, je suis aussi preneur)

Thierry

Share this post


: post
Share on other sites

Posted · Report post

marche tres bien en 5.3 encore merci

Share this post


: post
Share on other sites

Posted · Report post

Comment adapter cette manipulation au fichier administrer/prix.php ?

Je patauge à fond !

Très utile pour moi pour modifier l'ensemble des prix d'une marque.

Merci pour votre aide.

Share this post


: post
Share on other sites

Posted · Report post

bonsoir

peut etre un debut de solution .... integralité de /administrer/prix.php

<?

include("../configuration.inc.php");

necessite_identification();

necessite_priv("admin");

$DOC_TITLE = "Gestion des prix des produits";

include("modeles/haut.php");

switch (vb($_REQUEST['mode'])) {

case "modif" :

if (vb($_REQUEST['catid'])){

affiche_formulaire_modif_prix($_GET['catid']);

}

if (vb($_REQUEST['marq'])){

echo "y a plus qu a faire la fonction";

}

break;

case "modifier" :

foreach($_POST['id'] as $i => $prodid) {

$prix = str_replace(",",".",$_POST['prix'][$i]);

$prix_revendeur = str_replace(",",".",$_POST['prix_revendeur'][$i]);

mysql_query("UPDATE peel_produits SET prix = '".$prix."',prix_revendeur = '".$prix_revendeur."',promotion = '".$_POST['promotion'][$i]."' WHERE id = '".intval($prodid)."'");

}

echo "La modification des prix des produits a été effectuée. Pour modifier les prix d'une autre catégorie, <a href=\"".$_SERVER['PHP_SELF']."\" class=\"label\">cliquez ici</a>";

affiche_formulaire_modif_prix($_POST['catid']);

break;

default :

affiche_liste_prix();

break;

}

include("modeles/bas.php");

/******************************************************************************

* FONCTIONS

*****************************************************************************/

function affiche_formulaire_modif_prix(&$catid) {

global $wwwroot;

global $repertoire_images;

$sql = "SELECT id, prix, nom_".$_SESSION['langue']." as nom, prix, prix_revendeur, promotion FROM peel_produits p, peel_produits_categories pc WHERE pc.produit_id = p.id AND pc.categorie_id = '".intval($catid)."' ORDER BY prix";

$resProd = mysql_query($sql)

or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR());

$sqlCat = "SELECT nom_".$_SESSION['langue']." as nom FROM peel_categories WHERE id = '".intval($catid)."'";

$resCat = mysql_query($sqlCat);

$Cat = mysql_fetch_object($resCat);

?>

<form name="entryform" method="post" action="<?=$_SERVER['PHP_SELF']?>?mode=modif&catid=<?php echo $_GET['catid'] ?>">

<input type="hidden" name="mode" value="modifier">

<input type="hidden" name="catid" value="<?php echo $catid ?>">

<table border="1" cellpadding=0 cellspacing=1 width=100%>

<tr>

<td class="entete" colspan="4">prixne le produit dans la cat&eacute;gorie <?php echo html_entity_decode($Cat->nom) ?></td>

</tr>

<tr><td class="label" align="center">Produit</td><td class="label" align="center">PRIX PUBLIC</td><td class="label" align="center">PRIX REVENDEUR</td><td class="label" align="center">REMISE</td></tr>

<?

if (mysql_num_rows($resProd)>0) {

while ($prod = mysql_fetch_array($resProd)) {

?>

<tr>

<td align="center" class="normal">

<input type="hidden" name="id[]" value="<?echo $prod['id']?>"><a href=produits.php?mode=modif&id=<?echo $prod['id]?>"><?echo html_entity_decode($prod['nom'])?></a>

</td>

<td class="normal" align="center">

<input type="text" name="prix[]" size="15" value="<?echo number_format($prod['prix'],2, '.', '')?>"> &euro; T.T.C

</td>

<td class="normal" align="center">

<input type="text" name="prix_revendeur[]" size="15" value="<?echo number_format($prod['prix_revendeur'],2, '.', '')?>"> &euro; T.T.C

</td>

<td class="normal" align="center">

<input type="text" name="promotion[]" size="15" value="<?php echo number_format($prod['promotion'],2, '.', '');?>"> %

</td>

</tr>

<?

}

} else {

?>

<tr><td colspan="4" align="center">Aucun produit ne figure dans cette cat&eacute;gorie</td></tr>

<?php } ?>

<tr><td colspan="4" align="center"><input type="submit" value="MODIFIER LES PRIX" class="bouton"></td></tr>

<?php

echo "</td></tr></table></form>";

}

function maj_prix($id, $frm, $img) {

}

function affiche_liste_prix()

{

global $wwwroot;

?>

<table border="0" class="tablespace" width="100%">

<tr>

<td class="entete">G&eacute;rer les prix des produits / cat&eacute;gorie</td>

</tr>

<tr>

<td class="normal">

<script type="text/javascript">

function gotoprod(ident){

document.location="<?=$wwwroot?>/administrer/prix.php?mode=modif&catid="+ident;

}

function gotomarq(ident){

document.location="<?=$wwwroot?>/administrer/prix.php?mode=modif&marq="+ident;

}

</script>

<font size="+1"><b>Choisissez votre cat&eacute;gorie :</b></font>

<select name="categorie" class="formulaire1" onChange="java script:gotoprod(this.options[this.selectedIndex].value)">

<option value="NULL">Toutes les cat&eacute;gories</option>

<?php

if (!isset($categorie_id)) { $categorie_id = 0; }

$frm['categories'] = array($categorie_id);

construit_arbo_cat($categorie_options,$frm['categories']);

echo $categorie_options;

?>

</select>

<font size="+1"><b> ou par marques </b></font><select name="marque" class="formulaire1" onChange="java script:gotomarq(this.options[this.selectedIndex].value)">

<option value="NULL">Toutes les marques</option>

<?php

$sql="SELECT * FROM peel_marques";

$req=mysql_query($sql);

while ($l=mysql_fetch_array($req)){

echo "<option value=".$l[id]." > ".$l[nom_fr]." </option>";

}

?>

</select></td>

</tr>

</table>

<?php } ?>

si c'est un truc comme ça .... ça devrait etre possible !!

avez vous des sous marques ? ou que des marques ?

Share this post


: post
Share on other sites

Posted · Report post

je n'ai que des marques

Share this post


: post
Share on other sites

Posted · Report post

Ok donc on va pouvoir faire un petit quelque chose je pense :rolleyes:

ce soir surement

Share this post


: post
Share on other sites

Posted · Report post

mille mercis :rolleyes:

Share this post


: post
Share on other sites

Posted · Report post

comme promis prix.php copier/ coller

<?

include("../configuration.inc.php");

necessite_identification();

necessite_priv("admin");

$DOC_TITLE = "Gestion des prix des produits";

include("modeles/haut.php");

switch (vb($_REQUEST['mode'])) {

case "modif" :

if (vb($_REQUEST['catid'])){

affiche_formulaire_modif_prix($_GET['catid']);

}

if (vb($_REQUEST['marq'])){

affiche_formulaire_marque_prix($_GET['marq']) ;

}

break;

case "modifier" :

foreach($_POST['id'] as $i => $prodid) {

$prix = str_replace(",",".",$_POST['prix'][$i]);

$prix_revendeur = str_replace(",",".",$_POST['prix_revendeur'][$i]);

mysql_query("UPDATE peel_produits SET prix = '".$prix."',prix_revendeur = '".$prix_revendeur."',promotion = '".$_POST['promotion'][$i]."' WHERE id = '".intval($prodid)."'");

}

echo "La modification des prix des produits a été effectuée. Pour modifier les prix d'une autre catégorie, <a href=\"".$_SERVER['PHP_SELF']."\" class=\"label\">cliquez ici</a>";

if (vb($_REQUEST['catid'])){

affiche_formulaire_modif_prix($_POST['catid']);

}

else{

affiche_formulaire_marque_prix($_POST['marq']) ;

}

break;

default :

affiche_liste_prix();

break;

}

include("modeles/bas.php");

/******************************************************************************

* FONCTIONS

*****************************************************************************/

function affiche_formulaire_modif_prix(&$catid) {

global $wwwroot;

global $repertoire_images;

$sql = "SELECT id, prix, nom_".$_SESSION['langue']." as nom, prix, prix_revendeur, promotion FROM peel_produits p, peel_produits_categories pc WHERE pc.produit_id = p.id AND pc.categorie_id = '".intval($catid)."' ORDER BY prix";

$resProd = mysql_query($sql)

or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR());

$sqlCat = "SELECT nom_".$_SESSION['langue']." as nom FROM peel_categories WHERE id = '".intval($catid)."'";

$resCat = mysql_query($sqlCat);

$Cat = mysql_fetch_object($resCat);

?>

<form name="entryform" method="post" action="<?=$_SERVER['PHP_SELF']?>?mode=modif&catid=<?php echo $_GET['catid'] ?>">

<input type="hidden" name="mode" value="modifier">

<input type="hidden" name="catid" value="<?php echo $catid ?>">

<table border="1" cellpadding=0 cellspacing=1 width=100%>

<tr>

<td class="entete" colspan="4">prixne le produit dans la cat&eacute;gorie <?php echo html_entity_decode($Cat->nom) ?></td>

</tr>

<tr><td class="label" align="center">Produit</td><td class="label" align="center">PRIX PUBLIC</td><td class="label" align="center">PRIX REVENDEUR</td><td class="label" align="center">REMISE</td></tr>

<?

if (mysql_num_rows($resProd)>0) {

while ($prod = mysql_fetch_array($resProd)) {

?>

<tr>

<td align="center" class="normal">

<input type="hidden" name="id[]" value="<?echo $prod['id']?>"><a href=produits.php?mode=modif&id=<?echo $prod['id]?>"><?echo html_entity_decode($prod['nom'])?></a>

</td>

<td class="normal" align="center">

<input type="text" name="prix[]" size="15" value="<?echo number_format($prod['prix'],2, '.', '')?>"> &euro; T.T.C

</td>

<td class="normal" align="center">

<input type="text" name="prix_revendeur[]" size="15" value="<?echo number_format($prod['prix_revendeur'],2, '.', '')?>"> &euro; T.T.C

</td>

<td class="normal" align="center">

<input type="text" name="promotion[]" size="15" value="<?php echo number_format($prod['promotion'],2, '.', '');?>"> %

</td>

</tr>

<?

}

} else {

?>

<tr><td colspan="4" align="center">Aucun produit ne figure dans cette cat&eacute;gorie</td></tr>

<?php } ?>

<tr><td colspan="4" align="center"><input type="submit" value="MODIFIER LES PRIX" class="bouton"></td></tr>

<?php

echo "</td></tr></table></form>";

}

function maj_prix($id, $frm, $img) {

}

function affiche_liste_prix()

{

global $wwwroot;

?>

<table border="0" class="tablespace" width="100%">

<tr>

<td class="entete">G&eacute;rer les prix des produits / cat&eacute;gorie</td>

</tr>

<tr>

<td class="normal">

<script type="text/javascript">

function gotoprod(ident){

document.location="<?=$wwwroot?>/administrer/prix.php?mode=modif&catid="+ident;

}

function gotomarq(ident){

document.location="<?=$wwwroot?>/administrer/prix.php?mode=modif&marq="+ident;

}

</script>

<font size="+1"><b>Choisissez votre cat&eacute;gorie :</b></font>

<select name="categorie" class="formulaire1" onChange="java script:gotoprod(this.options[this.selectedIndex].value)">

<option value="NULL">Toutes les cat&eacute;gories</option>

<?php

if (!isset($categorie_id)) { $categorie_id = 0; }

$frm['categories'] = array($categorie_id);

construit_arbo_cat($categorie_options,$frm['categories']);

echo $categorie_options;

?>

</select>

<font size="+1"><b> ou par marques </b></font><select name="marque" class="formulaire1" onChange="java script:gotomarq(this.options[this.selectedIndex].value)">

<option value="NULL">Toutes les marques</option>

<?php

$sql="SELECT * FROM peel_marques";

$req=mysql_query($sql);

while ($l=mysql_fetch_array($req)){

echo "<option value=".$l[id]." > ".$l[nom_fr]." </option>";

}

?>

</select></td>

</tr>

</table>

<?php }

function affiche_formulaire_marque_prix(&$marq) {

global $wwwroot;

global $repertoire_images;

$sql = "SELECT id, prix, nom_".$_SESSION['langue']." as nom, prix, prix_revendeur, promotion FROM peel_produits p WHERE id_marque = '".intval($marq)."' ORDER BY prix";

$resProd = mysql_query($sql)

or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR());

$sqlCat = "SELECT nom_".$_SESSION['langue']." as nom FROM peel_marques WHERE id = '".intval($marq)."'";

$resCat = mysql_query($sqlCat);

$Cat = mysql_fetch_object($resCat);

?>

<form name="entryform" method="post" action="<?=$_SERVER['PHP_SELF']?>?mode=modif&marq=<?php echo $_GET['catid'] ?>">

<input type="hidden" name="mode" value="modifier">

<input type="hidden" name="marq" value="<?php echo $marq ?>">

<table border="1" cellpadding=0 cellspacing=1 width=100%>

<tr>

<td class="entete" colspan="4">prix des produits de la marque <?php echo html_entity_decode($Cat->nom) ?></td>

</tr>

<tr><td class="label" align="center">Produit</td><td class="label" align="center">PRIX PUBLIC</td><td class="label" align="center">PRIX REVENDEUR</td><td class="label" align="center">REMISE</td></tr>

<?

if (mysql_num_rows($resProd)>0) {

while ($prod = mysql_fetch_array($resProd)) {

?>

<tr>

<td align="center" class="normal">

<input type="hidden" name="id[]" value="<?echo $prod['id']?>"><a href=produits.php?mode=modif&id=<?echo $prod['id]?>"><?echo html_entity_decode($prod['nom'])?></a>

</td>

<td class="normal" align="center">

<input type="text" name="prix[]" size="15" value="<?echo number_format($prod['prix'],2, '.', '')?>"> &euro; T.T.C

</td>

<td class="normal" align="center">

<input type="text" name="prix_revendeur[]" size="15" value="<?echo number_format($prod['prix_revendeur'],2, '.', '')?>"> &euro; T.T.C

</td>

<td class="normal" align="center">

<input type="text" name="promotion[]" size="15" value="<?php echo number_format($prod['promotion'],2, '.', '');?>"> %

</td>

</tr>

<?

}

} else {

?>

<tr><td colspan="4" align="center">Aucun produit ne figure dans cette cat&eacute;gorie</td></tr>

<?php } ?>

<tr><td colspan="4" align="center"><input type="submit" value="MODIFIER LES PRIX" class="bouton"></td></tr>

<?php

echo "</td></tr></table></form>";

}

?>

bonne utilisation à vous :rolleyes:

Share this post


: post
Share on other sites

Posted · Report post

Un grand MERCI Macao45, ça fonctionne à merveille :rolleyes:

Share this post


: post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

Twitter Advisto ecommerce

Facebook PEEL Shopping