Problem in extending oxbasket class

I want to extend oxbasket class to add a new function. But its not working. That func say A() is called on oxbasket object not on my object say mybasketobj.

I am calling that function from basket.tpl eg. $oxcmp_basket->A() where oxcmp_basket contain oxbasket object not mybasketobj. I have registered that in admin using oxbasket => myfolder/core/mybasketobj.

Erro message is ''Function ‘A’ does not exist or is not accessible! (oxBasket) ''
Any help is appreciated.

Hi,

  1. check if myfolder/core/mybasketobj is in /modules directory
  2. clean tmp folder (oxid caches path of class, so maybe this is the case)

No, its in module folder and clearing cache also not working for me.

I assume you need to subclass “oxcmp_basket”, not “oxbasket”…

If I keep that function oxcmp_basket then also same error is coming:

Function ‘A’ does not exist or is not accessible! (oxBasket) because oxcmp_basket contain oxbasket object as I can trace it with debug option.

a) You are shure that you set the method to public?
b) You have described the class in well form? (class [B]mybasketobj[/B] extends [B]mybasketobj_parent[/B]{})
c) When you put in your class a instance-variable, you can see the variable with a vardump?


class myClass extends myClass_parent{
  public $foo='bar
}

d) Try this for debugging. It is a better structered vardump and It shows the public methods of objects, too.
e) You are shure that your class is loaded?


[{$oxbasket|@get_class}]

When it displays mybasketobj, its correct… if mybasketobj is last in chain and $oxbasket is the right template variable.

Same here. It’s not working for me neither. I am not able to overload oxbasket and I am pretty sure, my implementation and the modules settings are correct. :confused:

Edit: Never mind. Deleting cookies solved it magically…

Did you clean the browsercache? I guess, the basketobject is cached in the sesion.

Hi,

What are the settings to inherit the oxbasket.php. I have tried everything but couldnt do it.

my new module class header is as follow…
class my_oxbasket extends my_oxbasket_parent {

this is in the admin section
oxbasket => my_oxbasket

and the file my_oxbasket.php is in module folder…

so what am I doing wrong ???

I just cant execute my function that I have overloaded from oxbasketin my_oxbasket.php

any quick help would be great.

“so what am I doing wrong ???”

…nothing: its an oxid problem since over 2 years :mad::mad::mad:

Hm, using given code i get: “Function ‘A’ does not exist”, then after deleting cookies, function in module is executed as expected.

[QUOTE=nterm;81827]“so what am I doing wrong ???”

…nothing: its an oxid problem since over 2 years :mad::mad::mad:[/QUOTE]

I can’t see your point here.

Regards