Friction will always be in the opposite side of the motion, so if you are sliding down the ramp, friction will be directed to the top of the ramp, if you are sliding up the ramp, friction will be down. Always.
In the real life you will have friction everytime, because you can't have a ramp 100% perfect without friction (but this in the real life).
And to put positive or negative will depend on the way of your motion. If you are down, the positive will be down and the negative will be up. Otherwise, if your box is upping in the ramp, then this is the positive and the negative is down.
To solve those problems without problems, try to think on forces separately. For example, you are trying to relate the component "x" with the positive or negative side and with friction ... Believe me, this is much more easier than that

First you think about the P, Px, Py. It is one work that you have to do.
Second, think about the friction. To solve that easily, just see the way of the motion. If it is upping the ramp, friction is down. If it is down the ramp, friction is up. Easy

The last question you got was about the 2nd law of Newton. Yes you are right, F = m.a, however the 2nd law of Newton is applied on motions that necessary
vary the velocity, otherwise the motion will have a velocity constant, which has acceleration equal to zero, which makes the force equal to zero, because you will have F = m . 0 = 0
So, you will have acceleration when the sum of forces are different to zero :). If the sum are equal to zero, you won't have acceleration and the velocity will keep constant.
Now I'm gonna put the box sliding up the ramp with velocity constant:
First of all, if you just drop the box on a random ramp, in what way do you think the box would go? down or up? ofc down because of gravity. So, in order to have the box sliding up the ramp, you will have to have an external force acting on the box and pulling it to the top of the ramp.
So, in this case we will have these forces:

Look the force "T".
This force is responsible to pulling the box to the top of the ramp.
The velocity constant here is obtained the same way of the other case I've posted. Now you will just have to add the force "T" while summing the forces

And yes we have to hide force "P" and put two other forces that represent "P", as you know Px and Py.
Look the picture:

Well, now we have to obey again those two conditions together:
T = Px + Fr
N = PyPy = P.cos(a)
Px = P.sin(a)
Fr = μ . N
P = m.g
T = P.sin(a) + μ . N
T = P.sin(a) + μ . P.cos(a)
T = P. [sin(a) + μ .cos(a)]Later I'm gonna put two other cases with acceleration, thinking the box upping the ramp and downing the ramp.
Feel free to pm me for help too.