Nabbolo Posted September 12, 2015 Share Posted September 12, 2015 Hello everybody, I have a simple task to perform, but I need to automate it because of the huge quantity of products (2000+). Basically I am writing a PHP script, that analyzes the database and in case of specific conditions needs to delete specific product attributes. From the script I can get to the "id_product_attribute" number that I need to delete. At that point I could start going trough all the tables in Prestashop database and delete the records associated with this ID, but I think it wouldn't be so clean, and there would be a risk or residual records that can cause problems. I know that importing in my PHP file some Prestashop classes it would be possible to call the very same Prestashop functions that do this job when I click the "Remove" button in the back office. The question is: do someone of you know how can I do it? I would need to use a function like deleteAttribute(id_product_attribute) every time I need to delete one from the database. Thank you in advance developers!! Ah almost forgetting, I am on 1.6.0.6 Link to comment Share on other sites More sharing options...
Nabbolo Posted September 13, 2015 Author Share Posted September 13, 2015 (edited) Solution found. Looked into the code of AdminProductsController and used the function ajaxProcessDeleteProductAttribute properly integrated into my script. Have a good one! Edited September 13, 2015 by Nabbolo (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now