Adding additional variables in window.checkoutConfig
【Adding additional variables in window.checkoutConfig】We often need to add more variables that we need to use on the checkout page at the time of checkout. Here is how we can do that.
The first step is to add the following code in Vendor/Module/etc/frontend/di.xml of your custom module –
- Webkul\Test\Model\AdditionalConfigVars
After this, we will create AdditionalConfigVars.php in Vendor/Module/Model and add the following code to it –
Now all you need to do is flush Magento cache and check ‘window.checkoutConfig.test_var’ in your js on the checkout page. It will return ‘Test Var’.
This is all for now.
Suggestions and queries are welcome.
推荐阅读
- Adding|Adding client to server's list failed, CORBA error: IDL:omg.org/CORBA/COMM_FAILURE:1.0
- 解决多列排列,padding左右有留白问题
- 完整的轮播图
- Machine|Coursera Machine Learning 第二周 quiz Linear Regression with Multiple Variables 习题答案
- Cousera-stanford-机器学习练习-第二周-Linear Regression with Multiple Variables
- js页码功能
- div+css使用padding样式和|div+css使用padding样式和 important标记实现Firefox和IE6处理带float样式的margi
- Padding、Oracle攻击
- Flutter深入浅出组件篇---Padding、AnimatedPadding
- Day|Day 7-task