WCMp bundle is available at a slashed price

Grab It Now

show virtual and persons as default

show virtual and persons as default2019-03-07T05:37:55-05:00

Home Support Forum WCMp Advanced Frontend Manager show virtual and persons as default

WCMp Advanced Frontend Manager

show virtual and persons as default Resolved

  • Author
    Posts
  • gionruno25
    Participant
    Post count: 76

    Hi there,
    I would like to know if is it possible to make the following options as default, so customers do not need to check or to change every time, because, by the way, the events that vendors sell, require always the same options.

    – virtual (new Product page) always checked
    – has persons (new Product page) always checked
    – customers can Cancel order -> “2 days before”
    – Calendar “not available by default”

    Thanks a lot
    Giovanni

  • NerdySupportExpert Moumita
    Keymaster
    Post count: 3022

    Hi @gionruno25, thanks for the query.

    Our replies are inline :
    – virtual (new Product page) always checked
    >> Add this code to the function.php of the current active theme :

    add_filter (‘wcmp_product_type_options’, ‘autocheck_wcmp_afm_product_type_options’);
    function autocheck_wcmp_afm_product_type_options ($ arr) {
        $arr['virtual']['default'] = "yes"; 
        $arr['downloadable']['default'] = "yes"; 
        return $arr;
    }

    – has persons (new Product page) always checked
    >> We will add a fix in our next update. For now, please access the plugin file via wcmp-frontend_product_manager/assets/frontend/js/product-booking.js: in this js file just modify line no 75 with

    if ( type == 'booking' && type !== "accommodation-booking" ) {
                        $( '#_wc_booking_has_persons' ).prop( 'checked', true );
                        $( '#_wc_booking_has_resources' ).prop( 'checked', false );
                    }

    – customers can Cancel order -> “2 days before”
    >> Override the html-product-data-general.php template file and modify line number 24 with $cancel_limit = 2; and modify line no 112 with <option selected value="month" <?php selected( $cancel_limit_unit, 'month' ); ?>><?php esc_html_e( 'Month(s)', 'woocommerce-bookings' ); ?></option
    You will get overriding instruction via wcmp-frontend_product_manager/views/products/booking/html-product-data-general.php

    – Calendar “not available by default”
    >> Override the html-product-data-general.php: replace value at line no 85 with
    <option value="" <?php selected( $bookable_product->get_calendar_display_mode( 'edit' ), '' ); ?>><?php esc_html_e( 'Calendar always visible', 'woocommerce-bookings' ); ?></option>
    and add selected on option at line no 84
    <option value="" selected <?php selected( $bookable_product->get_calendar_display_mode( 'edit' ), '' ); ?>><?php esc_html_e( 'Display calendar on click', 'woocommerce-bookings' ); ?></option>

    Let us know if you have any further query.

  • gionruno25
    Participant
    Post count: 76

    hi thanks for the answer.
    when i add:
    `<datetime=”2019-02-14T14:41:00+00:00″><option selected value=”month” <?php selected( $cancel_limit_unit, ‘month’ ); ?>><?php esc_html_e( ‘Month(s)’, ‘woocommerce-bookings’ ); ?></option

    it actaully works but it has some conflict. basically the button “add time of range” in the availability tab, will not execute any action.
    So i decide to delete the code you gave me.

    Also th code belowe does not work as well.
    add_filter (‘wcmp_product_type_options’, ‘autocheck_wcmp_afm_product_type_options’);
    function autocheck_wcmp_afm_product_type_options ($ arr) {
    $arr[‘virtual’][‘default’] = “yes”;
    $arr[‘downloadable’][‘default’] = “yes”;
    return $arr;
    }

    thanks a lot

  • NerdySupportExpert Moumita
    Keymaster
    Post count: 3022

    Hi @gionruno25, can you share a temporary admin, vendor and FTP access, so we can check.

    While sharing the access, don’t forget to mark the response as private.

  • Anonymous
    Post count: 50

    Hi @gionruno25,

    Since we haven’t heard back from you, we are closing this thread. Please open a new one in case of any concern.

    Thanks!

The topic ‘show virtual and persons as default’ is closed to new replies.