hi,
Hi,
Normally the Add to cart button and the custom fields are hidden in the category browse page by default Virtuemart Category (as you might know). This is something we brought to Virtuemart. But since we are developing template and templates are working based on "template overriding". There is no way to touch the way the event handler works. Those handlers run by Virtuemart core files. Templates basically change the "look" only, (not "functionality")
We have noticed this failure in Generic Child Variant and Stockable Custom Field Plugin long time ago and taken out the those 2 custom fields from the category page.
It didn't work because when multiple products have the Generic Child variants, the 1st one's selection applies to all others, because jQuery gets involved.
I have personally spent lots of hours to make this work (for generic child variant and Stockable Custom Field Plugin on category browse page) but i ended up with nothing. It just doesn't work.
But on the other hand, the simple custom fields (Cart Variant, Image Type Custom Field, etc..) works just fine on the category browse page ListView.
We have applied this patch long time ago to all of our templates. But apparently we forgot it for FlexibleMart.
To hide the custom fields from Category page (if Generic Child Variant and Stockable Custom Field Plugin is being used) follow these steps;
1- open this category browse page PHP file:
/templates/YOUR_TEMPLATE/html/com_virtuemart/category/default.php
default.php, flexv2,php, flexv3.php or flexv4.php depends on what layout you are using
2- look for this line:
<?php // Add To Cart Button
if (!VmConfig::get('use_as_catalog',0)) { ?>
3- replace it with this:
<?php
$customFieldCheck = 1;
if (!empty($product->customfieldsCart)) {
foreach ($product->customfieldsCart as $field) {
if (($field->field_type == "E") || ($field->field_type == "A")) {
$customFieldCheck = 0;
}
}
}
// Add To Cart Button
if (!VmConfig::get('use_as_catalog',0) && ($customFieldCheck)) { ?>
This coding modification will hide the "Custom fields and add to cart button" from category page (if Generic Child Variant and Stockable Cart Variant is being used). And disabling them is currently the "ONLY" way, otherwise you will get some incorrect orders and this will cause come bigger problems.
Regards,
Support