osCommerce France : Accueil Forum Portail osCommerce France Réponses aux questions Foire aux contributions

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> [résolu] Modifier le lien de redirection du bouton ajouter au panier, Modifier le lien de redirection du bouton ajouter au panier
fabrice0501
posté 26 Apr 2014, 20:01
Message #1


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 20
Inscrit : 21-January 14
Lieu : 69240
Membre no 32504



Bonsoir,

je cherche depuis un petit moment sur le forum si la question a déjà été traitée mais en vain.

Je voudrais modifier la redirection du bouton "ajouter au panier" de la page catégorie
afin que le client revienne sur cette même page au lieu de "nouveau produit" comme maintenant.

J'ai trouvé cette page :

http://www.oscommerce-fr.info/forum/index....rt=#entry210370

mais ici c'est pour une url précise
alors que je voudrais revenir sur la même page catégorie visité lors du clic "ajouter au panier"
exemple: je suis dans la catégorie légume, je clic sur acheter , et je veux que ça reste sur cette page au lieu d'être redirigé vers nouveau produit.

Merci de vos lumières

Ce message a été modifié par fabrice0501 - 28 Apr 2014, 11:59.
Go to the top of the page
 
Bonbec
posté 26 Apr 2014, 22:53
Message #2


Ceinture marron OSC
Icône de groupe

Groupe : Modérateurs
Messages : 1543
Inscrit : 30-May 06
Lieu : Vichy (03)
Membre no 10583



Bonsoir,

En fait si j'ai bien compris lors du clic sur le bouton "ajouter au panier" dans la fausse page catégorie tu arrives dans le panier et tu voudrais revenir à la catégorie avant le clic sur le bouton "ajouter au panier".
Si c'est cela, le code à ajouter/modifier se trouve dans le catalog/shopping_cart.php.
Trouver :
Code
<div class="buttonSet">
    <span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary'); ?></span>
  </div>

Modifier en :
Code
<div class="buttonSet">
    <span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary'); ?></span>

<?php
   $back = sizeof($navigation->path)-2;
    if (isset($navigation->path[$back])) {
      echo tep_draw_button(IMAGE_BUTTON_CONTINUE_SHOPPING, 'triangle-1-w', tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']));
    }
    ?>
  </div>


--------------------
Config 1 en live : Osc 2.2 très fortement modifié ... UTF-8 et Php 5.4.
Contribs installées : down_for_maintenance_v 2.3 | Estimated Shipping v1.5 | imprint_1_3_5 | low_stock_report_v2.04 | visible_countries_1.2b | Products Tabs | shoppingCart_cleanup_v1.01.0 | + trop de bidouilles persos pas très OsCommerce (erreurs de jeunesse)
Config 2 en local avec UwAmp : Osc Phoenix
Go to the top of the page
 
fabrice0501
posté 27 Apr 2014, 08:02
Message #3


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 20
Inscrit : 21-January 14
Lieu : 69240
Membre no 32504



Bonjour,

et bien en fait c'est presque ça , sauf que je ne voudrais même pas passer par le panier. (j'ai bien mis sur false d’ailleurs dans configuration)

Je voudrais que le client clique sur "ajouter au panier" et reste sur la même page de suite.

Qu'il puisse cliquer sur "ajouter au panier" sur plusieurs produits de la même catégorie sans pour autant qu'il soit obliger de revenir par lui même.
Car à présent, lors du clic "ajouter au panier", ça me ramène sur la page nouveau produit.

merci

ps j'utilise osc 2.3.1
Go to the top of the page
 
Bonbec
posté 27 Apr 2014, 10:24
Message #4


Ceinture marron OSC
Icône de groupe

Groupe : Modérateurs
Messages : 1543
Inscrit : 30-May 06
Lieu : Vichy (03)
Membre no 10583



Re,

Ok. Je viens d'installer la 2.3.1 en local pour voir et le fonctionnement que tu décris n'est pas le fonctionnement par défaut.
Quand je choisis l'option de ne pas aller au panier lors d'un ajout, je reste toujours sur la catégorie.
Tu n'aurais pas installé une contrib qui aurait modifié ce comportement ?


--------------------
Config 1 en live : Osc 2.2 très fortement modifié ... UTF-8 et Php 5.4.
Contribs installées : down_for_maintenance_v 2.3 | Estimated Shipping v1.5 | imprint_1_3_5 | low_stock_report_v2.04 | visible_countries_1.2b | Products Tabs | shoppingCart_cleanup_v1.01.0 | + trop de bidouilles persos pas très OsCommerce (erreurs de jeunesse)
Config 2 en local avec UwAmp : Osc Phoenix
Go to the top of the page
 
fabrice0501
posté 27 Apr 2014, 18:05
Message #5


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 20
Inscrit : 21-January 14
Lieu : 69240
Membre no 32504



je cherche depuis un petit moment mais je ne trouve pas comment modifier les parameters, peut on seulement les changer ?

sinon peut on utiliser un historyback pour la page indexproduit ?

CODE
// customer adds a product from the products page
case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
$attributes = isset($HTTP_POST_VARS['id']) ? $HTTP_POST_VARS['id'] : '';
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
// customer removes a product from their shopping cart
case 'remove_product' : if (isset($HTTP_GET_VARS['products_id'])) {
$cart->remove($HTTP_GET_VARS['products_id']);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
// performed by the 'buy now' button in product listings and review page
case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {
if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
} else {
$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
case 'notify' : if (tep_session_is_registered('customer_id')) {
if (isset($HTTP_GET_VARS['products_id'])) {
$notify = $HTTP_GET_VARS['products_id'];
} elseif (isset($HTTP_GET_VARS['notify'])) {
$notify = $HTTP_GET_VARS['notify'];
} elseif (isset($HTTP_POST_VARS['notify'])) {
$notify = $HTTP_POST_VARS['notify'];
} else {
tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
}
if (!is_array($notify)) $notify = array($notify);
for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");
$check = tep_db_fetch_array($check_query);
if ($check['count'] < 1) {
tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");
}
}
tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
} else {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
break;
case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {
$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
$check = tep_db_fetch_array($check_query);
if ($check['count'] > 0) {
tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
}
tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));
} else {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
break;
case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {
if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid']));
} else {
$cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
}
}


merci
Go to the top of the page
 
fabrice0501
posté 27 Apr 2014, 18:55
Message #6


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 20
Inscrit : 21-January 14
Lieu : 69240
Membre no 32504



j'ai enfin trouvé ou ce cachait les codes des boutons acheter maintenant et détail produits en page index.
Je ne pensai pas les trouver dans les modules biggrin.gif
Mais je bloque pour le code a changer

Comment purrais je modifier : <a href="'.tep_href_link("products_new.php"
afin de rester sur la meme page une fois que le client clic sur le bouton

$p_buy_now_text = '<div class="bg_button2" onMouseOut="this.className=\'bg_button2\';" onMouseOver="this.className=\'bg_button2-act\';">' .tep_draw_button_top() . '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-priority-secondary" role="button"><span class="ui-button-icon-primary ui-icon ui-icon-cart"></span><span class="ui-button-text">'. IMAGE_BUTTON_IN_CART .'</span></a>' . tep_draw_button_bottom().'</div>';

Merci
Go to the top of the page
 
fabrice0501
posté 28 Apr 2014, 11:59
Message #7


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 20
Inscrit : 21-January 14
Lieu : 69240
Membre no 32504



finalement,

j'ai modifié par :

tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) .

problème résolu
merci
Go to the top of the page
 

Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



RSS Version bas débit Nous sommes le : 28th March 2024 - 09:32
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)