示例#1
0
    public void Cart2()
    {
        functions db = GetComponent <functions>();

        db.Conn();
        string validator = "";

        int session_id = PlayerPrefs.GetInt("Id");

        int quantity = int.Parse(product3.text);

        db.CheckCart(ProductName2, session_id);
        Debug.Log(Checkif);
        if (Checkif == 0)
        {
            //update
            db.UpdateCart(session_id, ProductName2, quantity);
        }
        else
        {
            //insert

            db.AddCart(session_id, ProductName2, quantity);
            Debug.Log("Product Added to Cart");
        }
    }