What are best practices for collecting consent for marketing emails during checkout?

I'm working on an ecommerce website that uses Mailchimp for both transactional and marketing email. Users can purchase items without creating an account on the website.

Per Mailchimp's terms of service, we cannot send marketing email to customers without their explicit permission. We would like to give users an opportunity to opt in to marketing email during the checkout flow.

Any suggestions on the best way to encourage users to opt in to marketing email without discouraging them from completing the checkout process?