Home Forums Theme Support Dokan Overriding 'wp-content/plugins/dokan/classes/ajax.php' ?

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  towhid 3 years, 10 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #65883

    David
    Member
    Post count: 2

    Dear weDevs

    Sekander helpfully showed me how to override ‘wp-content/plugins/dokan/templates/edit/attributes.php' by placing my custom version into ‘wp-content/themes/dokan-child/dokan/edit/attributes.php'

    I notice that I must create a new ‘dokan' folder inside my child theme folder and then follow the same path but remove ‘templates'. I have found this works perfectly to override the dokan-plugin file with my custom file.

    However, I wish also to override ‘wp-content/plugins/dokan/classes/ajax.php' with my own file in my ‘dokan-child' theme. So far I have failed.

    What folder structure should I employ inside my ‘dokan-child' theme?

    Kind regards
    David

    #66001

    towhid
    Participant
    Post count: 4505

    Hello David,

    I will discuss about this with our developer team. Please allow me some time. Hope I will come back to you with a right solution.

    Thanks

    #66089

    towhid
    Participant
    Post count: 4505

    Hello David,

    You can only override the template folder's files but nothing else.

    wp-content/plugins/dokan/classes/ajax.php is root file. So you can not override.

    Thanks

    #66977

    David
    Member
    Post count: 2

    Thank you Towhid

    Is there a way I can override one of the functions within ‘wp-content/plugins/dokan/classes/ajax.php' without hacking the code?

    Specifically, I would like to override ‘function dokan_pre_define_attribute() {…}' with my own version. I could simply type over the code in ‘wp-content/plugins/dokan/classes/ajax.php'. But this is not ideal since I would have to re-key my custom code after every Dokan update.

    I would prefer to override through my child theme, ‘wp-content/themes/dokan-child'.

    I have tried a function inside my child theme ‘functions.php' but this is ignored.

    Is there another way? Or must I hack the code in ‘ajax.php'?

    Kind regards
    David

    #67262

    towhid
    Participant
    Post count: 4505

    Hello David,

    You must extend the class. If you do not know how to extend the class please hire a developer.

    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Overriding 'wp-content/plugins/dokan/classes/ajax.php' ?’ is closed to new replies.