سؤال

Overrided Admin Product Save Controller (shown below)

<?php

namespace Maxime\Helloworld\Controller\Adminhtml\Rewrite\Product;

class Save extends \Magento\Catalog\Controller\Adminhtml\Product
{

    public function execute()
    {
    $productId = $this->getRequest()->getParams();
    $data = $this->getRequest()->getPostValue();

    print_r($_POST);die();
    return parent::execute();
    }
}

In my phtml page, listed out a input field and a select/option field inside a form. I tried a lot of times to paste the code.But it didn't appears. I need to get the values of both fields in that overrided controller.

هل كانت مفيدة؟

المحلول

We can get the values in post by using the following in select tag.

data-form-part="product_form"
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top