Making changes to BrichPress files

Posted · Add Comment

Scheduler Forums BirchPress Scheduler Making changes to BrichPress files

This topic contains 18 replies, has 2 voices, and was last updated by  support 10 years, 7 months ago.

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #3397

    Sharon Lin
    Participant

    I want to implement an integration between BirchPress Scheduler Pro and Woocommerece but I don’t want to modify original files.
    Is there a way to copy the necessary files to the child theme and make the modifications there?
    Thank you.

    #3405

    support
    Keymaster

    Hi Sharon,

    There is no need to copy files. You can use hooks to add your features.

    #3409

    Sharon Lin
    Participant

    should there be a list of available hooks?
    we need to know how to hook to your plugin.
    thank you.

    #3416

    support
    Keymaster

    Hi Sharon,

    We are refactoring our code. The new architecture will generate sufficient hooks for customization. We will write a document on how to find the hooks.

    Currently there is no document listing all hooks. For your case, you can hook to filter ‘birchschedule_validate_booking_form_info’ to check if the credit of the customer is enough to book an appointment.
    The example code for this hook is located at ‘birchschedule/classes/logic/birs-calendar-logic.php’. Please refer to it.

    #3419

    Sharon Lin
    Participant

    thank you but this hook is not enough. I need to show woocommerce products on the confirmation page.
    which hook should I use for this?
    will these hooks change once you finish the reconstruction of the plugin?

    #3421

    support
    Keymaster

    The hook is filter ‘birchschedule_ajax_booking_response’.

    The example code for this hook is located at ‘birchschedule/addons/form-builder/birs-addon-form-builder’. Please refer to it.

    We will keep this hook available in the new version.

    #3423

    Sharon Lin
    Participant

    not sure where ‘birchschedule/addons/form-builder/birs-addon-form-builder’ is located. is it a URL? I cannot find it in your website.

    what about the PHP code section available under Scheduler–>Settings–>Custom Code in the admin panel?
    Is this where I can add my changes?
    thank you.

    #3429

    support
    Keymaster

    ‘birchschedule/addons/form-builder/birs-addon-form-builder.php’ is the path of the source code. You can find it at wp-contenct/plugins/birchschedule/addons/form-builder/birs-addon-form-builder.php.

    For your case, it is better to write a separate plugin to fulfill this feature rather than pasting the code under ‘Scheduler>Settings>Custom code.’

    #3435

    Sharon Lin
    Participant

    Does separate plugin means we need to copy the entire BirchPress plugin OR it should be a plugin that uses your hooks to add functionality?
    also, if you have the required hooks then why do we need to develop a different plugin rather than use them in child theme function.php?
    thank you.

    #3436

    support
    Keymaster

    Using hooks in child theme function.php is also a good option.

    #3437

    Sharon Lin
    Participant

    that’s great but we’ll need a list of available hooks in order to utilize this ability and avoid modification to original files.
    can you arrange such a list for us?
    thank you.

    #3453

    support
    Keymaster

    We are not able to give you a document listing all hooks within a few days. If you need any hooks during your development, you can ask us and we will tell you if there is one available.

    #3473

    Sharon Lin
    Participant

    do you have something for registering an appointment as paid?
    thank you.

    #3502

    support
    Keymaster

    You can set ‘post_status’ of the appointment with ‘publish’ and ‘_birs_appointment_payment_status’ with ‘paid’.

    #3503

    Sharon Lin
    Participant

    so to summarize what I need to integrate with woocommerce they way I need:

    1. To check if the credit of the customer is enough to book an appointment hook to filter ‘birchschedule_validate_booking_form_info’ (example code for this hook is located at ‘birchschedule/classes/logic/birs-calendar-logic.php’).
    2. To show woocommerce products on the confirmation page hook to filter ‘birchschedule_ajax_booking_response’. (example code for this hook is located at ‘birchschedule/addons/form-builder/birs-addon-form-builder’).
    3. To confirm the appointment hook to ‘post_status’ of the appointment with ‘publish’.
    4. To update the payment status of the appointment hook to ‘_birs_appointment_payment_status’ with ‘paid’.

    Does that sounds about right?
    thank you.

Viewing 15 posts - 1 through 15 (of 19 total)

The forum ‘BirchPress Scheduler’ is closed to new topics and replies.

Comments are closed.