• Resolved ashop1

    (@ashop1)


    Hello, I hope you are very well. I am very interested in this:

    https://wclovers.com/forums/topic/new-tab-at-store-page/

    follow all the steps with art_work: https://docs.wclovers.com/tweaks/#vendor-customer-direct-pay-option

    I have the tab in store page, and I have the tab in provider settings. I also have the wcfmmp-view-store.php template canceled and wcfmmp-view-store-art-works.php created.

    if I edit this last file as for example with a “Hello world” but what I want is for the provider to add information. the problem is that even having everything as inidco ??something does not work for me I did wrong and if I write at the end of the file: wcfmmp-view-store.php this: case ‘brendovi’:
    $ WCFMmp-> template-> get_template (‘store / wcfmmp-view-store-brendovi.php’, array (‘store_user’ => $ store_user, ‘store_info’ => $ store_info));
    break;

    nothing happens, but if I put the opening labels php it gives me a fatal error in the store page.

    I know that then I am doing something wrong in this step that I comment on: wcfmmp-view-store.php

    Please, could you provide me with information to achieve it? From already thank you very much.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Thread Starter ashop1

    (@ashop1)

    if I already saw it, that’s why I even attached the link in my previous message.

    but what you want to achieve is that the provider can edit and complete that tab.

    That is why I also read what you inidcaron in:

    https://wclovers.com/forums/topic/new-tab-at-store-page/

    but in this code I have problems because it gives me a fatal error when I paste it at the end of the deleted file in my child theme wcfmmp-view-store.php:

    <? php
    case ‘brendovi’:
    $ WCFMmp-> template-> get_template (‘store / wcfmmp-view-store-brendovi.php’, array (‘store_user’ => $ store_user, ‘store_info’ => $ store_info));
    break;
    ?>

    Could you tell me what I’m doing wrong please?

    Thread Starter ashop1

    (@ashop1)

    what do you mean by ??

    Add the following code in uppercase and lowercase in the wcfmmp-view-store.php page,

    case ‘brendovi’:
    $ WCFMmp-> template-> get_template (‘store / wcfmmp-view-store-brendovi.php’, array (‘store_user’ => $ store_user, ‘store_info’ => $ store_info));
    break;

    Thread Starter ashop1

    (@ashop1)

    sorry, I just sent you this message and I already figured out how to do it. do not worry I am writing you in vain everything is very clear now I continue.

    you are great and your developments even more. I congratulate you!

    Thread Starter ashop1

    (@ashop1)

    sorry to write to you again. but I did everything as indicated and still does not show what the seller writes in the tab:
    https://wclovers.com/forums/topic/new-tab-at-store-page/

    in wcfmmp-view-store.php (overridden within my child theme, then from wcfm / store (I show you a snippet between policies and review add my new tab):

    case ‘policies’:
    $ WCFMmp-> template-> get_template (‘store / wcfmmp-view-store-policies.php’, array (‘store_user’ => $ store_user, ‘store_info’ => $ store_info));
    break;

    case ‘shipments’:
    $ WCFMmp-> template-> get_template (‘store / wcfmmp-view-store-shipments.php’, array (‘store_user’ => $ store_user, ‘store_info’ => $ store_info));
    break;

    case ‘reviews’:
    $ WCFMmp-> template-> get_template (‘store / wcfmmp-view-store-reviews.php’, array (‘store_user’ => $ store_user, ‘store_info’ => $ store_info));
    break;

    in wcfmmp-view-store-envios.php:

    <? php
    $ vendor_id = $ store_user-> get_id ();
    $ wcfm_vendor_envios = get_user_meta ($ vendor_id, ‘wcfm_vendor_envios’, true);
    ?>

    and in functions.php: (remove the last part of the code add_filter (‘wcfmmp_store_default_template’)

    add_action (‘wcfmmp_rewrite_rules_loaded’, function ($ wcfm_store_url) {
    add_rewrite_rule ($ wcfm_store_url. ‘/ ([^ /] +) / shipments? $’, ‘index.php?’. $ wcfm_store_url. ‘= $ matches [1] & shipments = true’, ‘top’);
    add_rewrite_rule ($ wcfm_store_url. ‘/ ([^ /] +) / posts / page /? ([0-9] {1,}) /? $’, ‘index.php?’. $ wcfm_store_url. ‘= $ matches [1] & paged = $ matches [2] & shipments = true ‘,’ top ‘);
    }, fifty );
    add_filter (‘query_vars’, function ($ vars) {
    $ vars [] = ‘shipments’;
    return $ vars;
    }, fifty );
    add_filter (‘wcfmmp_store_tabs’, function ($ store_tabs, $ store_id) {
    $ store_tabs [‘shipments’] = ‘Shipments’;
    return $ store_tabs;
    }, 50, 2);
    add_filter (‘wcfmp_store_tabs_url’, function ($ store_tab_url, $ tab) {
    if ($ tab == ‘shipments’) {
    $ store_tab_url. = ‘shipments’;
    }
    return $ store_tab_url;
    }, 50, 2);
    add_filter (‘wcfmp_store_default_query_vars’, function ($ query_var) {
    global $ WCFM, $ WCFMmp;
    if (get_query_var (‘shipments’)) {
    $ query_var = ‘shipments’;
    }
    return $ query_var;
    }, fifty );

    add_action (‘end_wcfm_vendor_settings’, function ($ vendor_id) {
    global $ WCFM, $ WCFMmp;
    $ wcfm_vendor_envios = get_user_meta ($ vendor_id, ‘wcfm_vendor_envios’, true);
    ?>
    <! – collapsible ->
    <div class = “page_collapsible” id = “wcfm_settings_form_min_order_amount_head”>
    <label class = “wcfmfa fa-cart-plus”> </label>
    <? php _e (‘shipments’, ‘wc-frontend-manager’); ?> <span> </span>
    </div>
    <div class = “wcfm-container”>
    <div id = “wcfm_settings_form_vendor_invoice_expander” class = “wcfm-content”>
    <? php
    $ WCFM-> wcfm_fields-> wcfm_generate_form_field (array (
    “wcfm_vendor_envios_options” => array (‘label’ => __ (‘shipments’,’ wc-frontend-manager ‘),’ type ‘=>’ textarea ‘,’ class’ => ‘wcfm-textarea wcfm_ele wcfm_full_ele’, ‘ label_class’ => ‘wcfm_title wcfm_ele wcfm_full_ele_title’, ‘value’ => $ wcfm_vendor_envios),
    ));
    ?>
    </div>
    </div>
    <div class = “wcfm_clearfix”> </div>
    <! – end collapsible ->
    <? php
    }, 500);

    add_action (‘wcfm_vendor_settings_update’, function ($ vendor_id, $ wcfm_settings_form) {
    global $ WCFM, $ WCFMmp;
    if (isset ($ wcfm_settings_form [‘wcfm_vendor_envios_options’])) {
    $ wcfm_vendor_envios = $ wcfm_settings_form [‘wcfm_vendor_envios_options’];
    update_user_meta ($ vendor_id, ‘wcfm_vendor_envios’, $ wcfm_vendor_envios);
    }
    }, 500, 2);

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘new tab on store page’ is closed to new replies.