News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Showing custom fileds in category display.

Started by bakefrank, March 18, 2013, 14:06:13 PM

Previous topic - Next topic

bakefrank

Hello I'm developing a site here:
You will need to login
UN: tester
pw: tester1!

http://gruverscafeandcatering.com/index.php/sandwiches

I'm trying to get the category display to show the custom fields I have created.

I have followed the instructions and code in this thread:

http://forum.virtuemart.net/index.php?topic=100191.0

and have added the code:

Code: [Select]
$db = JFactory::getDBO();
     //please do check in php myadmin how your database table is called and replace it instead of "VM2_virtuemart_product_customfields" replace the "6" with your ID of Custom field you want to output
     $db->setQuery("SELECT custom_value FROM #__virtuemart_product_customfields WHERE virtuemart_product_id=".$product->virtuemart_product_id." and virtuemart_custom_id=5 ;"); 
     $db->query();
     $result = $db->loadResult();
    echo "<span class=\"YourClass\">".$result."</span>";
?>

to line 287 under Product Short description.

My problem is
It only shows one selection from the custom fields I have created.
So if you look under the product Subs it should have A custom field name Choose your sub and a drop down for custom fields for (american, Italian, Ham, turkey)

http://gruverscafeandcatering.com/index.php/sandwiches/sub-8-detail

However it does not show a drop selection as it does on the product page, it is only showing one field American:

THanks for all the help.