Jump to content

Passing data between BO controllers


314otr

Recommended Posts

Hi,

How can i transfer data between BO controllers?

I wrote my main controller:

function __construct()
  {
    parent::__construct();
    $this->bootstrap = true;
    $this->table = 'product';
    $this->identifier = 'id_product';
    $this->_defaultOrderBy = 'a.id_product';
    $this->_select = 'a.id_product, pl.`name` AS `product_name`, reference, cl.`name` AS `name`, ROUND(a.price, 2) AS price, trg.`name` AS `tax_rules_group_name`, sa.`quantity` AS `quantity`, m.`name` AS `manufacturer_name`';
    $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = a.id_product)
                    LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (cl.id_category = a.id_category_default)
                    LEFT JOIN `'._DB_PREFIX_.'tax_rules_group` trg ON (trg.id_tax_rules_group = a.id_tax_rules_group)
                    LEFT JOIN `'._DB_PREFIX_.'stock_available` sa ON (sa.id_product = a.id_product)
                    LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.id_manufacturer = a.id_manufacturer)';
    $this->fields_list = [
      'id_product' => ['title' => 'ID','class' => 'fixed-width-xs'],
      'product_name' => ['title' => 'Nazwa', 'filter_key' => 'pl!name'],
      'reference' => ['title' => 'Indeks'],
      'name' => ['title' => 'Kategoria', 'filter_key' => 'cl!name'],
      'price' => ['title' => 'Cena netto'],
      'tax_rules_group_name' => ['title' => 'Stawka VAT', 'filter_key' => 'trg!name'],
      'quantity' => ['title' => 'Ilość', 'class' => 'fixed-width-xs', 'filter_key' => 'sa!quantity', 'align' => 'center'],
      'manufacturer_name' => ['title' => 'Marka', 'filter_key' => 'm!name', 'align' => 'center'],
    ];
    $this->bulk_actions = array('masowaZmianaCeny' => array('text' => 'Masowa Zmiana Ceny', 'icon' => 'icon-file-text'));
  }

and add:

public function processBulkmasowaZmianaCeny()
  {
    $select = $this->boxes;
    return Tools::redirectAdmin(Context::getContext()->link->getAdminLink('MasowaZmianaCen', true, array('select' => $this->boxes)));
  }

But I dont't access to $select variable in 'MasowaZmianaCenController'

Thx for your help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...