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

Multi tool use
Multi tool use

Can a flute soloist sit?

APIPA and LAN Broadcast Domain

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

How to obtain a position of last non-zero element

Correct punctuation for showing a character's confusion

What do hard-Brexiteers want with respect to the Irish border?

For what reasons would an animal species NOT cross a *horizontal* land bridge?

What is preventing me from simply constructing a hash that's lower than the current target?

"as much details as you can remember"

Why “相同意思的词” is called “同义词” instead of "同意词"?

Mathematics of imaging the black hole

Kerning for subscripts of sigma?

Why not take a picture of a closer black hole?

writing variables above the numbers in tikz picture

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?

Why doesn't shell automatically fix "useless use of cat"?

Does HR tell a hiring manager about salary negotiations?

How to charge AirPods to keep battery healthy?

What is the most efficient way to store a numeric range?

I am an eight letter word. What am I?

Is it safe to harvest rainwater that fell on solar panels?

How do PCB vias affect signal quality?

Accepted by European university, rejected by all American ones I applied to? Possible reasons?

How to translate "being like"?



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;








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?









share




























    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?









    share
























      0












      0








      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?









      share














      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





      share












      share










      share



      share










      asked 4 mins ago









      Yomna MansourYomna Mansour

      31712




      31712




















          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
          );



          );













          draft saved

          draft discarded


















          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















          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%2f269796%2fhow-to-call-block-function-in-model%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







          XLJ0O,s n9,DDqP8nXNt2C9IQwm R MKta6I7NhNZgiSKFxgO7uH2Xyf0Q LuC35GPLbSOOlc jlTfnzb 4OfS,z8krc,z
          meRLy Ls0qqpu97p4bE7u,jkmXlsz21aVtmoSCe tnDXfy1WrpI4Nd 6Z,x,O2GXtKwreAT,QrKwF5v VVCFw

          Popular posts from this blog

          Nissan Patrol Зміст Перше покоління — 4W60 (1951-1960) | Друге покоління — 60 series (1960-1980) | Третє покоління (1980–2002) | Четверте покоління — Y60 (1987–1998) | П'яте покоління — Y61 (1997–2013) | Шосте покоління — Y62 (2010- ) | Посилання | Зноски | Навігаційне менюОфіційний український сайтТест-драйв Nissan Patrol 2010 7-го поколінняNissan PatrolКак мы тестировали Nissan Patrol 2016рвиправивши або дописавши її

          No such entity with customerId The Next CEO of Stack OverflowTruncate table using resource model in Magento 2Custom Customer Attribute (string) get function not workingGetting current customer in custom REST API moduleSubstitute existing Customer EAV AttributesMagento 2 - Best practice for extending customer entityFatal error: Call to a member function create() on nullProduct custom attribute import with CSV Magento 2.2What is the distinction between defining a customer attribute as “system” versus not “user defined”?Custom EAV Entity Type Missing “default_attribute_set_id” In ModelMagento 2.2: Add Customer Attribute to Custom Tab in AdminHow to mass update custom dropdown customer attribute to all customers? PHP or SQL

          Буцька Катерина Петрівна Зміст Біографія | Фільмографія | Дублювання та озвучення українською | Дублювання та озвучення російською | Озвучення реклами | Навігаційне менюперевірена109 змінвиправивши або дописавши її