- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Call a custom function in admin
I have a plugin that imports customer pricing using a csv. I want to be able to run that import on schedule with a custom file.
I have to add the file over here, and then choose save config to upload it
<blockquote class="imgur-embed-pub" lang="en" data-id="qN2VpNy"><a href="https://imgur.com/qN2VpNy">View post on imgur.com</a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>
What do I have to do to call the correct function in my own module? I created a custom module for this, and I found a function called getElementHtml in file
Magedelight\Customerprice\Block\Adminhtml\Form\Field
which represents the backend form, but I can't figure out how to call it in my module.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Call a custom function in admin
<block class="Magedelight\Customerprice\Block\Adminhtml\Form\Field" template="Magedelight_Customerprice::custom.phtml" name="custom.import.form"/>
200+ Magento 2 Extensions for Enhanced Shopping Experience.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Call a custom function in admin
Thank you. I'll try to implement that
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Call a custom function in admin
Every function hooked to admin_init will be called after you save settings in the admin page. You should add some extra check of conditions to trigger your code on correct page. For example aces etm
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Call a custom function in admin
A common task we might perform with a model like this is to update an article’s status from “draft” to “published”. We could easily do this in the admin one article at a time, but if we wanted to bulk-publish a group of articles, it’d be tedious. So, let’s write an action that lets us change an article’s status to “published.”
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Call a custom function in admin
I was able to go another way. The plugin developer updated their API with a bulk update endpoint, so I'm writing a script outside of the plugin that calls the api and does what I need
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Call a custom function in admin
@web_master12 wrote: Official DGCustomerFirst SurveyI was able to go another way. The plugin developer updated their API with a bulk update endpoint, so I'm writing a script outside of the plugin that calls the api and does what I need
We could easily do this in the admin one article at a time, but if we wanted to bulk-publish a group of articles, it’d be tedious. So, let’s write an action that lets us change an article’s status to “published.”
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Call a custom function in admin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Call a custom function in admin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Call a custom function in admin
You must have shopped a Marshalls store in the U.S. or Puerto Rico and be a legal resident of the United States to be eligible for the Sweepstakes.