Osg

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Osg

  • Rank
    Just arrived
  1. Okay, I have an update - in case someone is interested and I manage to solve this, it is possible to see my steps for the progress: I used a custom module with a plugin to override the magento model which initiates the pdf: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Sales\Model\Order\Pdf\Invoice"> <plugin name="overwrite_m2e_amazon_order_pdfinvoice" type="MyVendor\MyModule\Plugin\Model\Order\PdfInvoice" /> </type> </config> This is working great. I tested this by creating a class which is calling the invoice pdf in exact the same way, M2e is doing this in vendor/m2epro/magento2-extension/Model/Cron/Task/Amazon/Order/SendInvoice.php on line 245 - 253. With my plugin, the desired PDF is created. Without the plugin, the old magento default PDF is created. If I know upload this and check what M2e is doing in the situation of creating a new invoice, I see the following error message: And this is very confusing. I did not found any ocurrency of this metadata anywhere in the m2e code. Furthemore, I did not change anything other than replacing the method for rendering the pdf.
  2. Hello, I have a Magento2 with the M2E extension running to manage Amazon products and orders. Currently the system automatically uploads the PDF invoice to Amazon. But it is the default one. I am using another module to create invoice PDF. This is working everywhere in Magento but not in M2E. I already found the file, where the pdf render function is called in m2e but passing my own PDF file stream string instead fails without an error. (Model/Cron/Task/Amazon/Order/SendInvoice.php line241) It only displays that the merchant did not upload a PDF in the amazon administration. As this code is called from the cron it is hard to debug and find out what is wrong. Also I always have to wait for the next order to check if this is working. Has anybody done this before? Thanks in advance