Jump to content

Redirection confirmFreeOrder


Recommended Posts

Bonjour à tous,

 

Sur un de mes produit dont le prix est nul, la fonction de base de Presta est de ne pas proposer le paiement mais  de confirmer la commande directement. De la s'opére l'envoi d'un mail et une redirection vers l'historique des commande.

Sur presta 1.5.6 le bout de code qui je suppose doit être modifier est dans /theme/js/order-opc.js

function confirmFreeOrder()
{
	if ($('#opc_new_account-overlay').length != 0)
		$('#opc_new_account-overlay').fadeIn('slow');
	else
		$('#opc_account-overlay').fadeIn('slow');
	$('#opc_delivery_methods-overlay').fadeIn('slow');
	$('#opc_payment_methods-overlay').fadeIn('slow');
	$.ajax({
		type: 'POST',
		url: orderOpcUrl,
		async: true,
		cache: false,
		dataType : "html",
		data: 'ajax=true&method=makeFreeOrder&token=' + static_token ,
		success: function(html)
		{
			var array_split = html.split(':');
			if (array_split[0] === 'freeorder')
			{
				if (isGuest)
					document.location.href = guestTrackingUrl+'?id_order='+encodeURIComponent(array_split[1])+'&email='+encodeURIComponent(array_split[2]);
				else
					document.location.href = historyUrl;
			}
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
			if (textStatus != 'abort')
				alert("TECHNICAL ERROR: unable to confirm the order \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);

je pense qu'il faut modifier document.location.href = historyUrl; mais comment faire pour la remplacer par une page static ou autre.

 

dans mon cas c'est  une page ou l'on récupéré un billet à imprimer .

 

Trés bon weekend à tous

Link to comment
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
×
×
  • Create New...