Jump to content

Manufacturer add logo


Recommended Posts

Hello.

For this client, we have a module to synchronize the catalog, developed by the supplier company.

This module has a function to add brands for the products. But it does not add images for the brand.

function crearFabricante($NombreFabricante)
{
    if($manufacturer = Manufacturer::getIdByName($NombreFabricante))
    {
        $ID_Manufacturer = (int)$manufacturer;
    }
    else
    {
        $manufacturer = new Manufacturer();
        $manufacturer->name = $NombreFabricante;
        $manufacturer->active = 1;
        if(($field_error = $manufacturer->validateFields(UNFRIENDLY_ERROR, true)) === true &&
            ($lang_field_error = $manufacturer->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true && $manufacturer->add())
        {
            $ID_Manufacturer = (int)$manufacturer->id;
        }
        else
        {
            Logger::addLog('Error añadiendo el fabricante : '.$NombreFabricante, 3);
        }
    }    
    return $ID_Manufacturer;
}

I want to modify the module to obtain the image from the provider's website and add it as a logo to the manufacturer. But I don't see that the Manufacturer class has a logo field.

So does anyone know how to add the image to the manufacturer, by code?

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