Jump to content

import css (attribute textures)


vas

Recommended Posts

AdminImportController.php

How can I add in the public function "attributeImport ()" the ability to load images for textures?

I did the following.... but how to get an id_attribute instead of $nn which should match the name of the image file??????

 

if (isset($info['image']) && $info['image']) {

$file = $info['image'];

$newfile = _PS_COL_IMG_DIR_. $nn . '.jpg';     

if (touch($file)) {
          if (copy($file, $newfile) ) {
$nn = $nn + 2;    
              $this->warnings[] = Tools::displayError('the textures are loaded. ');
          } else {
              $this->warnings[] = Tools::displayError('cannot be copied.');
          }
       } else {
          $this->warnings[] = Tools::displayError('no texture file found.');
       }
        
}

 

 

 

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