app/code/Vendor/Module/Model/CustomConfigProvider.php (data provider)
<?php
namespace Vendor\Module\Model;
use Magento\Checkout\Model\ConfigProviderInterface;
class CustomConfigProvider implements ConfigProviderInterface
{
public function getConfig()
{
$storepick_config = array();
$storepick_config[] = ['value' => 1, 'label' => 'label1'];
$storepick_config[] = ['value' => 2, 'label' => 'label2'];
$storepick_config[] = ['value' => 3, 'label' => 'label3'];
$storepick_config[] = ['value' => 4, 'label' => 'label4'];
$config = [
'storepick_config' => $storepick_config,
'storepick_config_encode' => json_encode($storepick_config),
];
return $config;
}
}
?>
app/code/Vendor/Module/view/frontend/web/js/view/checkout/shipping/storepickup.js
define([
'jquery',
'ko',
'uiComponent',
'Magento_Checkout/js/model/quote'
], function ($, ko, Component, quote) {
'use strict';
console.log(window.checkoutConfig.storepick_config);
console.log(window.checkoutConfig.storepick_config_encode);
return Component.extend({
defaults: {
template: 'Vendor_Module/checkout/shipping/storepickup',
storepickConfig: window.checkoutConfig.storepick_config,
storepick_config_encode:window.checkoutConfig.storepick_config_encode,
},
});
});
app/code/Vendor/Module/view/frontend/web/template/checkout/shipping/storepickup.html
<select data-bind="options:storepickConfig"></select>
now i want require drop down in checkout page but drop down not display proper way
i want to display store list in drop down Please help if any one know