Jump to content

how to use Product class from a module


krismb

Recommended Posts

Hello

 

I am writing a module that need to check if a ean13 exist or not. I am reading a csv file and if the ean13 does not exist I need to create it.

 

Anyway : I created a new module and in my module I have a function like that

public function product($a)
    {    
          $txt = '<br/>'.$a[12];
          $ean13 =$a[12];
          if ( product::getIdByEan13($ean13)){
            $txt .= ' update';
          }
          else
          {  
            $txt .= ' creation';
          }
    return $txt;
    }

But I have this

[PrestaShop] Fatal error in module importcatalogue:
Class 'product' not found

How do I add product class ?

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