Wordpress - displaying different pages depending on user - php

I am using WooCommerce to build a e-commerce website. The business broadly has a few different types of users to get a variety of tasks done. The types are given below;
1) Administrators
2) Distributors
3) Customers
I could achieve the above with the given pre built user types that woocommerce provides.
What i aim to do is to display specific pages depending on who is signed in. Obviously, the three have their own tasks that they need to carry out on the website.
Here for example, I would want the Administrators to view a few extra page in the menu bar.
where as, customers will have their shopping catalogue to view and carry out their checking out experience as built with woocommerce.
I have had a look around different plugins that could possibly achieve this, but couldn't find any yet.

There are many ways to accomplish this task. One way would be to create a page and a page template, that redirects to another page, based on the user's role. Then those pages could re-direct if a user of an invalid role tried to access them. So the do_somthing.php page could redirect to the admin_do_somthing.php, distributors_do_somthing.php and customers_do_somthing.php, and each of those 3 would throw and error or re-direct to the home page if accessed by a user, or anonymous HTTP request, with a different role.
Keywords to lookup: "Worpress pages" "Wordpress templates" "Wordpress user roles" "wp_redirect()"

Related

Google Analytic tracking individual page on User Flow

I am having an OpenCart website and I already had Google tracking already. Page views/session tracking runs well without problem. However when I come to "User FLow" from "Behavior" tab in Google Analytic menu, I can only see sessions/views of only /index.php page, not for other pages. What if I want to see how many sessions/pageviews on other specific pages (contact page / product A / product B page?
For example, I have a page which have a link like this: http://..../onlinestore/index.php?route=product/category&path=120
I want to track how many users come to this page or even how many users click on the link which leads to this page, either is ok.
Since Opencart using mvc and routing mechanism or something like that, i cannot track using normal way. I have another html website which I can track specific page easilly by having the tracking code on each individual page. But not on this php page.
Thank you very much.

Joomla 3 Guests Redirect

So I have few articles in my menu which are for registered users only. I want them to be visible for everyone but if the user is not logged-in once he clicks on the menu I want him get redirected to the login page..
I saw this tutorial: Auto redirect guests to login but it seems outdated, in joomla 3.3 I can't find any "alias" menu item type.
Is there any alternative for that?
Iam using Joomla 3.3.1 with Community Builder.
-Thank you.
There are two ways you could do this really. One is through code and the other is through the administrators panel. I'm assuming based on the question you are interested in the back end solution.
This involves creating two unique menu items with the same name (alias' would need to be different). One which is only visible to logged in users, which points to the component view desired. The second menu is only visible to guests, and will point to the user log in component view with a redirect url set to component view you wish them to be redirected to.
I attached a link below to an article explaining how to only show menu items to guests and have them hide when users are logged in.
http://docs.joomla.org/How_do_you_hide_something_from_logged_in_users%3F

Wordpress - Plugin to differentiate post content by user role

My client wants to have a Wordpress site with two separate types of users in mind. For each of these personas, different post content will be displayed to the user.
Currently, I'm using Query Wrangler to separate content. However, as far as I can tell, it does not have the ability to default to one persona and keep it throughout the site. It's essentially two separate sites I'm building, but with some shared content, which is what's making this difficult.
Are there any plugins or workarounds I can use to get the functionality I need?
I use custom templates along with this plugin to control what types of content my WP users see . http://themehybrid.com/plugins/members It allows you to create custom roles and check against those roles at anytime.

User Authentication with WordPress

I am very new to WordPress; I usually build my sites and web apps using HTML, JQuery, and PHP. This WordPress thing has thrown me for a loop. A little background: Another company has created a new website for us and they created it as a WordPress site. I have the files and WordPress database which is all installed on our servers.
I need to build a user authentication page for users to use to login and view another page. So how do I implement user authentication with WordPress, but not give users access to the WordPress administration, and have the page for the users ensure they're logged in? All of this needs to remain with the overall theme of the WordPress website.
Firstly, when creating WordPress user, you can decide their administration level there.
You can really rein-in your users using this plugin - http://wordpress.org/plugins/user-access-manager.
Now, if i'm not mis-interpreting what you're saying, you want to serve different content to certain users. Well, my friend. Fear not, that's where plugins are handy.
1.
http://wordpress.org/plugins/user-specific-content/ (select specific users by user name, or by role name who can view a specific post content or page content)
2.
http://wordpress.org/plugins/pagerestrict/ (restrict all, none, or certain pages/posts to logged in users only)
If you're unsure how to install, activate, or use the plugin. There are an abundance of youtube & written tutorials for you to utilize. P.S. Don't neglect the wordpress documentation, it's often very informative.

Creating Dynamic Menu Links Outside of Drupal Cache

For our Drupal 7 Commerce site we are trying to create a "portal system". I have it set up with all of the content at this point with all of the content referencing the same taxonomy to filter the respective products and content into either "portal one", "portal two", or both in the same. I have also already set up all the views and content types to display the content appropriately. Everything is 100% but now I need to use either session data or cookies to let the user (anonymous and authenticated) to choose from a pop up with "portal one" and "portal two" (this is already created as well) and change the urls on the main menu accordingly.
Currently the site is set up to have testsite.com/portal1/products as the url for portal 1 products and test site.com/portal2/products as the url for portal 2. The urls are set up exactly the same as this for all of the other content and views.
I also realize that this will get somewhat complex when dealing with users entering the site to internal links. A logic diagram has already been laid out, but that is a point of concern as well.
Session data or cookies would be the way to go. You would want to set this when the user selects a portal. Then, you would check that the user is on the right portal by getting the current url. I'm positive there is a Drupal hook for this.
For reading the cookie/session data there are a couple ways to do this. Firstly, you would probably need to create a module to do this. Drupal has rules and hooks so that you could run your portal routing code only on specific pages. The other option is to run that code on every page load, but that is not recommended by Drupal and it's followers.

Categories