Show only the products and orders of the current user – woocomerce

I am new to woocommerce and I have an online store, my store has several user roles, one of these roles is the provider role, and I want that when I log in a user with a supplier profile can only see their products and the orders of their products

and seen the wp-vendors plugin but I don’t want to use this pligin

Enumerate all valid orders of subset sums

Given an positive integer $ n$ , we define an order of subset sums to be a sequence of all subsets of $ \{1,\ldots,n\}$ . For example, when $ n=2$ , the sequence $ \emptyset,\{1\},\{2\},\{1,2\}$ is an order of subset sums.

We call an order of subset sums $ S_1,\ldots,S_{2^n}$ valid if there exist real numbers $ 0<x_1<\cdots<x_n$ such that $ \sum_{i\in S_1}x_i<\cdots<\sum_{i\in S_{2^n}}x_i$ . For example, when $ n=2$ , the sequence $ \emptyset,\{1\},\{2\},\{1,2\}$ is a valid order of subset sums, but the sequence $ \emptyset,\{1\},\{1,2\},\{1\}$ is not a valid order of subset sums because we cannot make $ x_1+x_2<x_1$ .

The question is, given $ n$ , how to enumerate all possible valid orders of subset sums. I know this problem cannot be solved in time polynomial in $ n$ , because there may be exponentially many valid orders of subset sums, so an algorithm with exponential time is welcome.

A trivial algorithm would be to iterate over all possible orders of subset sums, and check for each one if it is valid. But I cannot even find an (efficient) way to check if an order of subset sums is valid.

Understanding of big-O massively improved when I began thinking of orders as sets. How to apply the same approach to big-Theta?

Today I revisited the topic of runtime complexity orders – big-O and big-$ \Theta$ . I finally fully understood what the formal definition of big-O meant but more importantly I realised that big-O orders can be considered sets.

For example, $ n^3 + 3n + 1$ can be considered an element of set $ O(n^3)$ . Moreover, $ O(1)$ is a subset of $ O(n)$ is a subset of $ O(n^2)$ , etc.

This got me thinking about big-Theta which is also obviously a set. What I found confusing is how each big-Theta order relates to each other. i.e. I believe that $ \Theta(n^3)$ is not a subset of $ \Theta(n^4)$ . I played around with Desmos (graph visualiser) for a while and I failed to find how each big-Theta order relates to other orders. A simple example Big-Theta example graphs shows that although $ f(n) = 2n$ is in $ \Theta(n)$ and $ g(n) = 2n^2$ is in $ \Theta(n^2)$ , the graphs in $ \Theta(n)$ are obviously not in $ \Theta(n^2)$ . I kind of understand this visually, if I think about how different graphs and bounds might look like but I am having a hard time getting a solid explanation of why it is the way it is.

So, my questions are:

  1. Is what I wrote about big-O correct?
  2. How do big-Theta sets relate to each other, if they relate at all?
  3. Why do they relate to each other the way they do? The explanation is probably derivable from the formal definition of big-Theta (might be wrong here) and if someone could relate the explanation back to that definition it would be great.
  4. Is this also the reason why big-O is better for analysing complexity? Because it is easier to compare it to other runtimes?

How many times does a Mature Animal Companion attack per encounter without orders?

The Mature Animal Companion feat for Rangers (CRB p173) is really ambigious:

If you have the Hunt Prey action, your animal companion assaults the prey even without your orders. During an encounter, even if you don’t use the Command an Animal action, your animal companion can still use 1 action that round on your turn to Stride toward or Strike your prey.
(emphasis mine)

It makes a lot more sense with use instead of have, otherwise I might not even have a Prey for it to Strike.
But in that case, next round, when the Prey is still alive, will my Animal Companion just stand around?

Determining Cumulative Benefit of Orders with Various Items

I’m working on a project to change the location of items in a warehouse to allow me to ship items together which were bought in the purchase order (currently impossible due to conveyor logistics). The problem is, I don’t have enough space to relocate them all and don’t know which items to prioritize.

I have a list of orders, each of which has a given benefit associated with it if I can put the items next to each other. One or more distinct items is associated with each of these orders. The goal is to maximize the value of a given number of relocations.

Here’s the situation that I believe makes this problem difficult:

Let’s say I take the item that appears most frequently as a single item in these orders (call it item A) for my first relocation priority. I then repeat that process for item B, so we will have captured opportunity for single item A orders, single item B orders, and item AB orders.

When I try to repeat this process for item C, I will get benefit from A, B, C, AB, AC, and BC orders. However, if AC orders represent an enormous amount of the opportunity, I would have been better served taking item C as my second priority item, so I would need to change the ranking.

This will only get more complex as items and pairs are added to the list. Does anybody know the best way to prioritize my items?

Global Traffic, 100% US Visitors Etc: Save 10%! Use Coupon “50discount” On All Orders Over $49.99

New Coupon: Save 10%! Use Coupon "tenoff" On All Orders/Services

1: 10.000 International, Targeted Visitors: $ 9.99 (larger packages up to 500k available).

2: Looking for 100% US Web Traffic? => Click Here To View Our Offers <=. Discounts Available.

3: Geo Targeted Traffic: UK, Australia, Canada, Germany, Italy etc…

Global Traffic, 100% US Visitors Etc: Save 10%! Use Coupon “50discount” On All Orders Over $ 49.99

Algorithm for matching couriers to orders in a city

I have a problem that bothers me for a long time and could not find the best approach to it yet.

I hope this is the best place to put this kind of question. If not please direct me to a better place :D.


You are given a city with M shops and N couriers and Q orders to deliver.

M in [0, 10^3], N in [0, 10^3] and Q in [0, 10^4].

Every order has the following details

(time_to_pick_up Ti, delivery_location (xi, yi), shops_location (x, y)).

Every courier has the start_location (cx, cy)


1) Find the matching (couriers-order) that minimises the total usage or couriers.

2) Find the matching (couriers-order) that minimises the total waiting time for all orders (waiting time = (time_when_delivered – time_to_pick_up))


  • an order cannot be picked before time_to_pick_up
  • a courier cannot collect more than 1 order (he must deliver the order before starting a new order)
  • all couriers have same speed

I think this a problem that the Taxi companies (Uber like) solved already for their clients. I tried different greedy approaches in optimising the picking of a couriers but I think this is pretty far from the best solution. I tried to match the problem to a bipartite graph matching problem with no luck.

Thanks in advance for any help.