Upgrading Magento on regular basis not only brings new features and better UI but also security fixes which is vital part of your store security. While working with our clients’ projects for Magento Upgrade Service, we have found a JavaScript error with configurable products and swatches called “TypeError: opConfig is undefined”.
The error results in no changes of price while selecting custom options or configurable products. This is a major problem must be solved for proper working of products in upgraded Magento version.
Here, I have come with the simple solution to solve the error in minutes:
Find the file app/design/frontend/theme_package/layout/catalog.xml, search for related tags, if found, replace the head tag with following code. If not paste the below code in the file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
<script>varien/product.js</script> <script>varien/product_options.js</script> <script>varien/configurable.js</script> <script>varien/configurable.js</script> <script>varien/product.js</script> <script>varien/product_options.js</script> <script>varien/configurable.js</script> <script>varien/product.js</script> <script>varien/product_options.js</script> </catalog_product_compare_index > <script>varien/configurable.js</script> <script>varien/product.js</script> <script>varien/product_options.js</script> <script>varien/product.js</script> <script>varien/product_options.js</script> |
Find another file app/design/frontend/theme_package/layout/catalogsearch.xml and again find tag mentioned below, if found, replace head tag or paste whole code as shown.
1 2 3 |
<script>varien/configurable.js</script> <script>varien/product.js</script> <script>varien/product_options.js</script> |
Save the file and voila! The error gets solved immediately.
Hope this simple solution might have saved your time and helped you while upgrading Magento. Let me know if you are stuck with issue, I’ll always be there to help.
Till then, Happy Upgrading!