#StackBounty: #magento2 #magento-2.1 Magento 2 create admin config table with custom rows and columns

Bounty: 50

I want to create admin config with a table to take the data and save in config for that I followed this link.

But I also want to create custom rows in that table programmatically and also without the last action column and add button. Please refer the image
Admin Config

I was unable to find any solution on the web regarding the same nor the file

MagentoConfigBlockSystemConfigFormFieldFieldArrayAbstractFieldArray

that we extend gave any clues.

Could have easily done this via jquery but want to implement the standard solution.

Code:

<?php
namespace AbcPaymentmethodBlockAdminhtmlSystemConfigFormField;

class Feetable extends MagentoConfigBlockSystemConfigFormFieldFieldArrayAbstractFieldArray
{
    /**
     * @var MagentoFrameworkDataFormElementFactory
     */
    protected $_elementFactory;

    /**
     * @param MagentoBackendBlockTemplateContext $context
     * @param MagentoFrameworkDataFormElementFactory $elementFactory
     * @param array $data
     */
    public function __construct(
        MagentoBackendBlockTemplateContext $context,
        MagentoFrameworkDataFormElementFactory $elementFactory,
        array $data = []
    )
    {
        $this->_elementFactory  = $elementFactory;
        parent::__construct($context,$data);
    }
    protected function _construct(){
        $this->addColumn('noi', ['label' => __('NOI'),'readonly'=>'readonly']);
        $this->addColumn('fixed', ['label' => __('Fixed')]);
        $this->addColumn('percent', ['label' => __('Percent')]);
        $this->_addAfter = false;
        $this->_addButtonLabel = __('Add More');
        parent::_construct();
    }

    protected function _prepareArrayRow(MagentoFrameworkDataObject $row) {
        $options = [1,2,3];
        $row->setData('option_extra_attrs', $options);
    }

}

system.xml

<field id="abc_fee_table" translate="label comment tooltip" sortOrder="17.4" showInDefault="1" showInWebsite="1" showInStore="0">
                    <label>Abc Fee by Number of Installments(NOI)</label>
                    <frontend_model>AbcPaymentmethodBlockAdminhtmlSystemConfigFormFieldFeetable</frontend_model>
                    <backend_model>MagentoConfigModelConfigBackendSerializedArraySerialized</backend_model>                    
                </field>


Get this bounty!!!

#StackBounty: #magento-2.1 #product #downloadable #custom-product-type How can I create a product which can be shipped or downloaded?

Bounty: 200

I want to create a single product in Magento 2 which can be shipped or downloaded by user choice on frontend.

Download or ship product example

Till now, I’ve used this “trick” in Magento 1 but it’s really inconvenient because I need to create 3 different products for each single product every time to make it works:

1 Grouped Product visible in catalog and search which contains 1 Simple Product not visible individually and 1 Downloadable Product not visible individually.

Is there a way to achieve something like that without this hassle? Should I create a new product type based on Configurable Product type which allows the download?


Get this bounty!!!

#StackBounty: #magento2 #magento-2.1 #magento2.2 #rest-api #magento2-api Implement Custom REST API end point returns list of best selli…

Bounty: 50

I have an assignment from clients to implement Custom REST API end point returns list of best selling products.

Which I have done here

Supports pagination, sort and filter

  • can be filtered by date range (month, year)
  • can filter only discounted products (has special price)
  • can sort by total sales(qty_ordered).

Anyone could provide a better solution or point me bugs from this, thank alot.

I would like to display qty_ordered on each response item form api, any idea for extension attributes?


Get this bounty!!!