Hoping someone will be able to tell me what file I need to edit the Generic Child Variant Custom Field Display.
What I want to do is include a String substr() for the child product title (within the select box) that cuts off any text from the title that appears after a specific character.
In my case I think I will use ":"
That way I can have a child product called "Small: Dark Blue Shirt"
On the product details page it will appear as "Small" in the select box
On the cart page and invoices it will still appear in full as "Small: Dark Blue Shirt"
(This code worked on the cart page, however I know I might need to change it to suit the file that handles the select box display)
<?php
$custom_child_name = $prow->product_name;
if (($pos = strpos($prow->product_name, ":")) !== FALSE) {
$child_version = substr($custom_child_name, 0,$pos);
}
echo JHtml::link ($prow->url, $child_version);
?>
I think this might be a pretty common issue VM users have/will face and this could be a pretty useful addition to the Generic Child Variant custom field parameters. Perhaps have it so that it can be turned on and off & the admin can choose a specific character to use as the cut off character.
Thanks in advance!
cutomfields model /administrator/components/com_virtuemart/models/customfield.php
function displayProductCustomfieldFE
at case 'A': line 924
so I think you want to manipulate line 970, the $options array.
Were you able to make this change? It would be good to know.
Thanks
You can change this now via override! http://docs.virtuemart.net/tutorials/templating-layouts/199-sublayouts.html