How to make configurable options autoselected on configurable product view page
If you ever tried to do anything with Magento configurable products view page, most likely you needed changes in /js/varien/product.js in case you wanted to manipulate dropdowns.
This will be one of the ways to do it.
Basically, what we need to do in order to make initial selection of a product is the following:
Open this file: /app/design/frontend/default/your_theme/template/catalog/product/view/type/options/configurable.phtml
Right below
add this JavaScript code:
That’s it. I hope you can find this usable, however don’t use it on production site without extensive testing.
As you can see, all prototype functions in Magento (and in general) can be added as new into already existing class.
Same way you could override existing methods in existing classes.
I have coded this feature for the purpose of this article and I’m not claiming that it is production ready. It is only for informative purposes.
原文链接地址:http://inchoo.net/ecommerce/magento/how-to-make-configurable-options-autoselected-on-configurable-product-view-page/
分享到:
相关推荐
深入理解Magento-第一章 – Magento强大的配置系统 深入理解Magento-第二章 – Magento请求分发与控制器 深入理解Magento-第三章 – 布局,块和模板 深入理解Magento-第四章 – 模型和ORM基础 深入理解...
magento-ce-2.4.0_sample_data-2020-07-26-02-51-57.tar.gz Include sample data
magento-1.8.0.0.tar.gz
magento-ce-2.4.0-2020-07-24-11-15-38.tar.gz 不带sample data
Magento-Redismanager, 在 Magento,用于Redis的超级用户控制 Redis 管理Redis服务的实用程序特性系统> 配置>的自动或者手动配置高级> Redis管理在负载均衡环境中缓存服务不同的理想情况直接从magento面板管理员管理...
如何给产品描述里的关键字、字词批量添加链接?我想大家一直在的这样的插件。说实话,我也找了很久,也没有找到。可是由于需要,不得不自己开发一个这样的插件。并支持到Magento1.6.2 说明请查看:...
第一章Magento 销售 1.订单管理-----------------------------------------------------Magento-2.1订单管理 2.发票---------------------------------------------------------- Magento-2.2订单管理 3.配送-------...
magento-1.6.2.0 magento-1.6.2.0 magento-1.6.2.0
magento -redis 安装包
magento-stock-movements, Magento扩展,节省产品库存 节省你的Magento产品的库存 特性将库存移动保存在产品修改页面的新标签中安装 Magento 1.5. x, 1.6. x, 1.7. x, 1.8. x, 1.9.x使用 modgit 安装:$ cd/pat
以详细的操作实例说明了magento的使用、配置、开发相关的实际应用。
因为国外网速太慢了,所以下载后分享给需要的人。magento-ce-2.4.2-p1-2021-04-22-10-49-09
magento-1.9.1.1-2015-04-30-12-49-08 源代码包
magento-演示数据1.6.1.0
magento-1.6.1.0最新英文版
magento-1.7.0.7z,安装包
Magento-CE-2.3.4_sample_data-2020-01-22-11-11-58.tar.gz源自官网
Magento的默认Nginx配置 演示: : 获取云服务器:在 马真托Magento最高1.9.x 默认的magento配置/单个或多个存储 magento2 Magento> 2.x 默认的magento配置/单个或多个存储 magento-proxy_pass Magento最高1.9.x ...
magento的SMTP插件magento的SMTP插件magento的SMTP插件
Ajax-Magento-ajax-add-to-cart.zip,[模块magento 1]magento ajax添加到购物车-ajoter vos produits au panier en ajax/感谢ajax将您的产品添加到购物车,ajax代表异步javascript和xml。它是多种web技术的集合,包括...