How can I check selected products retrieved from database in my product grid Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?how to add sku to grid of a moduleUnit Test for overwrite collection class in magento2I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 Add new field to Magento_User admin formHow to remove ‘Add New’ button from Admin Grid in Magento 1.9?Magento - Add customer attribute to order gridMagento 2 Create dynamic array From different Model Collection to use in multi select in gridMagento 2.3 Can't view module's front end page output?Magento 2.3 Ui grid not working when store column is present

Meaning of "Not holding on that level of emuna/bitachon"

Compiling and throwing simple dynamic exceptions at runtime for JVM

Unix AIX passing variable and arguments to expect and spawn

How to produce a PS1 prompt in bash or ksh93 similar to tcsh

If gravity precedes the formation of a solar system, where did the mass come from that caused the gravity?

Why aren't these two solutions equivalent? Combinatorics problem

Should man-made satellites feature an intelligent inverted "cow catcher"?

Assertions In A Mock Callout Test

Is "ein Herz wie das meine" an antiquated or colloquial use of the possesive pronoun?

Can I take recommendation from someone I met at a conference?

Can a Wizard take the Magic Initiate feat and select spells from the Wizard list?

Is Vivien of the Wilds + Wilderness Reclamation a competitive combo?

Is there a verb for listening stealthily?

What's the difference between using dependency injection with a container and using a service locator?

Suing a Police Officer Instead of the Police Department

How to create a command for the "strange m" symbol in latex?

Marquee sign letters

Why isn't everyone flabbergasted about Bran's "gift"?

Weaponising the Grasp-at-a-Distance spell

What is her name?

Who's this lady in the war room?

Lights are flickering on and off after accidentally bumping into light switch

Has a Nobel Peace laureate ever been accused of war crimes?

Why aren't road bike wheels tiny?



How can I check selected products retrieved from database in my product grid



Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?how to add sku to grid of a moduleUnit Test for overwrite collection class in magento2I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 Add new field to Magento_User admin formHow to remove ‘Add New’ button from Admin Grid in Magento 1.9?Magento - Add customer attribute to order gridMagento 2 Create dynamic array From different Model Collection to use in multi select in gridMagento 2.3 Can't view module's front end page output?Magento 2.3 Ui grid not working when store column is present



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








0















I am working on a custum module where I want a user to select some products.



Select and saving is working well. Now I want to check those product grid when user click on edit option.



Here is the code for my grid



use MagentoBackendBlockWidgetGrid;
use MagentoBackendBlockWidgetGridColumn;
use MagentoBackendBlockWidgetGridExtended;

class Product extends MagentoBackendBlockWidgetGridExtended

protected $_coreRegistry = null;
protected $_productFactory;
protected $_eventFactory;

public function __construct(
MagentoBackendBlockTemplateContext $context,
MagentoBackendHelperData $backendHelper,
MagentoCatalogModelResourceModelProductCollectionFactory $productFactory,
MagentoCatalogModelProductAttributeSourceStatus $productStatus,
MagentoCatalogModelProductVisibility $productVisibility,
FMEBackgroundImageModelBackgroundImage $eventFactory, MagentoFrameworkRegistry $coreRegistry, array $data = []
)
$this->_productFactory = $productFactory;
$this->productVisibility = $productVisibility;
$this->productStatus = $productStatus;
$this->_eventFactory = $eventFactory;
$this->_coreRegistry = $coreRegistry;

parent::__construct($context, $backendHelper, $data);


protected function _construct()
parent::_construct();
$this->setId('catalog_category_products');
$this->setDefaultSort('entity_id');
$this->setUseAjax(true);
if ($this->getRequest()->getParam('id'))
$this->setDefaultFilter(['in_category' => 1]);



public function getCategory()
return $this->_coreRegistry->registry('fme_backgroundimage');


protected function _addColumnFilterToCollection($column)
if ($column->getId() == 'in_category')
$productIds = $this->_getSelectedProducts();

if (empty($productIds))
$productIds = 0;

if ($column->getFilter()->getValue())
$this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);
elseif (!empty($productIds))
$this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);

else
parent::_addColumnFilterToCollection($column);

return $this;


protected function _prepareCollection()

$collection = $this->_productFactory->create();
$collection->addAttributeToSelect('thumbnail');
$collection->addAttributeToSelect('name');
$collection->addAttributeToSelect('sku');
$collection->addAttributeToSelect('price');
$collection->addAttributeToFilter('status', ['in' => $this->productStatus->getVisibleStatusIds()]);
$collection->addOrder('entity_id', 'asc');
$collection->setVisibility($this->productVisibility->getVisibleInSiteIds()); // return $collection;
$this->setCollection($collection);
return parent::_prepareCollection();

protected function _prepareColumns()

$this->addColumn(
'in_category', [
'header_css_class' => 'a-center',
'type' => 'checkbox',
'name' => 'in_category',
'values' => $this->_getSelectedProducts(),
'index' => 'entity_id',
'header_css_class' => 'col-select col-massaction',
'column_css_class' => 'col-select col-massaction',
'use_index' => true
]
);

$this->addColumn(
'entity_id', [
'header' => __('ID'),
'sortable' => true,
'index' => 'entity_id',
'header_css_class' => 'col-id',
'column_css_class' => 'col-id'
]
);

$this->addColumn('name', ['header' => __('Name'), 'index' => 'name']);
$this->addColumn('sku', ['header' => __('SKU'), 'index' => 'sku'
]);
$this->addColumn(
'price', [
'header' => __('Price'),
'type' => 'currency',
'currency_code' => (string) $this->_scopeConfig->getValue(
MagentoDirectoryModelCurrency::XML_PATH_CURRENCY_BASE, MagentoStoreModelScopeInterface::SCOPE_STORE
),
'index' => 'price'
]
);

return parent::_prepareColumns();


public function getGridUrl()
return $this->getUrl('successpage/products/grid', ['_current' => true]);


protected function _getSelectedProducts()
$id = $this->getRequest()->getParam('entity_id');
$relatedProducts = $this->_eventFactory->getRelatedPro($id);

if ($relatedProducts)
$relatedProducts = array_values($relatedProducts);
return $relatedProducts;
else
return [];






This grid is posting data in json format I can change response to same json format as bellow



Array
(
[backgroundimage_id] => 5
[title] => ABC
[status] => 1
[sort_order] => 12
[date_from] => 2019-04-08
[date_to] => 2019-04-25
[image] => abstract-dark-wallpaper-17.jpg
[image_catagory_id] => Array
(
[0] => 7
[1] => 9
[2] => 11
[3] => 3
)

[image_cms_value] => Array
(
[0] => enable-cookies
[1] => privacy-policy-cookie-restriction-mode
[2] => about-us
[3] => home
)

[entity_id] => ["2009","2016","2023","2030","2046"]
)









share|improve this question









New contributor




Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


























    0















    I am working on a custum module where I want a user to select some products.



    Select and saving is working well. Now I want to check those product grid when user click on edit option.



    Here is the code for my grid



    use MagentoBackendBlockWidgetGrid;
    use MagentoBackendBlockWidgetGridColumn;
    use MagentoBackendBlockWidgetGridExtended;

    class Product extends MagentoBackendBlockWidgetGridExtended

    protected $_coreRegistry = null;
    protected $_productFactory;
    protected $_eventFactory;

    public function __construct(
    MagentoBackendBlockTemplateContext $context,
    MagentoBackendHelperData $backendHelper,
    MagentoCatalogModelResourceModelProductCollectionFactory $productFactory,
    MagentoCatalogModelProductAttributeSourceStatus $productStatus,
    MagentoCatalogModelProductVisibility $productVisibility,
    FMEBackgroundImageModelBackgroundImage $eventFactory, MagentoFrameworkRegistry $coreRegistry, array $data = []
    )
    $this->_productFactory = $productFactory;
    $this->productVisibility = $productVisibility;
    $this->productStatus = $productStatus;
    $this->_eventFactory = $eventFactory;
    $this->_coreRegistry = $coreRegistry;

    parent::__construct($context, $backendHelper, $data);


    protected function _construct()
    parent::_construct();
    $this->setId('catalog_category_products');
    $this->setDefaultSort('entity_id');
    $this->setUseAjax(true);
    if ($this->getRequest()->getParam('id'))
    $this->setDefaultFilter(['in_category' => 1]);



    public function getCategory()
    return $this->_coreRegistry->registry('fme_backgroundimage');


    protected function _addColumnFilterToCollection($column)
    if ($column->getId() == 'in_category')
    $productIds = $this->_getSelectedProducts();

    if (empty($productIds))
    $productIds = 0;

    if ($column->getFilter()->getValue())
    $this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);
    elseif (!empty($productIds))
    $this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);

    else
    parent::_addColumnFilterToCollection($column);

    return $this;


    protected function _prepareCollection()

    $collection = $this->_productFactory->create();
    $collection->addAttributeToSelect('thumbnail');
    $collection->addAttributeToSelect('name');
    $collection->addAttributeToSelect('sku');
    $collection->addAttributeToSelect('price');
    $collection->addAttributeToFilter('status', ['in' => $this->productStatus->getVisibleStatusIds()]);
    $collection->addOrder('entity_id', 'asc');
    $collection->setVisibility($this->productVisibility->getVisibleInSiteIds()); // return $collection;
    $this->setCollection($collection);
    return parent::_prepareCollection();

    protected function _prepareColumns()

    $this->addColumn(
    'in_category', [
    'header_css_class' => 'a-center',
    'type' => 'checkbox',
    'name' => 'in_category',
    'values' => $this->_getSelectedProducts(),
    'index' => 'entity_id',
    'header_css_class' => 'col-select col-massaction',
    'column_css_class' => 'col-select col-massaction',
    'use_index' => true
    ]
    );

    $this->addColumn(
    'entity_id', [
    'header' => __('ID'),
    'sortable' => true,
    'index' => 'entity_id',
    'header_css_class' => 'col-id',
    'column_css_class' => 'col-id'
    ]
    );

    $this->addColumn('name', ['header' => __('Name'), 'index' => 'name']);
    $this->addColumn('sku', ['header' => __('SKU'), 'index' => 'sku'
    ]);
    $this->addColumn(
    'price', [
    'header' => __('Price'),
    'type' => 'currency',
    'currency_code' => (string) $this->_scopeConfig->getValue(
    MagentoDirectoryModelCurrency::XML_PATH_CURRENCY_BASE, MagentoStoreModelScopeInterface::SCOPE_STORE
    ),
    'index' => 'price'
    ]
    );

    return parent::_prepareColumns();


    public function getGridUrl()
    return $this->getUrl('successpage/products/grid', ['_current' => true]);


    protected function _getSelectedProducts()
    $id = $this->getRequest()->getParam('entity_id');
    $relatedProducts = $this->_eventFactory->getRelatedPro($id);

    if ($relatedProducts)
    $relatedProducts = array_values($relatedProducts);
    return $relatedProducts;
    else
    return [];






    This grid is posting data in json format I can change response to same json format as bellow



    Array
    (
    [backgroundimage_id] => 5
    [title] => ABC
    [status] => 1
    [sort_order] => 12
    [date_from] => 2019-04-08
    [date_to] => 2019-04-25
    [image] => abstract-dark-wallpaper-17.jpg
    [image_catagory_id] => Array
    (
    [0] => 7
    [1] => 9
    [2] => 11
    [3] => 3
    )

    [image_cms_value] => Array
    (
    [0] => enable-cookies
    [1] => privacy-policy-cookie-restriction-mode
    [2] => about-us
    [3] => home
    )

    [entity_id] => ["2009","2016","2023","2030","2046"]
    )









    share|improve this question









    New contributor




    Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      0












      0








      0








      I am working on a custum module where I want a user to select some products.



      Select and saving is working well. Now I want to check those product grid when user click on edit option.



      Here is the code for my grid



      use MagentoBackendBlockWidgetGrid;
      use MagentoBackendBlockWidgetGridColumn;
      use MagentoBackendBlockWidgetGridExtended;

      class Product extends MagentoBackendBlockWidgetGridExtended

      protected $_coreRegistry = null;
      protected $_productFactory;
      protected $_eventFactory;

      public function __construct(
      MagentoBackendBlockTemplateContext $context,
      MagentoBackendHelperData $backendHelper,
      MagentoCatalogModelResourceModelProductCollectionFactory $productFactory,
      MagentoCatalogModelProductAttributeSourceStatus $productStatus,
      MagentoCatalogModelProductVisibility $productVisibility,
      FMEBackgroundImageModelBackgroundImage $eventFactory, MagentoFrameworkRegistry $coreRegistry, array $data = []
      )
      $this->_productFactory = $productFactory;
      $this->productVisibility = $productVisibility;
      $this->productStatus = $productStatus;
      $this->_eventFactory = $eventFactory;
      $this->_coreRegistry = $coreRegistry;

      parent::__construct($context, $backendHelper, $data);


      protected function _construct()
      parent::_construct();
      $this->setId('catalog_category_products');
      $this->setDefaultSort('entity_id');
      $this->setUseAjax(true);
      if ($this->getRequest()->getParam('id'))
      $this->setDefaultFilter(['in_category' => 1]);



      public function getCategory()
      return $this->_coreRegistry->registry('fme_backgroundimage');


      protected function _addColumnFilterToCollection($column)
      if ($column->getId() == 'in_category')
      $productIds = $this->_getSelectedProducts();

      if (empty($productIds))
      $productIds = 0;

      if ($column->getFilter()->getValue())
      $this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);
      elseif (!empty($productIds))
      $this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);

      else
      parent::_addColumnFilterToCollection($column);

      return $this;


      protected function _prepareCollection()

      $collection = $this->_productFactory->create();
      $collection->addAttributeToSelect('thumbnail');
      $collection->addAttributeToSelect('name');
      $collection->addAttributeToSelect('sku');
      $collection->addAttributeToSelect('price');
      $collection->addAttributeToFilter('status', ['in' => $this->productStatus->getVisibleStatusIds()]);
      $collection->addOrder('entity_id', 'asc');
      $collection->setVisibility($this->productVisibility->getVisibleInSiteIds()); // return $collection;
      $this->setCollection($collection);
      return parent::_prepareCollection();

      protected function _prepareColumns()

      $this->addColumn(
      'in_category', [
      'header_css_class' => 'a-center',
      'type' => 'checkbox',
      'name' => 'in_category',
      'values' => $this->_getSelectedProducts(),
      'index' => 'entity_id',
      'header_css_class' => 'col-select col-massaction',
      'column_css_class' => 'col-select col-massaction',
      'use_index' => true
      ]
      );

      $this->addColumn(
      'entity_id', [
      'header' => __('ID'),
      'sortable' => true,
      'index' => 'entity_id',
      'header_css_class' => 'col-id',
      'column_css_class' => 'col-id'
      ]
      );

      $this->addColumn('name', ['header' => __('Name'), 'index' => 'name']);
      $this->addColumn('sku', ['header' => __('SKU'), 'index' => 'sku'
      ]);
      $this->addColumn(
      'price', [
      'header' => __('Price'),
      'type' => 'currency',
      'currency_code' => (string) $this->_scopeConfig->getValue(
      MagentoDirectoryModelCurrency::XML_PATH_CURRENCY_BASE, MagentoStoreModelScopeInterface::SCOPE_STORE
      ),
      'index' => 'price'
      ]
      );

      return parent::_prepareColumns();


      public function getGridUrl()
      return $this->getUrl('successpage/products/grid', ['_current' => true]);


      protected function _getSelectedProducts()
      $id = $this->getRequest()->getParam('entity_id');
      $relatedProducts = $this->_eventFactory->getRelatedPro($id);

      if ($relatedProducts)
      $relatedProducts = array_values($relatedProducts);
      return $relatedProducts;
      else
      return [];






      This grid is posting data in json format I can change response to same json format as bellow



      Array
      (
      [backgroundimage_id] => 5
      [title] => ABC
      [status] => 1
      [sort_order] => 12
      [date_from] => 2019-04-08
      [date_to] => 2019-04-25
      [image] => abstract-dark-wallpaper-17.jpg
      [image_catagory_id] => Array
      (
      [0] => 7
      [1] => 9
      [2] => 11
      [3] => 3
      )

      [image_cms_value] => Array
      (
      [0] => enable-cookies
      [1] => privacy-policy-cookie-restriction-mode
      [2] => about-us
      [3] => home
      )

      [entity_id] => ["2009","2016","2023","2030","2046"]
      )









      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am working on a custum module where I want a user to select some products.



      Select and saving is working well. Now I want to check those product grid when user click on edit option.



      Here is the code for my grid



      use MagentoBackendBlockWidgetGrid;
      use MagentoBackendBlockWidgetGridColumn;
      use MagentoBackendBlockWidgetGridExtended;

      class Product extends MagentoBackendBlockWidgetGridExtended

      protected $_coreRegistry = null;
      protected $_productFactory;
      protected $_eventFactory;

      public function __construct(
      MagentoBackendBlockTemplateContext $context,
      MagentoBackendHelperData $backendHelper,
      MagentoCatalogModelResourceModelProductCollectionFactory $productFactory,
      MagentoCatalogModelProductAttributeSourceStatus $productStatus,
      MagentoCatalogModelProductVisibility $productVisibility,
      FMEBackgroundImageModelBackgroundImage $eventFactory, MagentoFrameworkRegistry $coreRegistry, array $data = []
      )
      $this->_productFactory = $productFactory;
      $this->productVisibility = $productVisibility;
      $this->productStatus = $productStatus;
      $this->_eventFactory = $eventFactory;
      $this->_coreRegistry = $coreRegistry;

      parent::__construct($context, $backendHelper, $data);


      protected function _construct()
      parent::_construct();
      $this->setId('catalog_category_products');
      $this->setDefaultSort('entity_id');
      $this->setUseAjax(true);
      if ($this->getRequest()->getParam('id'))
      $this->setDefaultFilter(['in_category' => 1]);



      public function getCategory()
      return $this->_coreRegistry->registry('fme_backgroundimage');


      protected function _addColumnFilterToCollection($column)
      if ($column->getId() == 'in_category')
      $productIds = $this->_getSelectedProducts();

      if (empty($productIds))
      $productIds = 0;

      if ($column->getFilter()->getValue())
      $this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);
      elseif (!empty($productIds))
      $this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);

      else
      parent::_addColumnFilterToCollection($column);

      return $this;


      protected function _prepareCollection()

      $collection = $this->_productFactory->create();
      $collection->addAttributeToSelect('thumbnail');
      $collection->addAttributeToSelect('name');
      $collection->addAttributeToSelect('sku');
      $collection->addAttributeToSelect('price');
      $collection->addAttributeToFilter('status', ['in' => $this->productStatus->getVisibleStatusIds()]);
      $collection->addOrder('entity_id', 'asc');
      $collection->setVisibility($this->productVisibility->getVisibleInSiteIds()); // return $collection;
      $this->setCollection($collection);
      return parent::_prepareCollection();

      protected function _prepareColumns()

      $this->addColumn(
      'in_category', [
      'header_css_class' => 'a-center',
      'type' => 'checkbox',
      'name' => 'in_category',
      'values' => $this->_getSelectedProducts(),
      'index' => 'entity_id',
      'header_css_class' => 'col-select col-massaction',
      'column_css_class' => 'col-select col-massaction',
      'use_index' => true
      ]
      );

      $this->addColumn(
      'entity_id', [
      'header' => __('ID'),
      'sortable' => true,
      'index' => 'entity_id',
      'header_css_class' => 'col-id',
      'column_css_class' => 'col-id'
      ]
      );

      $this->addColumn('name', ['header' => __('Name'), 'index' => 'name']);
      $this->addColumn('sku', ['header' => __('SKU'), 'index' => 'sku'
      ]);
      $this->addColumn(
      'price', [
      'header' => __('Price'),
      'type' => 'currency',
      'currency_code' => (string) $this->_scopeConfig->getValue(
      MagentoDirectoryModelCurrency::XML_PATH_CURRENCY_BASE, MagentoStoreModelScopeInterface::SCOPE_STORE
      ),
      'index' => 'price'
      ]
      );

      return parent::_prepareColumns();


      public function getGridUrl()
      return $this->getUrl('successpage/products/grid', ['_current' => true]);


      protected function _getSelectedProducts()
      $id = $this->getRequest()->getParam('entity_id');
      $relatedProducts = $this->_eventFactory->getRelatedPro($id);

      if ($relatedProducts)
      $relatedProducts = array_values($relatedProducts);
      return $relatedProducts;
      else
      return [];






      This grid is posting data in json format I can change response to same json format as bellow



      Array
      (
      [backgroundimage_id] => 5
      [title] => ABC
      [status] => 1
      [sort_order] => 12
      [date_from] => 2019-04-08
      [date_to] => 2019-04-25
      [image] => abstract-dark-wallpaper-17.jpg
      [image_catagory_id] => Array
      (
      [0] => 7
      [1] => 9
      [2] => 11
      [3] => 3
      )

      [image_cms_value] => Array
      (
      [0] => enable-cookies
      [1] => privacy-policy-cookie-restriction-mode
      [2] => about-us
      [3] => home
      )

      [entity_id] => ["2009","2016","2023","2030","2046"]
      )






      magento2 grid php-7 product-grid






      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited Apr 18 at 12:59









      Arshad Hussain

      4571928




      4571928






      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Apr 18 at 10:48









      Waqar AliWaqar Ali

      186




      186




      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes


















          0














          This line is the selected data from the grid.



          [entity_id] => ["2009","2016","2023","2030","2046"]


          Now you need to do code od foreach look to travers each and every entity_id from this and do your work based on that.






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



            );






            Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270639%2fhow-can-i-check-selected-products-retrieved-from-database-in-my-product-grid%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














            This line is the selected data from the grid.



            [entity_id] => ["2009","2016","2023","2030","2046"]


            Now you need to do code od foreach look to travers each and every entity_id from this and do your work based on that.






            share|improve this answer



























              0














              This line is the selected data from the grid.



              [entity_id] => ["2009","2016","2023","2030","2046"]


              Now you need to do code od foreach look to travers each and every entity_id from this and do your work based on that.






              share|improve this answer

























                0












                0








                0







                This line is the selected data from the grid.



                [entity_id] => ["2009","2016","2023","2030","2046"]


                Now you need to do code od foreach look to travers each and every entity_id from this and do your work based on that.






                share|improve this answer













                This line is the selected data from the grid.



                [entity_id] => ["2009","2016","2023","2030","2046"]


                Now you need to do code od foreach look to travers each and every entity_id from this and do your work based on that.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 18 at 12:22









                Dhiren VasoyaDhiren Vasoya

                4,45751844




                4,45751844




















                    Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.












                    Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.











                    Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.














                    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%2f270639%2fhow-can-i-check-selected-products-retrieved-from-database-in-my-product-grid%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

                    Sum ergo cogito? 1 nng

                    419 nièngy_Soadمي 19bal1.5o_g

                    Queiggey Chernihivv 9NnOo i Zw X QqKk LpB