-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.3.24
I have created a custom component to enter information for our products. I'm kinda new to working with creating plugins. I've created a plugin to work with this information in the product show_default view. I have attached the component and plugin.
The code I have at the beginning of my show_default view to work with the plugin is:
// Get plugin 'productballistics' of plugin type 'ballistics'
$plugin = JPluginHelper::getPlugin('ballistics', 'productballistics');
// Check if plugin is enabled
if($plugin){
//fetch variables to run through productballistics plugin
if($this->row->unit_type == "pallets"){
if($this->row->package_count == "50000"){
$ballistic_sku = rtrim($this->element->product_code,"50KP");
}elseif($this->row->package_count == "100000"){
$ballistic_sku = rtrim($this->element->product_code,"100KP");
}
}elseif($this->row->unit_type == "cases"){
$ballistic_sku = rtrim($this->element->product_code,"L");
}else{
$ballistic_sku = $this->element->product_code;
}
$dispatcher = JDispatcher::getInstance();
$ballistics = $dispatcher->trigger('onProductballistics', array($ballistic_sku, $this->element->grains, $this->element->gun_type, $this->element->bullet_type));
}
$this->element->grains, $this->element->gun_type, and $this->element->bullet_type are all custom fields I've created for the products and they are not empty. The code I have further down in the view to display the results of working with the plugin is:
foreach($ballistics as $ballistic){
echo $ballistic;
}
I'm not getting anything to display and I know the data is there for the products I've tried this with. I'm sure it's something simple that is going on with this, but I'm just not sure what it is. Thanks for any help.