That method should work; could you provide the URL of a page where you are attempting to implement this, so we can have a look at the code you're working with there?
BTW, you may wish to start testing with a "clean slate" by deleting your browser cookies. Sometimes when a Seller is testing their cart and changing settings in Admin at the same time, their cart-tracking cookie can get confused and starts producing weird cart behavior, so clearing cookies fixes that.