Hello people
I purchased both the Dynatabs theme, as well as the standalone tabs plugin, in order to find out exactly when and how is that weird thing caused, and here is the result of my investigation, which now needs your help, since what I'm talking for appears on every single joomla installation - no matter a clean copy + a clean vm, or a modified one.
In this topic
www.corshops.com/28-DynaTabs-Virtuemart-Theme/Is-DynaTabs-compatible-with-child-items.html the guy already stated the trouble, and addresses a part solution. But in my case, and at most of the other cases probably, there's something else causing the trouble.
The problem is the same stated there - the tabs go like ... 'disappeared' - what is actually done is that the code is being altered with style='display:none' and class="ui-tabs-hide" which leaves your description space blank.
When is this happening?
You say that there is a setting in the vm admin which is
'Enable content mambots / plugins in descriptions?'. But actually the only thing that is associated with that and is preventing the tabs from working is that particular piece of code, located in four pieces between 285 and 400 line located in /components/com_virtuemart/classes/ps_product_attribute.php which is :
Line 286: if( VM_CONTENT_PLUGINS_ENABLE == '1' ) { $html .= "<select class=\"inputbox\" onchange=\"var id = $('product_id_field')[selectedIndex].value; if(id != '') { document.location = '" . $mm_action_url . "index.php?option=com_virtuemart&page=shop.product_details&flypage=$flypage&Itemid=$Itemid&category_id=$category_id&product_id=' + id; }\" id=\"product_id_field\" name=\"prod_id[]\">\n" ;
Line 288: $html .= "<select class=\"inputbox\" onchange=\"var id = $('product_id_field')[selectedIndex].value; if(id != '') { loadNewPage( 'vmMainPage', '" . $mm_action_url . "index.php?option=com_virtuemart&page=shop.product_details&flypage=$flypage&Itemid=$Itemid&category_id=$category_id&product_id=' + id ); }\" id=\"product_id_field\" name=\"prod_id[]\">\n" ;
Line 395: if( VM_CONTENT_PLUGINS_ENABLE == '1' ) { $html .= "<select class=\"inputbox\" onchange=\"var id = $('product_id_field')[selectedIndex].value; if(id != '') { document.location = '" . $mm_action_url . "index.php?option=com_virtuemart&page=shop.product_details&flypage=$flypage&Itemid=$Itemid&category_id=$category_id&product_id=' + id; }\" id=\"product_id_field\" name=\"prod_id[]\">\n" ;
Line 397: $html .= "<select class=\"inputbox\" onchange=\"var id = $('product_id_field')[selectedIndex].value; if(id != '') { loadNewPage( 'vmMainPage', '" . $mm_action_url . "index.php?option=com_virtuemart&page=shop.product_details&flypage=$flypage&Itemid=$Itemid&category_id=$category_id&product_id=' + id ); }\" id=\"product_id_field\" name=\"prod_id[]\">\n" ;
and that's the thing that controls how is the data repopulated in the form after user chooses - reload of the whole page, or an ajax call to reload only the values that are actually changing. So here is what is the user experience - you have your tick switched on for 'Enable content mambots / plugins in descriptions?', and if a shopper chooses a child, he gets redirected to the page of the child product and yeah, it seems to work but with two disadvantages which I'll point after a few lines. In the second case, when you switch off 'Enable content mambots / plugins in descriptions?' you get a fast and quick ajax call which changes exactly what user needs to be changed - not the whole web site reloaded again. So this is the one disadvantage, and the other, not less important is that I (and almost every successful online store) am using a SEF url rewrite component which creates a new url every time that page is reloaded, and messes up lots of stuff which I don't want, and moreover - is not needed at all.
So to summarise - it does not matter at all if that tick will be on when we are using the dynatabs theme, it only matters if we have the standalone plugin for the tabs (as I said i purchased and tested them both, a lot of testing)
and second - the problem only appears when I use the ajax to populate prices, title etc. - the easiest thing to prove that is to change
if( VM_CONTENT_PLUGINS_ENABLE == '1' )
to
if( VM_CONTENT_PLUGINS_ENABLE == '0' )
, or to write both cases equal - and you'll see that there is no difference in the initial load of the javascript, the problem comes on the selection of an item via ajax, not after reloading the whole page. And the scenario is all the same regardless of theme, version and additional libraries used - I've done every single testing both on my modified joomla/vm, and both on clean installations without any other touches.
So, can you please take some time, to see why the classes get overriden and content hidden on the ajax load when a child product is selected?
I'm sure it will be appreciated by lots of people having the same trouble, or looking for something similar.
Thanks
Teodor