Effacer Commandes Test

2 posts in this topic

Posted · Report post

Bonjour,

 

je souhaite effacer mes commendes tests, en effet j'en ai quelques unes.

 

je fais la fonction suivante qui fonctionne :

function efface_commande($id)
{
	query("DELETE FROM peel_commandes WHERE id = '" . intval($id) . "'");
	query("DELETE FROM peel_commandes_articles WHERE commande_id = '" . intval($id) . "'");
	echo '<p class="global_success">La commande ' . $id . ' a été effacée.</p>';
}

Mais voilà, je gère les stocks aussi, quelle serait la requête pour récupérer les produits et les remettre en stock ?

 

Merci V 7.0.4

Share this post


: post
Share on other sites

Posted · Report post

Bonjour,

 

Vous pouvez annuler la commande avant la suppression avec la fonction update_order_payment_status($id, false, false). Cette fonction réincremente les stocks si besoin et annule la commande.

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

Twitter Advisto ecommerce

Facebook PEEL Shopping