Class extentions

I’m extending the oxarticle class, and don’t have any problem with that, but when I try to use a function from the parent class, I always get Function ‘getVariantsCount’ does not exist or is not accessible!
Anyone can point me what i’m doing wrong?

‘oxarticle’ => …/Model/…_oxArticle’

Where do you call function?

I’m calling the getVariantsCount function in my extended_oxarticle class.

Can i use :
public function getVariantsCount()
{
return parent::getVariantsCount();
}

Which version you use in your metadata.php? 1.0, 1.1, 2.0, 2.1?
What does your metadata look like?
What does your class look like?

metadata 1.0
class myclass_oxArticle extends myclass_oxArticle_parent
{
protected $_ProductPrice = null;

public function getVar()
{
    return parent::getVariantsCount();
}
public function checkAdminVATMode(){
   
    if($this->getConfig()->getConfigParam('blEnterNetPrice')){
        return true;
    }
    return false;
}

ect…

$sMetadataVersion = ‘1.0’;

/**

  • Module information
    /
    $aModule = array(
    ‘id’ => ‘MyModule’,
    ‘title’ => ‘mymodule’,
    ‘description’ => ‘mymodule’,
    ‘thumbnail’ => ‘picture.png’,
    ‘version’ => ‘1.0’,
    ‘author’ => ‘mymodule’,
    ‘email’ => ‘[email protected]’,
    ‘url’ => ‘’
    , ‘extend’ => array
    (
    /
    *
    * Model Extensions.
    */

     'oxarticle'             => 'MyModule/Model/mymodule_oxArticle'
    

    )
    );

All my custom function are working without a problem, but when i try to call a function in my productmain.tpl from oxarticle(like getVariantsCount) i get Function ‘getVariantsCount’ does not exist or is not accessible!

Do you see the difference between myclass_oxArticle & mymodule_oxArticle ?

sorrry i mistyped the name(but its the same name) my custom functions are working fine.

public function getVar()
{
return parent::getVariantsCount();
}

I think this is not working, the function name must be the same I think public function getVariantsCount()

All my custom function are working without a problem, but when i try to call a function in my productmain.tpl from oxarticle(like getVariantsCount) i get Function ‘getVariantsCount’ does not exist or is not accessible!

oxarticle is a model and no controller, only controller functions you can use in frontend templates like $oView->...

I tried with public function getVariantsCount() but still the same problem…

Which shop version you use?

Did you try

$oDetailsProduct->getVariantsCount();

?

Yes, I tried that but still the same problem.
oxid version 4.6

This is your problem… The function getVariantsCount don’t exists in Version 4.6.0 see https://docs.oxid-esales.com/sourcecodedocumentation/4.6.0.44406/

Oh, not the same shop like in your avatar?
Yes, that’s your problem…