Skip to main content

Show Hikamarket items in show_block_characteristic

More
8 years 7 months ago #287289 by neo191987
Hi try to add items from HikaMarket but do not want to show up in show_block_characteristic.
I tried to get a vendor's name through this code:
Code:
if(!defined('HIKAMARKET_COMPONENT')) include_once rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_hikamarket'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php'; $vendorClass = hikamarket::get('class.vendor'); $vendor = $vendorClass->get( $vendor_id ); echo $vendor->vendor_name;
or
Code:
if(!defined('HIKAMARKET_COMPONENT')) include_once rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_hikamarket'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php'; $vendorClass = hikamarket::get('class.vendor'); $vendor = $vendorClass->get( $vendor_id ); foreach($vendor as $vendor){ echo $vendor->vendor_name; }
But without success. Where have I been wrong?

Please Log in or Create an account to join the conversation.

More
8 years 7 months ago - 8 years 7 months ago #287329 by neo191987
Hello I was able to show a vendor's photo using this code. Here I have a problem with the ID of the vendor.
Code:
<?php $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->from($db->quoteName('#__hikamarket_vendor')); $query->select($db->quoteName(array('vendor_image'))); $db->setQuery($query); $vendor = $db->loadObjectList(); foreach($vendor as $vendor){ $vendor_image = null; $imageHelper = hikamarket::get('shop.helper.image'); if(!empty($vendor->vendor_image)) $vendor_image = $imageHelper->getThumbnail($vendor->vendor_image, array(100,100), array()); if(empty($vendor_image) || !$vendor_image->success) $vendor_image = $imageHelper->getThumbnail($this->config->get('default_vendor_image', ''), array(100,100), array('default' => true), true); } ?> <img src="<?php echo @$vendor_image->url; ?>" alt=""/>

But for the vendor vote I will need some help. This is the code I use. I found the code to extract the database but there is some problem.
Code:
<?php $db = JFactory::getDbo(); $query = $db->getQuery(true); $query = 'SELECT vote.vote_id, vote.vote_type, vote.vote_ref_id, vendor.vendor_id, vendor.vendor_average_score as `average_score`, vendor.vendor_total_vote as `total_vote` '. ' FROM '.hikamarket::table('vendor').' as vendor '. ' INNER JOIN '.hikamarket::table('shop.vote').' AS vote ON (vote.vote_ref_id = vendor.vendor_id AND vote.vote_type = '.$db->Quote('vendor').') '. ' WHERE vote.vote_id IN ('.implode(',', $elements).')'; $db->setQuery($query); $vote = $db->loadObjectList(); foreach($vote as $vote){ $voteParams = new HikaParameter(); $voteParams->set('vote_type', 'vendor'); $voteParams->set('vote_ref_id', $this->row->vendor_id); $js = ''; echo hikamarket::getLayout('shop.vote', 'mini', $voteParams, $js); } ?>
Last edit: 8 years 7 months ago by neo191987.

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.176 seconds
Powered by Kunena Forum