Thanks Tony your answer really helped a lot.
Another simple thing i want to ask. Now i want variant attribute values ID how do i get this information.
I can get variant id using
Also, I cannot do var_dump() or print_r() from the views just for debugging purpose how can i do those.
Debugging through var/run/ codes helps me now to not rebuild application so often.