Forum Replies Created
-
Author
-
FD
ParticipantHi,
I have tested with the default WP theme and then it all works like it should. After changing back to Kleo (4.2.12) it breaks. I have also disabled all plugins except WooCommerce and the error is still there when running Kleo theme (4.2.12), but not when running WP default theme.
We are running the lastes versions of all plugins and themes we are using.
We are running Kleo 4.2.12.I will send you an new login. Login from “wp-admin” is disabled due to security.
Use this link to get admin access (Valid in 24 hours):
https://www.fjelltid.no/wp-admin/?wtlwp_token=0c63b5caeb750b616f1c8fc70215e184We have checked the debug log. Nothing there. The only error we can find is this (from the php error log):
COPY CODEThe WC_Cart::get_cart_url function is deprecated since version 2.5. Replace with wc_get_cart_url. The "SyntaxError: Unexpected token < in JSON at position 0" real error is " {"result":"failure","messages":"<ul class=\"woocommerce-error\">\n\t\t\t<li>Vi klarte ikke \u00e5 behandle ordren din. Vennligst pr\u00f8v igjen.<\/li>\n\t<\/ul>\n","refresh":true,"reload":false}"You can reproduce it with this url: https://www.fjelltid.no/fjellbutikken/kasse/?wc-ajax=checkout
Thank you for your help!
FD
ParticipantWe are using this function to redirect the users away from the front page after login.
This function also “hides” the front page while the user is logged in.COPY CODEadd_action('wp', 'check_redirect_page'); function check_redirect_page() { if (is_user_logged_in() && is_page( REPLACE_WITH_FRONTPAGE_PAGE_ID )) { wp_redirect( get_permalink( REPLACE_WITH_PAGE_ID_OF_THE_PAGE_YOU_WANT_TO_BE_REDIRECTED_TO )); exit; } }FD
ParticipantMaybe not by default, but according to this topic it´s possible to add: https://archived.seventhqueen.com/forums/topic/extra-membership-restrictions-how-to
I have used the code from the forum post and the other restrictions is working.
This is my code:
COPY CODE/* Medlemskapsrestriksjoner - These restrictions will appear to be configured in Sweetdate - Memberships */ add_filter('kleo_pmpro_level_restrictions', 'kleo_my_levels_checkmarks'); function kleo_my_levels_checkmarks($settings) { $settings = array ( //NEW RESTRICTION MESSAGES page with name: message array( 'title' => __('Restrict Messages page','kleo_framework'), 'front' => __('Lese private meldinger','kleo_framework'), 'name' => 'message' ), //NEW RESTRICTION SHOP page with name: shop array( 'title' => __('Restrict Shop page','kleo_framework'), 'front' => __('Tilgang til butikken','kleo_framework'), 'name' => 'shop' ), array( 'title' => __('Restrict members directory','kleo_framework'), 'front' => __('Se medlemskatalog','kleo_framework'), 'name' => 'members_dir' ), array( 'title' => __('Restrict viewing other profiles','kleo_framework'), 'front' => __('Se medlemsprofiler','kleo_framework'), 'name' => 'view_profiles' ), array( 'title' => __('Restrict access to groups directory','kleo_framework'), 'front' => __('Tilgang til gruppekatalog','kleo_framework'), 'name' => 'groups_dir' ), array( 'title' => __('Restrict access to single group page','kleo_framework'), 'front' => __('Tilgang til grupper','kleo_framework'), 'name' => 'view_groups' ), array( 'title' => __('Restrict users from viewing site activity','kleo_framework'), 'front' => __('Fjellveggen for hele siden','kleo_framework'), 'name' => 'show_activity' ), array( 'title' => __('Restrict users from sending private messages','kleo_framework'), 'front' => __('Sende private meldinger','kleo_framework'), 'name' => 'pm' ), array( 'title' => __('Restrict users from adding media to their profile using rtMedia or bpAlbum','kleo_framework'), 'front' => __('Laste opp bilder','kleo_framework'), 'name' => 'add_media' ) ); return $settings; } // Setter restriksjoner for sending av meldinger (Restrict profile area - Messages page) add_action('kleo_pmro_extra_restriction_before_my_profile','kleo_my_custom_restrict'); function kleo_my_custom_restrict1() { //full current url $actual_link = kleo_full_url(); //our request uri $uri = str_replace(untrailingslashit(home_url()),"",$actual_link); //restrict messaging page url if(preg_match("/^\/".bp_get_members_root_slug()."\/". bp_get_loggedin_user_username()."\/messages\/?/", $uri)) { $my_restrictions = array('message' => array( //2 - restrict certain levels. 0 -restrict none; 1 - restrict all 'type' => 2, //levels that you apply the restrictions to 'levels' => 1, //Restricts "Turisten" //'not_member' => 1, //restrict users without a membership level //'guest' => 1 // restrict not logged in users ) ); //We use the name "message" from the new restriction added above kleo_check_access('message',$my_restrictions); } } //Restrict Shop page add_filter('kleo_pmpro_match_rules', 'kleo_my_custom_restrict2'); function kleo_my_custom_restrict2($restrictions) { //regular expression for shop page $restrictions["/^\/shop\/?$/"] = array('name' => 'shop'); return $restrictions; }Any ideas what´s wrong?
-
AuthorPosts