How to add Create Print Label for Custom Shipping method in magento 2Unit Test for overwrite collection class in magento2How to change save path of PDF files in magento 2how to add courier's API in custom shipping MethodMagento offline custom Payment method with drop down listMonolog Error After 2.2 UpgradeHow do I enable to “Create Shipping Label” for a custom shipping method?Magento 2.3 Can't view module's front end page output?Magento2 REST API get all customers detailsPHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Framework\Data\Collection\AbstractDb::setConnection() must implement interfaceMagento 2.1.7 Create Shipping label popup in Order grid view

You've spoiled/damaged the card

Show sparse matrices like chessboards

Old black and white movie: glowing black rocks slowly turn you into stone upon touch

Initialize an array of doubles at compile time

Applicants clearly not having the skills they advertise

Why does a helium balloon rise?

What people are called boars ("кабан") and why?

Can a magnetic field of a large body be stronger than its gravity?

How to apply the "glow" effect to a rectangle with tcolorbox?

What is the Process for Re-certifying Flight Hardware?

Pros and cons of writing a book review?

How to make thick Asian sauces?

Why is Colorado so different politically from nearby states?

How to detach yourself from a character you're going to kill?

Is it OK to bring delicacies from hometown as tokens of gratitude for an out-of-town interview?

Can an old DSLR be upgraded to match modern smartphone image quality

What happens if you do emergency landing on a US base in middle of the ocean?

Word for a small burst of laughter that can't be held back

Why was it possible to cause an Apple //e to shut down with SHIFT and paddle button 2?

Rotated Position of Integers

Does it cost a spell slot to cast a spell from a Ring of Spell Storing?

Unorthodox way of solving Einstein field equations

Did Darth Vader wear the same suit for 20+ years?

Is having a hidden directory under /etc safe?



How to add Create Print Label for Custom Shipping method in magento 2


Unit Test for overwrite collection class in magento2How to change save path of PDF files in magento 2how to add courier's API in custom shipping MethodMagento offline custom Payment method with drop down listMonolog Error After 2.2 UpgradeHow do I enable to “Create Shipping Label” for a custom shipping method?Magento 2.3 Can't view module's front end page output?Magento2 REST API get all customers detailsPHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Framework\Data\Collection\AbstractDb::setConnection() must implement interfaceMagento 2.1.7 Create Shipping label popup in Order grid view






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I follow this document to create a custom shipping method, its works fine.



But I need to add Create Shipping Label functionality for this shipping method. I got these reference Link1 and Link2



They suggest Only UPS, USPS, FedEx, DHL these shipping method have functionality. I need to add my custom shipping method.



Suggest Me, how to add Create Shipping Label for our Custom Shipping method.



What I Did:



I have edit MagentoShippingControllerAdminhtmlOrderShipmentMassPrintShippingLabel to get custom shipping method details.



Then, I try to download shppinglabel for custom shipping method, but setting content not added in this file and also not supported this file.



 <?php
/**
*
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace MagentoShippingControllerAdminhtmlOrderShipment;
use MagentoBackendAppAction;
use MagentoFrameworkAppResponseInterface;
use MagentoFrameworkAppFilesystemDirectoryList;
use MagentoFrameworkModelResourceModelDbCollectionAbstractCollection;
use MagentoUiComponentMassActionFilter;
use MagentoBackendAppActionContext;
use MagentoShippingModelShippingLabelGenerator;
use MagentoFrameworkAppResponseHttpFileFactory;
use MagentoSalesModelResourceModelOrderShipmentCollectionFactory as ShipmentCollectionFactory;
use MagentoFrameworkControllerResultInterface;
use MagentoSalesModelResourceModelOrderCollectionFactory;
use SpipuHtml2PdfHtml2Pdf;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class MassPrintShippingLabel extends MagentoSalesControllerAdminhtmlOrderAbstractMassAction

/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Sales::shipment';

/**
* @var LabelGenerator
*/
protected $labelGenerator;

/**
* @var FileFactory
*/
protected $fileFactory;

/**
* @var CollectionFactory
*/
protected $collectionFactory;

/**
* @var ShipmentCollectionFactory
*/
protected $shipmentCollectionFactory;

protected $logger;
protected $repositoryAddress;

/**
* @param Context $context
* @param Filter $filter
* @param CollectionFactory $collectionFactory
* @param FileFactory $fileFactory
* @param LabelGenerator $labelGenerator
* @param ShipmentCollectionFactory $shipmentCollectionFactory
*/
public function __construct(
Context $context,
Filter $filter,
CollectionFactory $collectionFactory,
FileFactory $fileFactory,
LabelGenerator $labelGenerator,
ShipmentCollectionFactory $shipmentCollectionFactory,
PsrLogLoggerInterface $logger,
MagentoSalesModelOrderAddressRepository $repositoryAddress

)
$this->fileFactory = $fileFactory;
$this->collectionFactory = $collectionFactory;
$this->shipmentCollectionFactory = $shipmentCollectionFactory;
$this->labelGenerator = $labelGenerator;
$this->logger =$logger;
$this->repositoryAddress= $repositoryAddress;
parent::__construct($context, $filter);


/**
* Batch print shipping labels for whole shipments.
* Push pdf document with shipping labels to user browser
*
* @param AbstractCollection $collection
* @return ResponseInterface


My code download file, but its not setting any content to this file.



Suggest me How to Set Custom values to this pdf file and download pdf file.










share|improve this question
























  • Have you found a solution? I am looking for one thanks.

    – Juliano Vargas
    Jun 13 '18 at 13:44

















1















I follow this document to create a custom shipping method, its works fine.



But I need to add Create Shipping Label functionality for this shipping method. I got these reference Link1 and Link2



They suggest Only UPS, USPS, FedEx, DHL these shipping method have functionality. I need to add my custom shipping method.



Suggest Me, how to add Create Shipping Label for our Custom Shipping method.



What I Did:



I have edit MagentoShippingControllerAdminhtmlOrderShipmentMassPrintShippingLabel to get custom shipping method details.



Then, I try to download shppinglabel for custom shipping method, but setting content not added in this file and also not supported this file.



 <?php
/**
*
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace MagentoShippingControllerAdminhtmlOrderShipment;
use MagentoBackendAppAction;
use MagentoFrameworkAppResponseInterface;
use MagentoFrameworkAppFilesystemDirectoryList;
use MagentoFrameworkModelResourceModelDbCollectionAbstractCollection;
use MagentoUiComponentMassActionFilter;
use MagentoBackendAppActionContext;
use MagentoShippingModelShippingLabelGenerator;
use MagentoFrameworkAppResponseHttpFileFactory;
use MagentoSalesModelResourceModelOrderShipmentCollectionFactory as ShipmentCollectionFactory;
use MagentoFrameworkControllerResultInterface;
use MagentoSalesModelResourceModelOrderCollectionFactory;
use SpipuHtml2PdfHtml2Pdf;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class MassPrintShippingLabel extends MagentoSalesControllerAdminhtmlOrderAbstractMassAction

/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Sales::shipment';

/**
* @var LabelGenerator
*/
protected $labelGenerator;

/**
* @var FileFactory
*/
protected $fileFactory;

/**
* @var CollectionFactory
*/
protected $collectionFactory;

/**
* @var ShipmentCollectionFactory
*/
protected $shipmentCollectionFactory;

protected $logger;
protected $repositoryAddress;

/**
* @param Context $context
* @param Filter $filter
* @param CollectionFactory $collectionFactory
* @param FileFactory $fileFactory
* @param LabelGenerator $labelGenerator
* @param ShipmentCollectionFactory $shipmentCollectionFactory
*/
public function __construct(
Context $context,
Filter $filter,
CollectionFactory $collectionFactory,
FileFactory $fileFactory,
LabelGenerator $labelGenerator,
ShipmentCollectionFactory $shipmentCollectionFactory,
PsrLogLoggerInterface $logger,
MagentoSalesModelOrderAddressRepository $repositoryAddress

)
$this->fileFactory = $fileFactory;
$this->collectionFactory = $collectionFactory;
$this->shipmentCollectionFactory = $shipmentCollectionFactory;
$this->labelGenerator = $labelGenerator;
$this->logger =$logger;
$this->repositoryAddress= $repositoryAddress;
parent::__construct($context, $filter);


/**
* Batch print shipping labels for whole shipments.
* Push pdf document with shipping labels to user browser
*
* @param AbstractCollection $collection
* @return ResponseInterface


My code download file, but its not setting any content to this file.



Suggest me How to Set Custom values to this pdf file and download pdf file.










share|improve this question
























  • Have you found a solution? I am looking for one thanks.

    – Juliano Vargas
    Jun 13 '18 at 13:44













1












1








1


1






I follow this document to create a custom shipping method, its works fine.



But I need to add Create Shipping Label functionality for this shipping method. I got these reference Link1 and Link2



They suggest Only UPS, USPS, FedEx, DHL these shipping method have functionality. I need to add my custom shipping method.



Suggest Me, how to add Create Shipping Label for our Custom Shipping method.



What I Did:



I have edit MagentoShippingControllerAdminhtmlOrderShipmentMassPrintShippingLabel to get custom shipping method details.



Then, I try to download shppinglabel for custom shipping method, but setting content not added in this file and also not supported this file.



 <?php
/**
*
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace MagentoShippingControllerAdminhtmlOrderShipment;
use MagentoBackendAppAction;
use MagentoFrameworkAppResponseInterface;
use MagentoFrameworkAppFilesystemDirectoryList;
use MagentoFrameworkModelResourceModelDbCollectionAbstractCollection;
use MagentoUiComponentMassActionFilter;
use MagentoBackendAppActionContext;
use MagentoShippingModelShippingLabelGenerator;
use MagentoFrameworkAppResponseHttpFileFactory;
use MagentoSalesModelResourceModelOrderShipmentCollectionFactory as ShipmentCollectionFactory;
use MagentoFrameworkControllerResultInterface;
use MagentoSalesModelResourceModelOrderCollectionFactory;
use SpipuHtml2PdfHtml2Pdf;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class MassPrintShippingLabel extends MagentoSalesControllerAdminhtmlOrderAbstractMassAction

/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Sales::shipment';

/**
* @var LabelGenerator
*/
protected $labelGenerator;

/**
* @var FileFactory
*/
protected $fileFactory;

/**
* @var CollectionFactory
*/
protected $collectionFactory;

/**
* @var ShipmentCollectionFactory
*/
protected $shipmentCollectionFactory;

protected $logger;
protected $repositoryAddress;

/**
* @param Context $context
* @param Filter $filter
* @param CollectionFactory $collectionFactory
* @param FileFactory $fileFactory
* @param LabelGenerator $labelGenerator
* @param ShipmentCollectionFactory $shipmentCollectionFactory
*/
public function __construct(
Context $context,
Filter $filter,
CollectionFactory $collectionFactory,
FileFactory $fileFactory,
LabelGenerator $labelGenerator,
ShipmentCollectionFactory $shipmentCollectionFactory,
PsrLogLoggerInterface $logger,
MagentoSalesModelOrderAddressRepository $repositoryAddress

)
$this->fileFactory = $fileFactory;
$this->collectionFactory = $collectionFactory;
$this->shipmentCollectionFactory = $shipmentCollectionFactory;
$this->labelGenerator = $labelGenerator;
$this->logger =$logger;
$this->repositoryAddress= $repositoryAddress;
parent::__construct($context, $filter);


/**
* Batch print shipping labels for whole shipments.
* Push pdf document with shipping labels to user browser
*
* @param AbstractCollection $collection
* @return ResponseInterface


My code download file, but its not setting any content to this file.



Suggest me How to Set Custom values to this pdf file and download pdf file.










share|improve this question
















I follow this document to create a custom shipping method, its works fine.



But I need to add Create Shipping Label functionality for this shipping method. I got these reference Link1 and Link2



They suggest Only UPS, USPS, FedEx, DHL these shipping method have functionality. I need to add my custom shipping method.



Suggest Me, how to add Create Shipping Label for our Custom Shipping method.



What I Did:



I have edit MagentoShippingControllerAdminhtmlOrderShipmentMassPrintShippingLabel to get custom shipping method details.



Then, I try to download shppinglabel for custom shipping method, but setting content not added in this file and also not supported this file.



 <?php
/**
*
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace MagentoShippingControllerAdminhtmlOrderShipment;
use MagentoBackendAppAction;
use MagentoFrameworkAppResponseInterface;
use MagentoFrameworkAppFilesystemDirectoryList;
use MagentoFrameworkModelResourceModelDbCollectionAbstractCollection;
use MagentoUiComponentMassActionFilter;
use MagentoBackendAppActionContext;
use MagentoShippingModelShippingLabelGenerator;
use MagentoFrameworkAppResponseHttpFileFactory;
use MagentoSalesModelResourceModelOrderShipmentCollectionFactory as ShipmentCollectionFactory;
use MagentoFrameworkControllerResultInterface;
use MagentoSalesModelResourceModelOrderCollectionFactory;
use SpipuHtml2PdfHtml2Pdf;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class MassPrintShippingLabel extends MagentoSalesControllerAdminhtmlOrderAbstractMassAction

/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Sales::shipment';

/**
* @var LabelGenerator
*/
protected $labelGenerator;

/**
* @var FileFactory
*/
protected $fileFactory;

/**
* @var CollectionFactory
*/
protected $collectionFactory;

/**
* @var ShipmentCollectionFactory
*/
protected $shipmentCollectionFactory;

protected $logger;
protected $repositoryAddress;

/**
* @param Context $context
* @param Filter $filter
* @param CollectionFactory $collectionFactory
* @param FileFactory $fileFactory
* @param LabelGenerator $labelGenerator
* @param ShipmentCollectionFactory $shipmentCollectionFactory
*/
public function __construct(
Context $context,
Filter $filter,
CollectionFactory $collectionFactory,
FileFactory $fileFactory,
LabelGenerator $labelGenerator,
ShipmentCollectionFactory $shipmentCollectionFactory,
PsrLogLoggerInterface $logger,
MagentoSalesModelOrderAddressRepository $repositoryAddress

)
$this->fileFactory = $fileFactory;
$this->collectionFactory = $collectionFactory;
$this->shipmentCollectionFactory = $shipmentCollectionFactory;
$this->labelGenerator = $labelGenerator;
$this->logger =$logger;
$this->repositoryAddress= $repositoryAddress;
parent::__construct($context, $filter);


/**
* Batch print shipping labels for whole shipments.
* Push pdf document with shipping labels to user browser
*
* @param AbstractCollection $collection
* @return ResponseInterface


My code download file, but its not setting any content to this file.



Suggest me How to Set Custom values to this pdf file and download pdf file.







magento2 magento-2.1 shipping shipping-methods labels






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 '17 at 15:35







Rajkumar .E

















asked Nov 8 '17 at 9:06









Rajkumar .ERajkumar .E

1,78551646




1,78551646












  • Have you found a solution? I am looking for one thanks.

    – Juliano Vargas
    Jun 13 '18 at 13:44

















  • Have you found a solution? I am looking for one thanks.

    – Juliano Vargas
    Jun 13 '18 at 13:44
















Have you found a solution? I am looking for one thanks.

– Juliano Vargas
Jun 13 '18 at 13:44





Have you found a solution? I am looking for one thanks.

– Juliano Vargas
Jun 13 '18 at 13:44










1 Answer
1






active

oldest

votes


















0














First of all, Shipping method should be online and offline if you are creating online shipping method than you need to extend your model to AbstractCarrieronline instead of AbstractCarrier also you need to add some class which support AbstractCarrieronline in your model to support and working with AbstractCarrieronline also you need to get API details for creating shipping label from your shipping provider and make and API call during creating shipping label then and only then you will get PDF or PDF will be blank.



Hope this help here you mentioned you had follow inchoo blog it is for offline shipping and your needs seems for online shipping method.






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f200522%2fhow-to-add-create-print-label-for-custom-shipping-method-in-magento-2%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    First of all, Shipping method should be online and offline if you are creating online shipping method than you need to extend your model to AbstractCarrieronline instead of AbstractCarrier also you need to add some class which support AbstractCarrieronline in your model to support and working with AbstractCarrieronline also you need to get API details for creating shipping label from your shipping provider and make and API call during creating shipping label then and only then you will get PDF or PDF will be blank.



    Hope this help here you mentioned you had follow inchoo blog it is for offline shipping and your needs seems for online shipping method.






    share|improve this answer



























      0














      First of all, Shipping method should be online and offline if you are creating online shipping method than you need to extend your model to AbstractCarrieronline instead of AbstractCarrier also you need to add some class which support AbstractCarrieronline in your model to support and working with AbstractCarrieronline also you need to get API details for creating shipping label from your shipping provider and make and API call during creating shipping label then and only then you will get PDF or PDF will be blank.



      Hope this help here you mentioned you had follow inchoo blog it is for offline shipping and your needs seems for online shipping method.






      share|improve this answer

























        0












        0








        0







        First of all, Shipping method should be online and offline if you are creating online shipping method than you need to extend your model to AbstractCarrieronline instead of AbstractCarrier also you need to add some class which support AbstractCarrieronline in your model to support and working with AbstractCarrieronline also you need to get API details for creating shipping label from your shipping provider and make and API call during creating shipping label then and only then you will get PDF or PDF will be blank.



        Hope this help here you mentioned you had follow inchoo blog it is for offline shipping and your needs seems for online shipping method.






        share|improve this answer













        First of all, Shipping method should be online and offline if you are creating online shipping method than you need to extend your model to AbstractCarrieronline instead of AbstractCarrier also you need to add some class which support AbstractCarrieronline in your model to support and working with AbstractCarrieronline also you need to get API details for creating shipping label from your shipping provider and make and API call during creating shipping label then and only then you will get PDF or PDF will be blank.



        Hope this help here you mentioned you had follow inchoo blog it is for offline shipping and your needs seems for online shipping method.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 16 '18 at 6:58









        Patel JaiminPatel Jaimin

        111




        111



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f200522%2fhow-to-add-create-print-label-for-custom-shipping-method-in-magento-2%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form