Generic Child Variant - Select Box & Cart Appearance

Started by brentonking, March 13, 2015, 02:04:47 AM

Previous topic - Next topic

brentonking

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_name0,$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!

Milbo

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

uniqbuy

Were you able to make this change? It would be good to know.

Thanks

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/