Hi,
I've been able to load a list of manufacturers in to my form using this first before showing HTML:
<?php
/*
* Module Helper
*
* @package VirtueMart
* @copyright (C) 2010 - Patrick Kohl
* @ Email: cyber__fr|at|hotmail.com
*
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* VirtueMart is Free Software.
* VirtueMart comes with absolute no warranty.
*
* <!-- w --><a class="postlink" href="http://www.virtuemart.net">www.virtuemart.net</a><!-- w -->
*/
if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'config.php');
VmConfig::loadConfig();
if (!class_exists( 'VmImage' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'image.php');
if(!class_exists('TableMedias')) require(JPATH_VM_ADMINISTRATOR.DS.'tables'.DS.'medias.php');
if(!class_exists('TableManufacturer_medias')) require(JPATH_VM_ADMINISTRATOR.DS.'tables'.DS.'manufacturer_medias.php');
if(!class_exists('TableManufacturers')) require(JPATH_VM_ADMINISTRATOR.DS.'tables'.DS.'manufacturers.php');
if (!class_exists( 'VirtueMartModelManufacturer' )){
JLoader::import( 'manufacturer', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'models' );
}
?>
Then in a custom code field I use:
<?php
if (!class_exists( 'VirtueMartModelManufacturer' ))
JLoader::import( 'manufacturer', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'models' );
$vendorId = JRequest::getInt('vendorid', 1);
$model = VmModel::getModel('Manufacturer');
$manufacturers = $model->getManufacturers(true, true,true);
$model->addImages($manufacturers);
if(empty($manufacturers)) return false;
/* load the template */
?>
<?php
foreach ($manufacturers as $manufacturer) {?>
<input type="checkbox" name="input_checkbox_group_artists[]" id="input_checkbox_group_artists_<?php echo $manufacturer->mf_lname; ?>" title="" value="<?php echo $manufacturer->mf_name; ?><?php echo $manufacturer->mf_lname; ?>" class="" >
<label for="input_checkbox_group_artists_<?php echo $manufacturer->mf_lname; ?>"><?php echo $manufacturer->mf_name; ?> <?php echo $manufacturer->mf_lname; ?></label>
<?php
} ?>
The form displays all of my checkboxes, however when I view the results all I get is:
Artists that they are interested in: {input_custom_17}
Any ideas as to why I am not getting the selected info?
I am using {input_custom_17}
in the admin template.
Thanks
=-s-=
I've been able to load a list of manufacturers in to my form using this first before showing HTML:
<?php
/*
* Module Helper
*
* @package VirtueMart
* @copyright (C) 2010 - Patrick Kohl
* @ Email: cyber__fr|at|hotmail.com
*
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* VirtueMart is Free Software.
* VirtueMart comes with absolute no warranty.
*
* <!-- w --><a class="postlink" href="http://www.virtuemart.net">www.virtuemart.net</a><!-- w -->
*/
if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'config.php');
VmConfig::loadConfig();
if (!class_exists( 'VmImage' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'image.php');
if(!class_exists('TableMedias')) require(JPATH_VM_ADMINISTRATOR.DS.'tables'.DS.'medias.php');
if(!class_exists('TableManufacturer_medias')) require(JPATH_VM_ADMINISTRATOR.DS.'tables'.DS.'manufacturer_medias.php');
if(!class_exists('TableManufacturers')) require(JPATH_VM_ADMINISTRATOR.DS.'tables'.DS.'manufacturers.php');
if (!class_exists( 'VirtueMartModelManufacturer' )){
JLoader::import( 'manufacturer', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'models' );
}
?>
Then in a custom code field I use:
<?php
if (!class_exists( 'VirtueMartModelManufacturer' ))
JLoader::import( 'manufacturer', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'models' );
$vendorId = JRequest::getInt('vendorid', 1);
$model = VmModel::getModel('Manufacturer');
$manufacturers = $model->getManufacturers(true, true,true);
$model->addImages($manufacturers);
if(empty($manufacturers)) return false;
/* load the template */
?>
<?php
foreach ($manufacturers as $manufacturer) {?>
<input type="checkbox" name="input_checkbox_group_artists[]" id="input_checkbox_group_artists_<?php echo $manufacturer->mf_lname; ?>" title="" value="<?php echo $manufacturer->mf_name; ?><?php echo $manufacturer->mf_lname; ?>" class="" >
<label for="input_checkbox_group_artists_<?php echo $manufacturer->mf_lname; ?>"><?php echo $manufacturer->mf_name; ?> <?php echo $manufacturer->mf_lname; ?></label>
<?php
} ?>
The form displays all of my checkboxes, however when I view the results all I get is:
Artists that they are interested in: {input_custom_17}
Any ideas as to why I am not getting the selected info?
I am using {input_custom_17}
in the admin template.
Thanks
=-s-=
Hi,
Please fix the template code, use this instead:
The auto template generation is not smart enough to find dynamic fields names🙂
Regards,
Max
Please fix the template code, use this instead:
{input_checkbox_group_artists}
The auto template generation is not smart enough to find dynamic fields names🙂
Regards,
Max
HI,
Wow Thanks a million. I can't believe it was that easy... yet so hard to figure out:)!!
Works like a champ now... however.. is there a way to remove the special characters that come in with the email (array ( 0 => ')??
i.e.
"Please send Them info on: array ( 0 => 'Notification of new works by artists I\'ve selected', )
Artists that they are interested in: array ( 0 => 'DouglasAtwill', 1 => 'PeterCampbell', 2 => 'SilviaDavis', )"
essentially removing the array ( 0=> ', etc?
=-s-=
Wow Thanks a million. I can't believe it was that easy... yet so hard to figure out:)!!
Works like a champ now... however.. is there a way to remove the special characters that come in with the email (array ( 0 => ')??
i.e.
"Please send Them info on: array ( 0 => 'Notification of new works by artists I\'ve selected', )
Artists that they are interested in: array ( 0 => 'DouglasAtwill', 1 => 'PeterCampbell', 2 => 'SilviaDavis', )"
essentially removing the array ( 0=> ', etc?
=-s-=
Hi gamecat2300 ,
Please drag a Handle Arrays action into the OnSubmit event and move it up before the Email action.
Bob
Please drag a Handle Arrays action into the OnSubmit event and move it up before the Email action.
Bob
HI,
I do have that set up that way. I still get the additional code in the email to admin however.
=-s-=
I do have that set up that way. I still get the additional code in the email to admin however.
=-s-=
Hi gamecat2300,
Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.
Note: if you are using the Easy Wizard you may need to switch to the Advanced Wizard to do this; if you want to continue to use the Easy Wizard please make a copy of your form first and add the Debugger action to the copy.
Bob
Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.
Note: if you are using the Easy Wizard you may need to switch to the Advanced Wizard to do this; if you want to continue to use the Easy Wizard please make a copy of your form first and add the Debugger action to the copy.
Bob
This topic is locked and no more replies can be posted.