Create Construct Function Magento2 Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Magento 2: Plugin class does not existUnable to create order from admin in magento 2Magento offline custom Payment method with drop down listMagento 2 Create dynamic array From different Model Collection to use in multi select in gridunable to solve the error in magento2Magento 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 interfaceIncompatible argument type error during compilation in Magento2.2.5?Add Construct In This Class
What LEGO pieces have "real-world" functionality?
Cold is to Refrigerator as warm is to?
What is the electric potential inside a point charge?
How to market an anarchic city as a tourism spot to people living in civilized areas?
Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?
grandmas drink with lemon juice
How do you clear the ApexPages.getMessages() collection in a test?
Classification of bundles, Postnikov towers, obstruction theory, local coefficients
If A makes B more likely then B makes A more likely"
Why use gamma over alpha radiation?
Why does tar appear to skip file contents when output file is /dev/null?
Strange behaviour of Check
Do working physicists consider Newtonian mechanics to be "falsified"?
How can you insert a "times/divide" symbol similar to the "plus/minus" (±) one?
What is the order of Mitzvot in Rambam's Sefer Hamitzvot?
Slither Like a Snake
Can I add database to AWS RDS MySQL without creating new instance?
How to set letter above or below the symbol?
What do I do if technical issues prevent me from filing my return on time?
What items from the Roman-age tech-level could be used to deter all creatures from entering a small area?
How many things? AとBがふたつ
Are my PIs rude or am I just being too sensitive?
Is above average number of years spent on PhD considered a red flag in future academia or industry positions?
Using "nakedly" instead of "with nothing on"
Create Construct Function Magento2
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Magento 2: Plugin class does not existUnable to create order from admin in magento 2Magento offline custom Payment method with drop down listMagento 2 Create dynamic array From different Model Collection to use in multi select in gridunable to solve the error in magento2Magento 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 interfaceIncompatible argument type error during compilation in Magento2.2.5?Add Construct In This Class
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
i want to create class construct function in this model this is payment model PaymentMethod extends MagentoPaymentModelMethodAbstractMethod
i try but getting an error what wrong I am doing.
use MagentoFrameworkDataObject;
use MagentoPaymentModelInfoInterface;
use MagentoPaymentModelMethodInterface;
use MagentoPaymentObserverAbstractDataAssignObserver;
use MagentoQuoteApiDataPaymentMethodInterface;
use MagentoSalesModelOrderPayment;
use CryozonicStripePaymentsHelperLogger;
public function __construct(
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoPaymentModelMethodLogger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = []
)
parent::__construct(
$context,
$registry,
$extensionFactory,
$customAttributeFactory,
$resource,
$resourceCollection,
$data
);
$this->_paymentData = $paymentData;
$this->_scopeConfig = $scopeConfig;
$this->logger = $logger;
$this->initializeData($data);
magento2
add a comment |
i want to create class construct function in this model this is payment model PaymentMethod extends MagentoPaymentModelMethodAbstractMethod
i try but getting an error what wrong I am doing.
use MagentoFrameworkDataObject;
use MagentoPaymentModelInfoInterface;
use MagentoPaymentModelMethodInterface;
use MagentoPaymentObserverAbstractDataAssignObserver;
use MagentoQuoteApiDataPaymentMethodInterface;
use MagentoSalesModelOrderPayment;
use CryozonicStripePaymentsHelperLogger;
public function __construct(
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoPaymentModelMethodLogger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = []
)
parent::__construct(
$context,
$registry,
$extensionFactory,
$customAttributeFactory,
$resource,
$resourceCollection,
$data
);
$this->_paymentData = $paymentData;
$this->_scopeConfig = $scopeConfig;
$this->logger = $logger;
$this->initializeData($data);
magento2
add a comment |
i want to create class construct function in this model this is payment model PaymentMethod extends MagentoPaymentModelMethodAbstractMethod
i try but getting an error what wrong I am doing.
use MagentoFrameworkDataObject;
use MagentoPaymentModelInfoInterface;
use MagentoPaymentModelMethodInterface;
use MagentoPaymentObserverAbstractDataAssignObserver;
use MagentoQuoteApiDataPaymentMethodInterface;
use MagentoSalesModelOrderPayment;
use CryozonicStripePaymentsHelperLogger;
public function __construct(
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoPaymentModelMethodLogger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = []
)
parent::__construct(
$context,
$registry,
$extensionFactory,
$customAttributeFactory,
$resource,
$resourceCollection,
$data
);
$this->_paymentData = $paymentData;
$this->_scopeConfig = $scopeConfig;
$this->logger = $logger;
$this->initializeData($data);
magento2
i want to create class construct function in this model this is payment model PaymentMethod extends MagentoPaymentModelMethodAbstractMethod
i try but getting an error what wrong I am doing.
use MagentoFrameworkDataObject;
use MagentoPaymentModelInfoInterface;
use MagentoPaymentModelMethodInterface;
use MagentoPaymentObserverAbstractDataAssignObserver;
use MagentoQuoteApiDataPaymentMethodInterface;
use MagentoSalesModelOrderPayment;
use CryozonicStripePaymentsHelperLogger;
public function __construct(
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoPaymentModelMethodLogger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = []
)
parent::__construct(
$context,
$registry,
$extensionFactory,
$customAttributeFactory,
$resource,
$resourceCollection,
$data
);
$this->_paymentData = $paymentData;
$this->_scopeConfig = $scopeConfig;
$this->logger = $logger;
$this->initializeData($data);
magento2
magento2
edited yesterday
Amit Bera♦
60k1677178
60k1677178
asked yesterday
tgetge
34
34
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
If you extend MagentoPaymentModelMethodAbstractMethod
then your __construct
function should have followed below classes parameters
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
Logger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = [],
DirectoryHelper $directory = null
So, your __construct
have minimum below code
<?php
namespace YourNameSpace;
use MagentoDirectoryHelperData as DirectoryHelper;
use CryozonicStripePaymentsHelperLogger;
class YourClass extends MagentoPaymentModelMethodAbstractMethod
public function __construct(
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoPaymentModelMethodLogger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = [],
DirectoryHelper $directory = null
)
parent::__construct(
$context,
$registry,
$extensionFactory,
$customAttributeFactory,
$paymentData,
$scopeConfig,
$logger,
$resource,
$resourceCollection,
$data,
$directory
);
not working for me
– tge
yesterday
share your code
– Amit Bera♦
yesterday
see my question i updated
– tge
yesterday
see my code? need help
– tge
yesterday
1
Answer updated andYourNameSpace
&YourClass
with your namespace & class repectively.
– Amit Bera♦
yesterday
|
show 7 more comments
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269957%2fcreate-construct-function-magento2%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
If you extend MagentoPaymentModelMethodAbstractMethod
then your __construct
function should have followed below classes parameters
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
Logger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = [],
DirectoryHelper $directory = null
So, your __construct
have minimum below code
<?php
namespace YourNameSpace;
use MagentoDirectoryHelperData as DirectoryHelper;
use CryozonicStripePaymentsHelperLogger;
class YourClass extends MagentoPaymentModelMethodAbstractMethod
public function __construct(
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoPaymentModelMethodLogger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = [],
DirectoryHelper $directory = null
)
parent::__construct(
$context,
$registry,
$extensionFactory,
$customAttributeFactory,
$paymentData,
$scopeConfig,
$logger,
$resource,
$resourceCollection,
$data,
$directory
);
not working for me
– tge
yesterday
share your code
– Amit Bera♦
yesterday
see my question i updated
– tge
yesterday
see my code? need help
– tge
yesterday
1
Answer updated andYourNameSpace
&YourClass
with your namespace & class repectively.
– Amit Bera♦
yesterday
|
show 7 more comments
If you extend MagentoPaymentModelMethodAbstractMethod
then your __construct
function should have followed below classes parameters
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
Logger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = [],
DirectoryHelper $directory = null
So, your __construct
have minimum below code
<?php
namespace YourNameSpace;
use MagentoDirectoryHelperData as DirectoryHelper;
use CryozonicStripePaymentsHelperLogger;
class YourClass extends MagentoPaymentModelMethodAbstractMethod
public function __construct(
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoPaymentModelMethodLogger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = [],
DirectoryHelper $directory = null
)
parent::__construct(
$context,
$registry,
$extensionFactory,
$customAttributeFactory,
$paymentData,
$scopeConfig,
$logger,
$resource,
$resourceCollection,
$data,
$directory
);
not working for me
– tge
yesterday
share your code
– Amit Bera♦
yesterday
see my question i updated
– tge
yesterday
see my code? need help
– tge
yesterday
1
Answer updated andYourNameSpace
&YourClass
with your namespace & class repectively.
– Amit Bera♦
yesterday
|
show 7 more comments
If you extend MagentoPaymentModelMethodAbstractMethod
then your __construct
function should have followed below classes parameters
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
Logger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = [],
DirectoryHelper $directory = null
So, your __construct
have minimum below code
<?php
namespace YourNameSpace;
use MagentoDirectoryHelperData as DirectoryHelper;
use CryozonicStripePaymentsHelperLogger;
class YourClass extends MagentoPaymentModelMethodAbstractMethod
public function __construct(
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoPaymentModelMethodLogger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = [],
DirectoryHelper $directory = null
)
parent::__construct(
$context,
$registry,
$extensionFactory,
$customAttributeFactory,
$paymentData,
$scopeConfig,
$logger,
$resource,
$resourceCollection,
$data,
$directory
);
If you extend MagentoPaymentModelMethodAbstractMethod
then your __construct
function should have followed below classes parameters
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
Logger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = [],
DirectoryHelper $directory = null
So, your __construct
have minimum below code
<?php
namespace YourNameSpace;
use MagentoDirectoryHelperData as DirectoryHelper;
use CryozonicStripePaymentsHelperLogger;
class YourClass extends MagentoPaymentModelMethodAbstractMethod
public function __construct(
MagentoFrameworkModelContext $context,
MagentoFrameworkRegistry $registry,
MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
MagentoPaymentHelperData $paymentData,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoPaymentModelMethodLogger $logger,
MagentoFrameworkModelResourceModelAbstractResource $resource = null,
MagentoFrameworkDataCollectionAbstractDb $resourceCollection = null,
array $data = [],
DirectoryHelper $directory = null
)
parent::__construct(
$context,
$registry,
$extensionFactory,
$customAttributeFactory,
$paymentData,
$scopeConfig,
$logger,
$resource,
$resourceCollection,
$data,
$directory
);
edited yesterday
answered yesterday
Amit Bera♦Amit Bera
60k1677178
60k1677178
not working for me
– tge
yesterday
share your code
– Amit Bera♦
yesterday
see my question i updated
– tge
yesterday
see my code? need help
– tge
yesterday
1
Answer updated andYourNameSpace
&YourClass
with your namespace & class repectively.
– Amit Bera♦
yesterday
|
show 7 more comments
not working for me
– tge
yesterday
share your code
– Amit Bera♦
yesterday
see my question i updated
– tge
yesterday
see my code? need help
– tge
yesterday
1
Answer updated andYourNameSpace
&YourClass
with your namespace & class repectively.
– Amit Bera♦
yesterday
not working for me
– tge
yesterday
not working for me
– tge
yesterday
share your code
– Amit Bera♦
yesterday
share your code
– Amit Bera♦
yesterday
see my question i updated
– tge
yesterday
see my question i updated
– tge
yesterday
see my code? need help
– tge
yesterday
see my code? need help
– tge
yesterday
1
1
Answer updated and
YourNameSpace
& YourClass
with your namespace & class repectively.– Amit Bera♦
yesterday
Answer updated and
YourNameSpace
& YourClass
with your namespace & class repectively.– Amit Bera♦
yesterday
|
show 7 more comments
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269957%2fcreate-construct-function-magento2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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