Reputation: 21
I am planning on adding custom option which can input steel dimension the customer wants and can purchase. But I am not able view this on the product end and there is no error in the log. Even in the product view page am not getting errors on the console and this code was not visible after using inspect on the page.
snippet of the code I used:
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Module Steel Display</name>
<version>1.0</version>
<author>JD</author>
<link></link>
<code>product_steel_display</code>
<file path="catalog/view/theme/default/template/product/product.twig">
<operation>
<search><![CDATA[<div id="product">]]></search>
<add position="after"><![CDATA[<div class="form-group">
<label class="control-label" for="input-option">{{ diameter_option }}</label>
<select name="diameter" id="diameter" class="form-control">
<option value="0">8mm</option>
<option value="1">10mm</option>
<option value="2">12mm</option>
<option value="3">16mm</option>
<option value="4">20mm</option>
<option value="5">25mm</option>
<option value="6">32mm</option>
</select></div>]]>
</add>
</operation>
</file>
</modification>
Upvotes: 2
Views: 117
Reputation: 11
In modification file ,your script is added after the and there is a {% if options %} condition,when you slect option form admin panel then this will be visible.enter image description here
see this image , you need to select a option to enable this script
Upvotes: 1