How to call block function in model The 2019 Stack Overflow Developer Survey Results Are InHow to access model variable in block class magentoPass Data From PHTML To Block Controllerhow- to pass dynamic variable-between blocks in magentoPass parameter to block functionpass variable from ajaxcontroller to block classHow to pass arguments to phtml block?Magento2 : How to get block file in phtml filePass boolean or variable from Child Block to Parent Block?how to pass a variable from one phtml to another?function in block not found
What is the meaning of Triage in Cybersec world?
Mathematics of imaging the black hole
What is preventing me from simply constructing a hash that's lower than the current target?
Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?
For what reasons would an animal species NOT cross a *horizontal* land bridge?
Keeping a retro style to sci-fi spaceships?
Geography at the pixel level
Correct punctuation for showing a character's confusion
Why was M87 targeted for the Event Horizon Telescope instead of Sagittarius A*?
Relationship between Gromov-Witten and Taubes' Gromov invariant
What is this sharp, curved notch on my knife for?
How can I define good in a religion that claims no moral authority?
How to type a long/em dash `—`
If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?
Accepted by European university, rejected by all American ones I applied to? Possible reasons?
Why isn't the circumferential light around the M87 black hole's event horizon symmetric?
If a sorcerer casts the Banishment spell on a PC while in Avernus, does the PC return to their home plane?
How can I add encounters in the Lost Mine of Phandelver campaign without giving PCs too much XP?
How to charge AirPods to keep battery healthy?
Are spiders unable to hurt humans, especially very small spiders?
How to translate "being like"?
Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?
Star Trek - X-shaped Item on Regula/Orbital Office Starbases
How do I free up internal storage if I don't have any apps downloaded?
How to call block function in model
The 2019 Stack Overflow Developer Survey Results Are InHow to access model variable in block class magentoPass Data From PHTML To Block Controllerhow- to pass dynamic variable-between blocks in magentoPass parameter to block functionpass variable from ajaxcontroller to block classHow to pass arguments to phtml block?Magento2 : How to get block file in phtml filePass boolean or variable from Child Block to Parent Block?how to pass a variable from one phtml to another?function in block not found
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm using TemplateMonter_FeaturedProduct ang I'm building an API to build mobile application. This extension let me add specific products to appear in specific block on the storefront. Those products are added from admin panel.
when I debug the code I found that to view products on the storefront it reads a block variable.
that's widget.xml file:
<parameter name="product_ids" xsi:type="block" visible="true">
<label translate="true">Choose custom products</label>
<block class="TemplateMonsterFeaturedProductBlockAdminhtmlWidgetChooser">
<data>
<item name="button" xsi:type="array">
<item name="open" xsi:type="string" translate="true">Select ...</item>
</item>
</data>
</block>
</parameter>
and that's block function used on .phtml
public function getProductIds()
$productArr = [];
//TODO: temporary hide manual products
$productIdsStr = $this->getData('product_ids');
//$productIdsStr = false;
if($productIdsStr && is_string($productIdsStr))
$productArr = explode(',',$productIdsStr);
return $productArr;
I need to get the result returned from getProductIds function in my API module.
Any solutions?
blocks magento-2.1.7
add a comment |
I'm using TemplateMonter_FeaturedProduct ang I'm building an API to build mobile application. This extension let me add specific products to appear in specific block on the storefront. Those products are added from admin panel.
when I debug the code I found that to view products on the storefront it reads a block variable.
that's widget.xml file:
<parameter name="product_ids" xsi:type="block" visible="true">
<label translate="true">Choose custom products</label>
<block class="TemplateMonsterFeaturedProductBlockAdminhtmlWidgetChooser">
<data>
<item name="button" xsi:type="array">
<item name="open" xsi:type="string" translate="true">Select ...</item>
</item>
</data>
</block>
</parameter>
and that's block function used on .phtml
public function getProductIds()
$productArr = [];
//TODO: temporary hide manual products
$productIdsStr = $this->getData('product_ids');
//$productIdsStr = false;
if($productIdsStr && is_string($productIdsStr))
$productArr = explode(',',$productIdsStr);
return $productArr;
I need to get the result returned from getProductIds function in my API module.
Any solutions?
blocks magento-2.1.7
add a comment |
I'm using TemplateMonter_FeaturedProduct ang I'm building an API to build mobile application. This extension let me add specific products to appear in specific block on the storefront. Those products are added from admin panel.
when I debug the code I found that to view products on the storefront it reads a block variable.
that's widget.xml file:
<parameter name="product_ids" xsi:type="block" visible="true">
<label translate="true">Choose custom products</label>
<block class="TemplateMonsterFeaturedProductBlockAdminhtmlWidgetChooser">
<data>
<item name="button" xsi:type="array">
<item name="open" xsi:type="string" translate="true">Select ...</item>
</item>
</data>
</block>
</parameter>
and that's block function used on .phtml
public function getProductIds()
$productArr = [];
//TODO: temporary hide manual products
$productIdsStr = $this->getData('product_ids');
//$productIdsStr = false;
if($productIdsStr && is_string($productIdsStr))
$productArr = explode(',',$productIdsStr);
return $productArr;
I need to get the result returned from getProductIds function in my API module.
Any solutions?
blocks magento-2.1.7
I'm using TemplateMonter_FeaturedProduct ang I'm building an API to build mobile application. This extension let me add specific products to appear in specific block on the storefront. Those products are added from admin panel.
when I debug the code I found that to view products on the storefront it reads a block variable.
that's widget.xml file:
<parameter name="product_ids" xsi:type="block" visible="true">
<label translate="true">Choose custom products</label>
<block class="TemplateMonsterFeaturedProductBlockAdminhtmlWidgetChooser">
<data>
<item name="button" xsi:type="array">
<item name="open" xsi:type="string" translate="true">Select ...</item>
</item>
</data>
</block>
</parameter>
and that's block function used on .phtml
public function getProductIds()
$productArr = [];
//TODO: temporary hide manual products
$productIdsStr = $this->getData('product_ids');
//$productIdsStr = false;
if($productIdsStr && is_string($productIdsStr))
$productArr = explode(',',$productIdsStr);
return $productArr;
I need to get the result returned from getProductIds function in my API module.
Any solutions?
blocks magento-2.1.7
blocks magento-2.1.7
asked 4 mins ago
Yomna MansourYomna Mansour
31712
31712
add a comment |
add a comment |
0
active
oldest
votes
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%2f269796%2fhow-to-call-block-function-in-model%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f269796%2fhow-to-call-block-function-in-model%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