There are strong similarities between charge-parity (CP) violating observables in hadronic B decays (in particular ΔA−CP in B→Kπ) and direct CP violation in kaon decays (ε′): All these observables are very sensitive to new physics (NP) which is at the same time CP and isospin violating (i.e., NP with complex couplings which are different for up quarks and down quarks). Intriguingly, both the measurements of ε′ and ΔA−CP show deviations from their Standard Model predictions, calling for a common explanation (the latter is known as the B→Kπ puzzle). For addressing this point, we parametrize NP using a gauge invariant effective field theory approach combined with a global U(2)3 flavor symmetry in the quark sector (also known as less-minimal flavor violation). We first determine the operators which can provide a common explanation of ε′ and ΔA−CP and then perform a global fit of their Wilson coefficients to the data from hadronic B decays. Here we also include e.g., the recently measured CP asymmetry in Bs→KK as well as the purely isospin violating decay Bs→ϕρ0, finding a consistent NP pattern providing a very good fit to data. Furthermore, we can at the same time explain ε′/ε for natural values of the free parameters within our U(2)3 flavor approach, and this symmetry gives interesting predictions for hadronic decays involving b→d transitions.