本文整理汇总了PHP中hikashop_contentLink函数的典型用法代码示例。如果您正苦于以下问题:PHP hikashop_contentLink函数的具体用法?PHP hikashop_contentLink怎么用?PHP hikashop_contentLink使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hikashop_contentLink函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProductRoute
public static function getProductRoute($contentId, $contentCatId, $language)
{
list($id, $name) = explode(':', $contentId, 2);
if (!(include_once rtrim(JPATH_ADMINISTRATOR, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_hikashop' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'helper.php')) {
return;
}
$class = hikashop_get('class.product');
$data = $class->get($id);
if (empty($link)) {
$link = 'index.php?option=com_hikashop&ctrl=product&task=show&cid=' . $id . '&name=' . $name;
}
$needles = array('layout' => 'listing');
if (!empty($language) && $language != '*' && JLanguageMultilang::isEnabled()) {
static::buildLanguageLookup();
if (isset(static::$lang_lookup[$language])) {
$link .= '&lang=' . static::$lang_lookup[$language];
$needles['language'] = $language;
}
}
if ($item = self::lookupItem($needles, 'product')) {
$link .= '&Itemid=' . $item;
} elseif (!empty($needles) && ($item = self::lookupItem(array(), 'product'))) {
$link .= '&Itemid=' . $item;
}
$link = hikashop_contentLink($link, $data, false, true);
return $link;
}
示例2: foreach
$group = $this->config->get('group_options', 0);
foreach ($this->order->products as $product) {
if ($group && $product->order_product_option_parent_id) {
continue;
}
?>
<tr class="row<?php
echo $k;
?>
">
<td class="hikashop_order_item_name_value">
<?php
if ($this->invoice_type == 'order' && !empty($product->product_id)) {
?>
<a class="hikashop_order_product_link" href="<?php
echo hikashop_contentLink('product&task=show&cid=' . $product->product_id . $url_itemid, $product);
?>
">
<?php
}
?>
<p class="hikashop_order_product_name">
<?php
echo $product->order_product_name;
?>
<?php
if ($this->config->get('show_code')) {
?>
<span class="hikashop_product_code_order"><?php
echo $product->order_product_code;
?>
示例3: waitlist
function waitlist()
{
$user = hikashop_loadUser(true);
$this->assignRef('element', $user);
$app = JFactory::getApplication();
$product_id = (int) hikashop_getCID('product_id');
$config =& hikashop_config();
$this->assignRef('config', $config);
$filters = array('a.product_id=' . $product_id);
hikashop_addACLFilters($filters, 'product_access', 'a');
$query = 'SELECT a.*,b.product_category_id, b.category_id, b.ordering FROM ' . hikashop_table('product') . ' AS a LEFT JOIN ' . hikashop_table('product_category') . ' AS b ON a.product_id = b.product_id WHERE ' . implode(' AND ', $filters) . ' LIMIT 1';
$database = JFactory::getDBO();
$database->setQuery($query);
$element = $database->loadObject();
if (empty($element)) {
return;
}
if ($element->product_type == 'variant') {
$this->selected_variant_id = $product_id;
$filters = array('a.product_id=' . $element->product_parent_id);
hikashop_addACLFilters($filters, 'product_access', 'a');
$query = 'SELECT a.*,b.* FROM ' . hikashop_table('product') . ' AS a LEFT JOIN ' . hikashop_table('product_category') . ' AS b ON a.product_id = b.product_id WHERE ' . implode(' AND ', $filters) . ' LIMIT 1';
$database->setQuery($query);
$main = $database->loadObject();
if (empty($main)) {
return;
}
$main->variants = array($element);
$element = $main;
$product_id = $element->product_id;
$ids = array($element->variants[0]->product_id, $product_id);
$query = 'SELECT a.*,b.* FROM ' . hikashop_table('variant') . ' AS a LEFT JOIN ' . hikashop_table('characteristic') . ' AS b ON a.variant_characteristic_id=b.characteristic_id WHERE a.variant_product_id IN (' . implode(',', $ids) . ') ORDER BY a.ordering,b.characteristic_value';
$database->setQuery($query);
$characteristics = $database->loadObjectList();
if (!empty($characteristics)) {
$mainCharacteristics = array();
foreach ($characteristics as $characteristic) {
if ($product_id == $characteristic->variant_product_id) {
$mainCharacteristics[$product_id][$characteristic->characteristic_parent_id][$characteristic->characteristic_id] = $characteristic;
}
}
$cartClass = hikashop_get('class.cart');
$cartClass->addCharacteristics($element, $mainCharacteristics, $characteristics);
$productClass = hikashop_get('class.product');
$productClass->checkVariant($element->variants[0], $element);
$element = $element->variants[0];
}
}
$productClass = hikashop_get('class.product');
$productClass->addAlias($element);
if (!$element->product_published) {
return;
}
$this->assignRef('product', $element);
global $Itemid;
$url_itemid = '';
if (!empty($Itemid)) {
$url_itemid = '&Itemid=' . $Itemid;
}
$product_url = hikashop_contentLink('product&task=show&cid=' . (int) $element->product_id . '&name=' . $element->alias . $url_itemid, $element);
$this->assignRef('product_url', $product_url);
}
示例4: defined
<?php
/**
* @package HikaShop for Joomla!
* @version 2.6.1
* @author hikashop.com
* @copyright (C) 2010-2016 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
$link = hikashop_contentLink('product&task=show&cid=' . $this->row->product_id . '&name=' . $this->row->alias . $this->itemid . $this->category_pathway, $this->row);
if (!empty($this->row->extraData->top)) {
echo implode("\r\n", $this->row->extraData->top);
}
if ($this->config->get('thumbnail', 1)) {
?>
<!-- PRODUCT IMG -->
<div style="height:<?php
echo $this->image->main_thumbnail_y;
?>
px;text-align:center;clear:both;" class="hikashop_product_image">
<div style="position:relative;text-align:center;clear:both;width:<?php
echo $this->image->main_thumbnail_x;
?>
px;margin: auto;" class="hikashop_product_image_subdiv">
<?php
if ($this->params->get('link_to_product_page', 1)) {
?>
<a href="<?php
echo $link;
?>
示例5: getLink
function getLink($cid, $alias = '')
{
if (!is_object($cid)) {
$obj = new stdClass();
$obj->category_id = $cid;
$obj->alias = $alias;
$cid = $obj;
}
if (!empty($cid->override_url)) {
return $cid->override_url;
}
global $Itemid;
$config =& hikashop_config();
if (empty($this->module) && !empty($Itemid) && $config->get('forward_to_submenus', 1)) {
$app = JFactory::getApplication();
$menus = $app->getMenu();
if (!HIKASHOP_J16) {
$query = 'SELECT a.id as itemid FROM `#__menu` as a WHERE a.access = 0 AND a.parent=' . (int) $Itemid;
} else {
$query = 'SELECT a.id as itemid FROM `#__menu` as a WHERE a.client_id=0 AND a.parent_id=' . (int) $Itemid;
}
$db = JFactory::getDBO();
$db->setQuery($query);
$submenus = $db->loadObjectList();
foreach ($submenus as $submenu) {
$menu = $menus->getItem($submenu->itemid);
if (!empty($menu) && !empty($menu->link) && strpos($menu->link, 'option=' . HIKASHOP_COMPONENT) !== false && (strpos($menu->link, 'view=category') !== false || strpos($menu->link, 'view=') === false || strpos($menu->link, 'view=product') !== false)) {
$params = $config->get('menu_' . $submenu->itemid);
if (!empty($params) && $params['selectparentlisting'] == $cid->category_id) {
return JRoute::_('index.php?option=com_hikashop&Itemid=' . $submenu->itemid);
}
}
}
}
$type = 'category';
if (!empty($this->menu_id)) {
$parts = explode('=', $this->menu_id);
$app = JFactory::getApplication();
$menus = $app->getMenu();
$menu = $menus->getItem($parts[1]);
if (!empty($menu) && !empty($menu->link) && strpos($menu->link, 'option=' . HIKASHOP_COMPONENT) !== false && (strpos($menu->link, 'view=') === false || strpos($menu->link, 'view=product') !== false)) {
$type = 'product';
}
}
return hikashop_contentLink($type . '&task=listing&cid=' . $cid->category_id . '&name=' . $cid->alias . $this->menu_id, $cid);
}
示例6: HikaParameter
$params = new HikaParameter($empty);
echo $this->cart->displayButton(JText::_('ADD_ME_WAITLIST'), 'add_waitlist', $params, hikashop_completeLink('product&task=waitlist&cid=' . $this->row->product_id . $url_itemid), 'window.location=\'' . str_replace("'", "\\'", hikashop_completeLink('product&task=waitlist&cid=' . $this->row->product_id . $url_itemid)) . '\';return false;');
}
if (hikashop_level(1) && $this->params->get('add_to_wishlist') && $wishlistEnabled && !$hideForGuest && $this->config->get('display_add_to_wishlist_for_free_products', '1')) {
if (!empty($this->row->has_options)) {
if ($this->params->get('add_to_cart', 1)) {
echo $this->cart->displayButton(JText::_('CHOOSE_OPTIONS'), 'choose_options', $this->params, hikashop_contentLink('product&task=show&product_id=' . $this->row->product_id . '&name=' . $this->row->alias . $url_itemid . $this->category_pathway, $this->row), 'window.location = \'' . str_replace("'", "\\'", hikashop_contentLink('product&task=show&product_id=' . $this->row->product_id . '&name=' . $this->row->alias . $url_itemid . $this->category_pathway, $this->row)) . '\';return false;', '');
}
} else {
echo '<div class="hikashop_add_wishlist">';
echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'), 'add', $this->params, $url, $wishlistAjax, '', @$this->row->product_max_per_order, 1, '', false);
echo '<span></span>';
echo '</div>';
}
}
}
?>
</div>
<?php
} elseif (hikashop_level(1) && $wishlistEnabled && $this->params->get('add_to_wishlist', '1') && $this->config->get('display_add_to_wishlist_for_free_products', '1') && !$hideForGuest && !$this->config->get('display_add_to_cart_for_free_products')) {
if (!empty($this->row->has_options)) {
if ($this->params->get('add_to_cart', 1)) {
echo $this->cart->displayButton(JText::_('CHOOSE_OPTIONS'), 'choose_options', $this->params, hikashop_contentLink('product&task=show&product_id=' . $this->row->product_id . '&name=' . $this->row->alias . $url_itemid . $this->category_pathway, $this->row), 'window.location = \'' . str_replace("'", "\\'", hikashop_contentLink('product&task=show&product_id=' . $this->row->product_id . '&name=' . $this->row->alias . $url_itemid . $this->category_pathway, $this->row)) . '\';return false;', '');
}
} else {
$wishlistAjax = 'if(hikashopCheckChangeForm(\'item\'' . $formName . ')){ return hikashopModifyQuantity(\'' . (int) @$this->row->product_id . '\',field,1' . $formName . ',\'wishlist\',' . $module_id . '); } else { return false; }';
echo '<div class="hikashop_add_wishlist">';
echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'), 'add', $this->params, $url, $wishlistAjax, '', @$this->row->product_max_per_order, 1, '', false);
echo '</div>';
}
}
示例7: array
if (isset($cart->images[0])) {
$image_options = array('default' => true, 'forcesize' => $this->config->get('image_force_size', true), 'scale' => $this->config->get('image_scale_mode', 'inside'));
$img = $this->image->getThumbnail(@$cart->images[0]->file_path, array('width' => $width, 'height' => $height), $image_options);
if ($img->success) {
echo '<img class="hikashop_product_cart_image" title="' . $this->escape(@$cart->images[0]->file_description) . '" alt="' . $this->escape(@$cart->images[0]->file_name) . '" src="' . $img->url . '"/>';
}
}
?>
</td>
<td data-title="<?php
echo JText::_('CART_PRODUCT_NAME');
?>
">
<p class="hikashop_cart_product_name">
<a class="hikashop_no_print" href="<?php
echo hikashop_contentLink('product&task=show&cid=' . $cart->product_id . '&name=' . $cart->alias . $url_itemid, $cart);
?>
">
<?php
if (!isset($cart->bought) || !$cart->bought) {
echo $cart->product_name;
} else {
echo JHTML::tooltip(implode('<br />', $cart->bought), JText::_('HIKA_BOUGHT_BY'), '', $cart->product_name);
}
if ($this->params->get('show_code')) {
echo ' (' . $cart->product_code . ')';
}
?>
</a>
</p>
<?php
示例8: add_waitlist
function add_waitlist()
{
JRequest::checkToken('request') || jexit('Invalid Token');
$element = new stdClass();
$formData = JRequest::getVar('data', array(), '', 'array');
foreach ($formData['register'] as $column => $value) {
hikashop_secureField($column);
$element->{$column} = strip_tags($value);
}
$user = JFactory::getUser();
$app = JFactory::getApplication();
if (empty($element->email) && $user->guest) {
$app->enqueueMessage(JText::_('VALID_EMAIL'));
return $this->waitlist();
}
$config =& hikashop_config();
if (!$config->get('product_waitlist', 0)) {
return $this->waitlist();
}
$waitlist_subscribe_limit = $config->get('product_waitlist_sub_limit', 10);
$product_id = 0;
$itemId = JRequest::getVar('Itemid');
$url_itemid = '';
if (!empty($itemId)) {
$url_itemid = '&Itemid=' . $itemId;
}
$alias = '';
if (!empty($element->product_id)) {
$class = hikashop_get('class.product');
$product = $class->get((int) $element->product_id);
if (!empty($product)) {
if ($product->product_type == 'variant') {
$db = JFactory::getDBO();
$db->setQuery('SELECT * FROM ' . hikashop_table('variant') . ' AS a LEFT JOIN ' . hikashop_table('characteristic') . ' AS b ON a.variant_characteristic_id=b.characteristic_id WHERE a.variant_product_id=' . (int) $element->product_id . ' ORDER BY a.ordering');
$product->characteristics = $db->loadObjectList();
$parentProduct = $class->get((int) $product->product_parent_id);
$class->checkVariant($product, $parentProduct);
}
$product_id = (int) $product->product_id;
$class->addAlias($product);
$alias = $product->alias;
}
}
if ($product_id == 0) {
return $this->waitlist();
}
$email = !empty($element->email) ? $element->email : '';
$name = !empty($element->name) ? $element->name : '';
$db = JFactory::getDBO();
$sql = 'SELECT waitlist_id FROM ' . hikashop_table('waitlist') . ' WHERE email=' . $db->quote($email) . ' AND product_id=' . (int) $product_id;
$db->setQuery($sql);
$subscription = $db->loadResult();
if (empty($subscription)) {
$sql = 'SELECT count(*) FROM ' . hikashop_table('waitlist') . ' WHERE product_id=' . (int) $product_id;
$db->setQuery($sql);
$subscriptions = $db->loadResult();
if ($subscriptions < $waitlist_subscribe_limit || $waitlist_subscribe_limit <= 0) {
$sql = 'INSERT IGNORE INTO ' . hikashop_table('waitlist') . ' (`product_id`,`date`,`email`,`name`,`product_item_id`) VALUES (' . (int) $product_id . ', ' . time() . ', ' . $db->quote($email) . ', ' . $db->quote($name) . ', ' . (int) $itemId . ');';
$db->setQuery($sql);
$db->query();
$app->enqueueMessage(JText::_('WAITLIST_SUBSCRIBE'));
$subject = JText::_('WAITLIST_REQUEST');
if (!empty($product->product_name)) {
$subject = JText::sprintf('WAITLIST_REQUEST_FOR_PRODUCT', strip_tags($product->product_name));
}
$mailClass = hikashop_get('class.mail');
$infos = new stdClass();
$infos->user =& $element;
$infos->product =& $product;
$mail = $mailClass->get('waitlist_admin_notification', $infos);
$mail->subject = $subject;
$mail->from_email = $config->get('from_email');
$mail->from_name = $config->get('from_name');
$mail->reply_email = $element->email;
if (empty($mail->dst_email)) {
$mail->dst_email = array($config->get('from_email'));
}
$status = $mailClass->sendMail($mail);
} else {
$app->enqueueMessage(JText::_('WAITLIST_FULL'));
}
} else {
$app->enqueueMessage(JText::_('ALREADY_REGISTER_WAITLIST'));
}
$app->enqueueMessage(JText::sprintf('CLICK_HERE_TO_GO_BACK_TO_PRODUCT', hikashop_contentLink('product&task=show&cid=' . $product->product_id . '&name=' . $alias . $url_itemid, $product)));
$url = JRequest::getVar('redirect_url');
if (!empty($url)) {
$app->redirect($url);
} else {
$this->waitlist();
}
}
示例9: rtrim
}
if ($this->config->get('dimensions_display', 0) && bccomp($this->element->product_length, 0, 3)) {
?>
<p class="hikashop_product_length_main">
<?php
echo JText::_('PRODUCT_LENGTH') . ': ' . rtrim(rtrim($this->element->product_length, '0'), ',.') . ' ' . JText::_($this->element->product_dimension_unit);
?>
</p>
<?php
}
if ($this->config->get('dimensions_display', 0) && bccomp($this->element->product_height, 0, 3)) {
?>
<p class="hikashop_product_height_main">
<?php
echo JText::_('PRODUCT_HEIGHT') . ': ' . rtrim(rtrim($this->element->product_height, '0'), ',.') . ' ' . JText::_($this->element->product_dimension_unit);
?>
</p>
<?php
}
if ($this->config->get('manufacturer_display', 0) && !empty($this->element->product_manufacturer_id)) {
$class = hikashop_get('class.category');
$manufacturer = $class->get($this->element->product_manufacturer_id);
$menuClass = hikashop_get('class.menus');
$Itemid = $menuClass->loadAMenuItemId('manufacturer', 'listing');
if (empty($Itemid)) {
$Itemid = $menuClass->loadAMenuItemId('', '');
}
$categoryClass = hikashop_get('class.category');
$categoryClass->addAlias($manufacturer);
echo '<p class="hikashop_product_brand_main">' . JText::_('MANUFACTURER') . ': ' . '<a href="' . hikashop_contentLink('category&task=listing&cid=' . $manufacturer->category_id . '&name=' . $manufacturer->alias . '&Itemid=' . $Itemid, $manufacturer) . '">' . $manufacturer->category_name . '</a> </p>';
}
示例10: onAlbumPrepare
/**
* Plugin that returns the object list for DJ-Mediatools album
*
* Each object must contain following properties (mandatory): title, description, image
* Optional properties: link, target (_blank or _self), alt (alt attribute for image)
*
* @param object The album params
*/
public function onAlbumPrepare(&$source, &$params)
{
// Lets check the requirements
$check = $this->onCheckRequirements($source);
if (is_null($check) || is_string($check)) {
return null;
}
$app = JFactory::getApplication();
require_once JPATH_ADMINISTRATOR . '/components/com_hikashop/helpers/helper.php';
require_once JPATH_BASE . '/components/com_hikashop/views/product/view.html.php';
$view = new ProductViewProduct(array('base_path' => HIKASHOP_FRONT));
$view->setLayout('listing');
// create params for hikashop view
$mparams = new JRegistry();
$mparams->set('show_limit', 0);
$mparams->set('from_module', 'djmediatools');
$mparams->set('content_type', 'product');
$mparams->set('add_to_wishlist', 0);
$mparams->set('link_to_product_page', 0);
$mparams->set('show_vote_product', 0);
$mparams->set('display_custom_item_fields', 0);
$mparams->set('display_filters', 0);
$mparams->set('display_badges', 0);
// get options from album
$mparams->def('limit', $params->get('max_images'));
$mparams->def('content_synchronize', (int) $params->get('plg_hikashop_content_synchronize'));
$mparams->def('product_synchronize', $params->get('plg_hikashop_product_synchronize'));
$mparams->def('recently_viewed', (int) $params->get('plg_hikashop_recently_viewed'));
$mparams->def('selectparentlisting', $params->get('plg_hikashop_selectparentlisting'));
$mparams->def('filter_type', $params->get('plg_hikashop_filter_type'));
$mparams->def('product_order', $params->get('plg_hikashop_product_order'));
$mparams->def('order_dir', $params->get('plg_hikashop_order_dir'));
$mparams->def('itemid', $params->get('plg_hikashop_itemid'));
$mparams->def('add_to_cart', $params->get('plg_hikashop_add_to_cart'));
$mparams->def('show_quantity_field', $params->get('plg_hikashop_show_quantity_field'));
$mparams->def('show_out_of_stock', $params->get('plg_hikashop_show_out_of_stock'));
$mparams->def('show_price', $params->get('plg_hikashop_show_price'));
$mparams->def('random', $mparams->get('product_order') == 'random' ? 1 : 0);
$show_price = (bool) $mparams->get('show_price');
$show_addtocart = (bool) $mparams->get('add_to_cart');
$default_image = $params->get('plg_hikashop_image');
/* hikashop authors force me to do it, because their component is not object oriented and there is no other way
* to get listing of the products unless we will rewrite the whole component logic, what is nonsens :)
*/
ob_start();
$view->display(null, $mparams);
$js = @$view->js;
ob_get_clean();
// we don't need this, just $view object after view rendering
//$this->debug($view->row);
$slides = array();
foreach ($view->rows as $item) {
$slide = (object) array();
$slide->image = $item->file_path;
$slide->alt = $item->file_name;
if (empty($slide->image)) {
$slide->image = DJMediatoolsLayoutHelper::getImageFromText($item->product_description);
}
// if no image found in product description then take default image
if (empty($slide->image)) {
$slide->image = $default_image;
} else {
$slide->image = str_replace(JURI::root(true), '', $view->image->uploadFolder_url) . $slide->image;
}
// if no default image set then don't display this product
if (empty($slide->image)) {
continue;
}
$slide->title = $item->product_name;
$slide->description = $item->product_description;
$slide->canonical = $slide->link = hikashop_contentLink('product&task=show&cid=' . $item->product_id . '&name=' . $item->alias . $view->itemid . $view->category_pathway, $item);
$slide->id = $item->product_id . ':' . $item->alias;
if ($comments = $params->get('commnets', 0)) {
$host = str_replace(JURI::root(true), '', JURI::root());
$host = preg_replace('/\\/$/', '', $host);
switch ($comments) {
case 1:
// jcomments
$slide->comments = array('id' => $item->product_id, 'group' => 'com_hikashop');
break;
case 2:
// disqus
$disqus_shortname = $params->get('disqus_shortname', '');
if (!empty($disqus_shortname)) {
$slide->comments = array();
$slide->comments['url'] = $host . $slide->link;
$slide->comments['identifier'] = $disqus_shortname . '-hikashop-' . $item->product_id;
// ??
}
break;
case 3:
// facebook
//.........这里部分代码省略.........
示例11: array
$img = $this->image->getThumbnail(@$row->images[0]->file_path, array('width' => $image_width, 'height' => $image_height), $image_options);
if ($img->success) {
echo '<img class="hikashop_product_cart_image" title="' . $this->escape(@$row->images[0]->file_description) . '" alt="' . $this->escape(@$row->images[0]->file_name) . '" src="' . $img->url . '"/>';
}
?>
</td>
<?php
}
if ($this->params->get('show_cart_product_name', 1)) {
?>
<td class="hikashop_cart_module_product_name_value hikashop_cart_value">
<?php
if (@$defaultParams['link_to_product_page']) {
?>
<a href="<?php
echo hikashop_contentLink('product&task=show&cid=' . $row->product_id . '&name=' . $row->alias . $this->url_itemid, $row);
?>
" ><?php
}
?>
<?php
echo $row->product_name;
?>
<?php
if ($this->config->get('show_code')) {
?>
<span class="hikashop_product_code_cart"><?php
echo $row->product_code;
?>
</span><?php
}
示例12: foreach
}
foreach ($ids as $k => $v) {
?>
<td></td>
<?php
}
?>
</tr>
<tr id="hikashop_compare_tr_name">
<td class="hikashop_compare_title_first_column"></td>
<?php
foreach ($this->elements as $element) {
if (!isset($element->alias)) {
$element->alias = '';
}
$link = hikashop_contentLink('product&task=show&cid=' . $element->product_id . '&name=' . $element->alias . $url_itemid, $element);
?>
<td class="hikashop_compare_title_prod_column">
<h2>
<a href="<?php
echo $link;
?>
" title="<?php
echo $this->escape($element->product_name);
?>
">
<span id="hikashop_product_<?php
echo $element->product_id;
?>
_name_main" class="hikashop_product_name_main"><?php
echo $element->product_name;
示例13: showcart
function showcart()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$menu = $menus->getActive();
global $Itemid;
if (empty($menu) && !empty($Itemid)) {
$menus->setActive($Itemid);
$menu = $menus->getItem($Itemid);
}
if (isset($menu->params) && is_object($menu->params)) {
$cart_type = $menu->params->get('cart_type');
}
if (!isset($cart_type) || $cart_type == null || empty($cart_type)) {
if (isset($this->params) && is_object($this->params)) {
$cart_type = $this->params->get('cart_type', 'cart');
} else {
$cart_type = JRequest::getVar('cart_type', 'cart');
}
}
$image = hikashop_get('helper.image');
$this->assignRef('image', $image);
$module = hikashop_get('helper.module');
$module->initialize($this);
$database = JFactory::getDBO();
$config =& hikashop_config();
$currencyClass = hikashop_get('class.currency');
$class = hikashop_get('class.cart');
$productClass = hikashop_get('class.product');
$main_currency = (int) $config->get('main_currency', 1);
$currency_id = hikashop_getCurrency();
if ($config->get('tax_zone_type', 'shipping') == 'billing') {
$zone_id = hikashop_getZone('billing');
} else {
$zone_id = hikashop_getZone('shipping');
}
$discount_before_tax = (int) $config->get('discount_before_tax', 0);
$cart_id = hikashop_getCID();
if ($cart_id == 0) {
$cart_id = JRequest::getInt('cart_id', '');
}
if (empty($cart_id) || $cart_id == 0) {
$cart_id = $app->getUserState(HIKASHOP_COMPONENT . '.' . $cart_type . '_id', 0, 'int');
if ($cart_id == 0) {
$session = JFactory::getSession();
$session_id = '';
if ($session->getId()) {
$session_id = $session->getId();
}
if (hikashop_loadUser() == null) {
$filter = 'a.session_id = ' . $database->Quote($session_id);
} else {
$userInfo = hikashop_loadUser(true);
$filter = '(a.user_id = ' . (int) $userInfo->user_cms_id . ' OR a.session_id = ' . $database->Quote($session_id) . ')';
}
$query = 'SELECT a.* FROM ' . hikashop_table('cart') . ' AS a WHERE a.cart_type = ' . $database->Quote($cart_type) . ' AND ' . $filter;
$database->setQuery($query);
$userCarts = $database->loadObjectList();
$ok = 0;
$old_modified = 0;
foreach ($userCarts as $userCart) {
if ((int) $userCart->cart_current == 1) {
$cart_id = (int) $userCart->cart_id;
$ok = 1;
} else {
if ($ok == 0) {
if ($old_modified <= $userCart->cart_modified) {
$cart_id = $userCart->cart_id;
$old_modified = $userCart->cart_modified;
}
}
}
}
}
}
$popup = hikashop_get('helper.popup');
$this->assignRef('popup', $popup);
$query = 'SELECT * FROM ' . hikashop_table('cart') . ' AS a WHERE a.cart_id = ' . $cart_id;
$database->setQuery($query);
$cartVal = $database->loadObject();
JRequest::setVar('cart_type', $cartVal->cart_type);
JRequest::setVar('cart_id', $cart_id);
$app->setUserState(HIKASHOP_COMPONENT . '.' . $cartVal->cart_type . '_id', $cart_id, 'int');
$rows = $class->get($cart_id, false, $cartVal->cart_type);
if ($cartVal == null) {
if ($config->get('enable_multicart', 0)) {
global $Itemid;
$url = hikashop_contentLink('cart&task=showcarts&cart_type=' . $cart_type . '&Itemid=' . $Itemid);
$app->redirect($url);
} else {
$cartClass = hikashop_get('class.cart');
$cartVal = $cartClass->initCart();
$cartVal->cart_share = 'no';
}
}
$user = $cartVal->user_id;
$confirmedStatus = $config->get('invoice_order_statuses', 'confirmed,shipped');
if (empty($confirmedStatus)) {
$confirmedStatus = 'confirmed,shipped';
}
//.........这里部分代码省略.........
示例14: rtrim
<span id="hikashop_product_length_main" class="hikashop_product_length_main">
<?php
echo JText::_('PRODUCT_LENGTH') . ': ' . rtrim(rtrim($this->element->product_length, '0'), ',.') . ' ' . JText::_($this->element->product_dimension_unit);
?>
<br />
</span>
<?php
}
if ($this->config->get('dimensions_display', 0) && bccomp($this->element->product_height, 0, 3)) {
?>
<span id="hikashop_product_height_main" class="hikashop_product_height_main">
<?php
echo JText::_('PRODUCT_HEIGHT') . ': ' . rtrim(rtrim($this->element->product_height, '0'), ',.') . ' ' . JText::_($this->element->product_dimension_unit);
?>
<br />
</span>
<?php
}
if ($this->config->get('manufacturer_display', 0) && !empty($this->element->product_manufacturer_id)) {
$categoryClass = hikashop_get('class.category');
$manufacturer = $categoryClass->get($this->element->product_manufacturer_id);
if ($manufacturer->category_published) {
$menuClass = hikashop_get('class.menus');
$Itemid = $menuClass->loadAMenuItemId('manufacturer', 'listing');
if (empty($Itemid)) {
$Itemid = $menuClass->loadAMenuItemId('', '');
}
$categoryClass->addAlias($manufacturer);
echo JText::_('MANUFACTURER') . ': ' . '<a href="' . hikashop_contentLink('category&task=listing&cid=' . $manufacturer->category_id . '&name=' . $manufacturer->alias . '&Itemid=' . $Itemid, $manufacturer) . '">' . $manufacturer->category_name . '</a>';
}
}