That has fixed the Undefined variable: common_li_classes_flat error that is occurring. The cart still doesn’t appear in the mobile menu so it may not be entirely compatible with the theme I am using but I can probably get it to work another way.
Thanks for the help.