updated for woo commerce

Need to revise with using hooks.