Problem with redeclare function – bad practices in the XStore theme

This topic has 4 replies, 2 voices, and was last updated 4 years, 1 months ago ago by Olga Barlow

  • Avatar: stieranka
    stieranka
    Participant
    September 16, 2020 at 15:13

    Hi,
    I’m creating another site with XStore theme, and I need redeclare same functions. However, I found that many functions are in plugin the et-core-plugin.

    e.g. …/et-core-plugin/app/models/customizer/functions.php
    There is a code for the possibility of redeclare:

    “if ( ! function_exists( ‘etheme_catalog_setup’ ) ) …”

    But it is completely useless!!! Why did they put it there?

    Plugins load rather than functions.php from the child theme! Redeclare is therefore complicated – just create plugin that is load before et-core-plugin (and mu-plugins is not the right way to go).

    Redeclare over a child theme is not possible at all!
    This is not a good job…

    Please inform the developers. et-core-plugin is not a good way.
    Thanks.

    Regards,
    Steve

    3 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    September 17, 2020 at 09:06

    Hello,

    etheme_catalog_setup function is located in the xstore/framework/woo.php (line 747) and you are able to change it using child theme and it will work.

    ThemeForest has a number of requirements to submit theme for selling, We have created XStore Core plugin only because of the ThemeForest requirements and moved all the functions and options that couldn’t be placed directly in theme according to these requirements.

    What function from the XStore core plugin do you want to redeclare? Tell us and maybe we’ll find some workaround for you.

    Regards

    Avatar: stieranka
    stieranka
    Participant
    October 8, 2020 at 20:47

    Hm… that function is ok, but I need redeclare function “etheme_cart_quantity” – /et-core-plugin/app/models/customizer/functions.php on line 6419. There are many useful functions that cannot be redeclare in child theme… :-/

    Regards,
    Steve

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    October 9, 2020 at 15:03

    Hello,

    Could you tell us what exactly do you want to change in that function? Maybe we’ll be able to add some filters in the core plugin. Because unfortunately, we can’t move the mentioned functions to the theme.

    Regards

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.