Jump to content

Delete Discount forever


waldette
 Share

Recommended Posts

Hello, I want to delete a Discount created previourly in my module with a button. I use the same link as Prestashop

 

<a class='price_discount_delete' title='Eliminar' href='http://xxxxxx.com/index.php?controller=order?deleteDiscount=25'>Delete</a>

 

But the problem is that in the admin panel the discount still showed in the table. But I see that when I execute this link the discount it's removed from products cart, not from admin discount's table.

 

Is it posible to delete the discount from admin panel?

Edited by waldette (see edit history)

Share this post


Link to post
Share on other sites

-.-

 

Im creating a module... i dont want enter to admin panel. Its posible that i explained bad..

 

I have a prducts cart module and i need to delete a discount from cart. When i try to execute above code, its remove from cart but still in db or admin panel.

 

I need to delete discount from everywhere.

Share this post


Link to post
Share on other sites

In that case you must use a query, or create a new discount in the module using the ID

 

$discount = new DIscount($id_discount);

 

then

 

$discount->delete();

 

And yes, you didn't explain well :)

Share this post


Link to 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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More