Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Email notification for new order and cancel order failing.

    Bug Report
    2
    2
    357
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      chemisax last edited by

      Bagisto version: Latest at time of writing this report.

      Hello, some email notifications are failing with the following error:

      TypeError: Argument 1 passed to Webkul/Tax/Helpers/Tax::getTaxRatesWithAmount() must implement interface Webkul/Checkout/Contracts/Cart, instance of Webkul/Sales/Models/Order given on line 1
      

      I've debugged the problem and found that the email template is calling Webkul\Tax\Helpers\Tax::getTaxRatesWithAmount, which expects receiving an instance of Cart but the template is sending an instance of Order.

      The templates affected are:

      • shop.email.sales.order-cancel
      • shop.email.sales.new-order
      • shop.email.sales.new-admin-order

      Example template: https://github.com/bagisto/bagisto/blob/master/packages/Webkul/Shop/src/Resources/views/emails/sales/new-order.blade.php#L159

      Tax helper:
      https://github.com/bagisto/bagisto/blob/master/packages/Webkul/Tax/src/Helpers/Tax.php#L21

      Thank you.

      1 Reply Last reply Reply Quote 1
      • V
        Vaishali Agarwal last edited by

        Hello @chemisax
        Please mention the framework version along with steps to reproduce, as we are not getting this type of issue.

        Emails are working fine.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post