Anyone has an idea how to show and hide the subpanel? I have Sub Product module and I added a subpanel in the Product module. Now I want the sub product subpanel will show only if the Product type is Bundled. I tried using custom javascript.
I added this code below in custom/module/AOS_Product/view.detail.php
<?php
require_once 'modules/Documents/views/view.detail.php';
class customAOS_ProductsViewDetail extends ViewDetail{
public function display()
{
parent::display(); // TODO: Change the autogenerated stub
$javascript = <<<'EOT'
<script type="text/javascript">
const value = document.getElementById('product_type');
if(value != "Bundled"){
}
$("a[href=#subpanel_aos_products_ptt_subproduct_1]").parents('.panel-default sub_panel').addClass('hidden');
</script>
EOT;
$this->ss->display("custom/modules/AOS_Products/tpls/DetailView.tpl");
echo $javascript;
}
}