Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Override 'Core' model

    Knowledge Base
    2
    2
    528
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      lwilliams-heli last edited by

      Hi,

      I've managed to override many other models using the app->concord->registerModel function however I can't seem to do this for 'Webkul\Core\Core' as it doesn't have a proxy.

      I need to override it because the number formatter is rounding up i.e 10% of £29.99 becomes £3.00 instead of 2.99, so I need to set the attribute on the formatter so the rounding_mode is rounding_floor.

      1 Reply Last reply Reply Quote 0
      • R
        rahul last edited by

        Hi @lwilliams-heli

        This is facades and this is not override this way.
        To override any facades, first of all you need to create own facades in your package extending with main facades (To whom you want to override).
        Now in your facades, you can create method & can write own logic.
        You need to add following line in your packages provider.

        $this->app->bind('core', 'Webkul\your\facades\path');
        

        Thanks

        1 Reply Last reply Reply Quote 0
        • First post
          Last post