I am using magento 1.9.3.6 version. I have created custom option for product. I want to make checkbox by default checked. How can I implement this? enter image description here

有帮助吗?

解决方案

You can't do that using available default options. You have to write jQuery to set the input box as checked. Please find some hints below:

open app/design/frontend/base/default/template/catalog/product/view/options/type/select.phtml

and Copy this file to your theme folder and put below jQuery code at the end of this file

<script type="text/javascript">
    jQuery(".checkbox").prop( "checked", true );
</script>

You also need to add jQuery support in case its not already added. Additionally you can set input box checked only when your conditions match to set it as checked in jQuery.

许可以下: CC-BY-SA归因
scroll top