Jump to content

function truncateTables()


/rai

Recommended Posts

How are you accessing these functions? Are you overriding AdminImport.php? Are you trying to access it from another file? It's a protected function, so it can only be used inside AdminImport.php.

I'm calling from another file.php in admin folder


	include(_PS_ADMIN_DIR_ . '/../config/config.inc.php');


	include(_PS_ADMIN_DIR_ . '/functions.php');


	include_once '../controllers/admin/AdminImportController.php';
Link to comment
Share on other sites

You can't access the truncateTables function that way. If this code is only for your shop, you can simply change the code to make truncatedTables a public function instead of a protected function. If you are sharing this code with others, you'll need to copy the function to use it outside AdminImportController.php. Or you can create a class that overrides AdminImportController.php so it can access the function.

Link to comment
Share on other sites

You can't access the truncateTables function that way. If this code is only for your shop, you can simply change the code to make truncatedTables a public function instead of a protected function. If you are sharing this code with others, you'll need to copy the function to use it outside AdminImportController.php. Or you can create a class that overrides AdminImportController.php so it can access the function.

OK thanks

 

one more question:

 

to import products, prestashop stores images in img / p

 

Every time I import products creates the images, but does not erase the old. I have checked the option to delete images but only deletes in the database.

 

if I delete everything in the folder before importing, would pass something?

Link to comment
Share on other sites

As long as you're deleting all products and importing them all again, it should be fine to delete all the images starting with numbers in the img/p directories and its subdirectories. It's a bad idea if you're only importing new products, since you'd be losing images for existing products. You could write code that only deletes the images for products that are being added.

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...