- Posts: 196
- Thank you received: 15
change order (width, height ...)
- StudioPrzyLesie
-
Topic Author
- Offline
Less
More
11 years 2 months ago #209831
by StudioPrzyLesie
change order (width, height ...) was created by StudioPrzyLesie
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
How to change the existing order of fields in the data sheet.
It is the weight, width, length, height, manufacturer
And it should be: the producer, width, length, height, weight
Then how to change the information block
Is: a block with dimensions, then a block of the user fields
And it should be: a block of fields username, then the block with dimensions
-- Joomla version -- : 3.4.3
How to change the existing order of fields in the data sheet.
It is the weight, width, length, height, manufacturer
And it should be: the producer, width, length, height, weight
Then how to change the information block
Is: a block with dimensions, then a block of the user fields
And it should be: a block of fields username, then the block with dimensions
Please Log in or Create an account to join the conversation.
11 years 2 months ago #209839
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic change order (width, height ...)
Hi,
Please see that documentation:
www.hikashop.com/support/support/documen...-display.html#layout
You will find explanations on view override, HikaShop customization and also a picture explaining how the product page is split in different views (so you will know which view you have to edit to perform your customization).
Regards,
Please see that documentation:
www.hikashop.com/support/support/documen...-display.html#layout
You will find explanations on view override, HikaShop customization and also a picture explaining how the product page is split in different views (so you will know which view you have to edit to perform your customization).
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- StudioPrzyLesie
-
Topic Author
- Offline
Less
More
- Posts: 196
- Thank you received: 15
11 years 2 months ago #209928
by StudioPrzyLesie
Replied by StudioPrzyLesie on topic change order (width, height ...)
Thank you for your answer,
I read this guide, there is no solution to the problem, which I have tried to describe
I read this guide, there is no solution to the problem, which I have tried to describe
Please Log in or Create an account to join the conversation.
11 years 2 months ago #209945
by Xavier
Replied by Xavier on topic change order (width, height ...)
Hi,
You have to edit the view "product / show_block_dimensions" to change the order of the dimensions and the manufacturer.
Then to display the custom fields before the dimensions, in the view "product / show_default" move the block
After:
You have to edit the view "product / show_block_dimensions" to change the order of the dimensions and the manufacturer.
Then to display the custom fields before the dimensions, in the view "product / show_default" move the block
Code:
<?php
//LAYOUT show_block_dimensions
$this->setLayout('show_block_dimensions');
echo $this->loadTemplate();
?><br /
Code:
if (!$this->params->get('catalogue') && ($this->config->get('display_add_to_cart_for_free_products') || ($this->config->get('display_add_to_wishlist_for_free_products', 1) && hikashop_level(1) && $this->params->get('add_to_wishlist') && $config->get('enable_wishlist', 1)) || !empty($this->element->prices))) {
if (!empty ($this->itemFields)) {
$form = ',\'hikashop_product_form\'';
if ($this->config->get('redirect_url_after_add_cart', 'stay_if_cart') == 'ask_user') {
?>
<input type="hidden" name="popup" value="1"/>
<?php
}
//LAYOUT show_block_custom_item
$this->setLayout('show_block_custom_item');
echo $this->loadTemplate();
}
}
Please Log in or Create an account to join the conversation.
- StudioPrzyLesie
-
Topic Author
- Offline
Less
More
- Posts: 196
- Thank you received: 15
11 years 2 months ago #209990
by StudioPrzyLesie
Replied by StudioPrzyLesie on topic change order (width, height ...)
My file show_block_dimensions looks like this:
I guess I have no knowledge, any change causes an error on the page.
My file "show" looks like this:
Changes in show_default did not bring any effect
Code:
<?php
/**
* @package HikaShop for Joomla!
* @version 2.3.0
* @author hikashop.com
* @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<dl class="hikashop_product_dimensions">
<?php
if(isset($this->element->main)){
if($this->element->product_weight==0 && isset($this->element->main->product_weight)){
$this->element->product_weight = $this->element->main->product_weight;
}
if($this->element->product_width==0 && isset($this->element->main->product_width)){
$this->element->product_width = $this->element->main->product_width;
}
if($this->element->product_height==0 && isset($this->element->main->product_height)){
$this->element->product_height = $this->element->main->product_height;
}
if($this->element->product_length==0 && isset($this->element->main->product_length)){
$this->element->product_length = $this->element->main->product_length;
}
}
if ($this->config->get('weight_display', 0)) {
if(isset($this->element->product_weight) && bccomp($this->element->product_weight,0,3)){ ?>
<dt><?php echo JText::_('PRODUCT_WEIGHT'); ?>: </dt>
<dd><?php echo rtrim(rtrim($this->element->product_weight,'0'),',.').' '.JText::_($this->element->product_weight_unit); ?></dd>
<?php
}
}
if ($this->config->get('dimensions_display', 0) && bccomp($this->element->product_width, 0, 3)) {
?>
<dt><?php echo JText::_('PRODUCT_WIDTH'); ?>: </dt>
<dd><?php echo rtrim(rtrim($this->element->product_width,'0'),',.').' '.JText::_($this->element->product_dimension_unit); ?></dd>
<?php
}
if ($this->config->get('dimensions_display', 0) && bccomp($this->element->product_length, 0, 3)) {
?>
<dt><?php echo JText::_('PRODUCT_LENGTH'); ?>: </dt>
<dd><?php echo rtrim(rtrim($this->element->product_length,'0'),',.').' '.JText::_($this->element->product_dimension_unit); ?></dd>
<?php
}
if ($this->config->get('dimensions_display', 0) && bccomp($this->element->product_height, 0, 3)) {
?>
<dt><?php echo JText::_('PRODUCT_HEIGHT'); ?>: </dt>
<dd><?php echo rtrim(rtrim($this->element->product_height,'0'),',.').' '.JText::_($this->element->product_dimension_unit); ?></dd>
<?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);
global $Itemid;
$categoryClass = hikashop_get('class.category');
$categoryClass->addAlias($manufacturer);
echo '<dt>' . JText::_('MANUFACTURER').': </dt>'.'<dd><a href="'.hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid).'">'.$manufacturer->category_name.'</a></dd>';
}
?>
</dl>
My file "show" looks like this:
Code:
<?php
/**
* @package HikaShop for Joomla!
* @version 2.3.0
* @author hikashop.com
* @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$canonical=false;
if(!empty($this->element->main->product_canonical)){
$canonical = $this->element->main->product_canonical;
}elseif(!empty($this->element->product_canonical)){
$canonical = $this->element->product_canonical;
}
if($canonical){
$doc = JFactory::getDocument();
$doc->addCustomTag( '<link rel="canonical" href="'.hikashop_cleanURL($canonical).'" />' );
}
?>
<div id="hikashop_product_<?php echo preg_replace('#[^a-z0-9]#i','_',@$this->element->product_code); ?>_page" class="hikashop_product_page">
<?php
$app = JFactory::getApplication();
if (empty ($this->element)) {
$app->enqueueMessage(JText::_('PRODUCT_NOT_FOUND'));
} else {
if(!empty($this->links->previous) || !empty($this->links->next)) {
echo '<div class="hikashop_product_nav">';
}
if(!empty($this->links->previous)) {
echo "<a title='".JText :: _('PREVIOUS_PRODUCT')."' href='".$this->links->previous."' class='hikashop_previous_product'>← ".JText :: _('PREVIOUS_PRODUCT')."</a>";
}
if(!empty($this->links->next)) {
echo "<a title='".JText :: _('NEXT_PRODUCT')."' href='".$this->links->next."' class='hikashop_next_product'>".JText :: _('NEXT_PRODUCT')." →</a>";
}
if(!empty($this->links->previous) || !empty($this->links->next)) {
echo '</div>';
}
?>
<form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form" enctype="multipart/form-data" class="productDetails">
<?php
$this->variant_name ='';
if(!empty($this->element->variants)&&$this->config->get('variant_increase_perf',1)&&!empty($this->element->main)){
foreach (get_object_vars($this->element->main) as $name=>$value) {
if(!is_array($name)&&!is_object($name)){
if(empty($this->element->$name)){
if($name=='product_quantity' && $this->element->$name==0){
continue;
}
$this->element->$name=$this->element->main->$name;
continue;
}
}
if($this->params->get('characteristic_display')=='list' && !empty ($this->element->characteristics) && !empty($this->element->main->characteristics)){
$this->element->$name = $this->element->main->$name;
}
}
}
// we use only the tabular view
//$this->setLayout($this->productlayout);
$this->setLayout('show_tabular');
echo $this->loadTemplate();
if($this->params->get('characteristic_display')=='list'){
$this->setLayout('show_block_characteristic');
echo $this->loadTemplate();
}
?>
<?php $contact = $this->config->get('product_contact',0); ?>
<?php
if(empty($this->element->variants) || $this->params->get('characteristic_display')=='list'){
if(hikashop_level(1) && !empty($this->element->options)){
$priceUsed = 0;
if(!empty($this->row->prices)){
foreach($this->row->prices as $price){
if(isset($price->price_min_quantity) && empty($this->cart_product_price)){
if($price->price_min_quantity<=1){
if($this->params->get('price_with_tax')){
$priceUsed = $price->price_value_with_tax;
} else {
$priceUsed = $price->price_value;
}
}
}
}
}
echo '
<input type="hidden" name="hikashop_price_product" value="'.$this->row->product_id.'" />
<input type="hidden" id="hikashop_price_product_'.$this->row->product_id.'" value="'.$priceUsed.'" />
<input type="hidden" id="hikashop_price_product_with_options_'.$this->row->product_id.'" value="'.$priceUsed.'" />';
}
} else {
$productClass = hikashop_get('class.product');
$productClass->generateVariantData($this->element);
$main_images =& $this->element->main->images;
foreach ($this->element->variants as $variant) {
$this->row = & $variant;
$variant_name = array ();
if (!empty ($variant->characteristics)) {
foreach ($variant->characteristics as $k => $ch) {
$variant_name[] = $ch->characteristic_id;
}
}
$this->element->images =& $main_images;
if (!empty ($variant->images)) {
$this->element->images =& $variant->images;
}
$variant_name = implode('_', $variant_name);
$this->variant_name = '_'.$variant_name;
$this->setLayout('show_block_img');
echo $this->loadTemplate();
if(!empty($variant->product_name)){ ?>
<div id="hikashop_product_name_<?php echo $variant_name;?>" style="display:none;">
<?php echo $variant->product_name;?>
</div>
<?php }
if ($this->config->get('show_code') &&!empty($variant->product_code)){ ?>
<div id="hikashop_product_code_<?php echo $variant_name;?>" style="display:none;">
<?php echo $variant->product_code;?>
</div>
<?php } ?>
<div id="hikashop_product_price_<?php echo $variant_name;?>" style="display:none;">
<?php
if($this->params->get('show_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_price',$config->get('show_price'));
}
if ($this->params->get('show_price')) {
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
?>
</div>
<?php
if(hikashop_level(1) && !empty($this->element->options)){
$priceUsed = 0;
if(!empty($this->row->prices)){
foreach($this->row->prices as $price){
if(isset($price->price_min_quantity) && empty($this->cart_product_price)){
if($price->price_min_quantity<=1){
if($this->params->get('price_with_tax')){
$priceUsed = $price->price_value_with_tax;
}else{
$priceUsed = $price->price_value;
}
}
}
}
}
echo '
<input type="hidden" name="hikashop_price_product" value="'.$this->row->product_id.'" />
<input type="hidden" id="hikashop_price_product_'.$this->row->product_id.'" value="'.$priceUsed.'" />
<input type="hidden" id="hikashop_price_product_with_options_'.$this->row->product_id.'" value="'.$priceUsed.'" />';
}
?>
<div id="hikashop_product_quantity_<?php echo $variant_name;?>" style="display:none;">
<?php
$this->row = & $variant;
if(empty($this->formName)) {
$this->formName = ',0';
if (!$this->config->get('ajax_add_to_cart', 1)) {
$this->formName = ',\'hikashop_product_form\'';
}
}
$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $this->formName . ',\'cart\'); } else { return false; }';
$this->setLayout('quantity');
echo $this->loadTemplate();
?>
</div>
<div id="hikashop_product_contact_<?php echo $variant_name;?>" style="display:none;">
<?php
if (hikashop_level(1) && ($contact == 2 || ($contact == 1 && !empty ($this->element->main->product_contact)))) {
$params = @$this->params;
global $Itemid;
$url_itemid='';
if(!empty($Itemid)){
$url_itemid='&Itemid='.$Itemid;
}
echo $this->cart->displayButton(
JText::_('CONTACT_US_FOR_INFO'),
'contact_us',
$params,
''.hikashop_completeLink('product&task=contact&cid=' . $variant->product_id.$url_itemid),
'window.location=\'' . hikashop_completeLink('product&task=contact&cid=' . $variant->product_id.$url_itemid) . '\';return false;'
);
}
?>
</div>
<?php if(!empty($variant->product_description)){ ?>
<div id="hikashop_product_description_<?php echo $variant_name;?>" style="display:none;">
<?php echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$variant->product_description));?>
</div>
<?php
}
if ($this->config->get('weight_display', 0)) {
if(!empty($variant->product_weight) && bccomp($variant->product_weight,0,3)){ ?>
<div id="hikashop_product_weight_<?php echo $variant_name;?>" style="display:none;">
<?php echo JText::_('PRODUCT_WEIGHT').': '.rtrim(rtrim($variant->product_weight,'0'),',.').' '.JText::_($variant->product_weight_unit); ?><br />
</div>
<?php
}
}
if ($this->config->get('dimensions_display', 0)) {
if (!empty ($variant->product_width) && bccomp($variant->product_width, 0, 3)) {
?>
<div id="hikashop_product_width_<?php echo $variant_name;?>" style="display:none;">
<?php echo JText::_('PRODUCT_WIDTH').': '.rtrim(rtrim($variant->product_width,'0'),',.').' '.JText::_($variant->product_dimension_unit); ?><br />
</div>
<?php } ?>
<?php if(!empty($variant->product_length) && bccomp($variant->product_length,0,3)){ ?>
<div id="hikashop_product_length_<?php echo $variant_name;?>" style="display:none;">
<?php echo JText::_('PRODUCT_LENGTH').': '.rtrim(rtrim($variant->product_length,'0'),',.').' '.JText::_($variant->product_dimension_unit); ?><br />
</div>
<?php } ?>
<?php if(!empty($variant->product_height) && bccomp($variant->product_height,0,3)){ ?>
<div id="hikashop_product_height_<?php echo $variant_name;?>" style="display:none;">
<?php echo JText::_('PRODUCT_HEIGHT').': '.rtrim(rtrim($variant->product_height,'0'),',.').' '.JText::_($variant->product_dimension_unit); ?><br />
</div>
<?php
}
}
if(!empty($variant->product_url)){ ?>
<span id="hikashop_product_url_<?php echo $variant_name;?>" style="display:none;">
<?php
if (!empty ($variant->product_url)) {
echo JText :: sprintf('MANUFACTURER_URL', '<a href="' . $variant->product_url . '" target="_blank">' . $variant->product_url . '</a>');
} ?>
</span>
<?php } ?>
<span id="hikashop_product_id_<?php echo $variant_name;?>">
<input type="hidden" name="product_id" value="<?php echo $variant->product_id; ?>" />
</span>
<?php if(!empty($this->fields)){?>
<div id="hikashop_product_custom_info_<?php echo $variant_name;?>" style="display:none;">
<h4><?php echo JText::_('SPECIFICATIONS');?></h4>
<table width="100%">
<?php
$this->fieldsClass->prefix = '';
foreach ($this->fields as $fieldName => $oneExtraField) {
if(empty($variant->$fieldName) && !empty($this->element->main->$fieldName)){
$variant->$fieldName = $this->element->main->$fieldName;
}
if(!empty($variant->$fieldName)) $variant->$fieldName = trim($variant->$fieldName);
if (!empty ($variant->$fieldName)) {
?>
<tr class="hikashop_product_custom_<?php echo $oneExtraField->field_namekey;?>_line">
<td class="key">
<span id="hikashop_product_custom_name_<?php echo $oneExtraField->field_id;?>_<?php echo $variant_name;?>" class="hikashop_product_custom_name">
<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
</span>
</td>
<td>
<span id="hikashop_product_custom_value_<?php echo $oneExtraField->field_id;?>_<?php echo $variant_name;?>" class="hikashop_product_custom_value">
<?php echo $this->fieldsClass->show($oneExtraField,$variant->$fieldName); ?>
</span>
</td>
</tr>
<?php
}
}
?>
</table>
</div>
<?php
}
if (!empty ($variant->files)) {
$skip = true;
foreach ($variant->files as $file) {
if ($file->file_free_download)
$skip = false;
}
if (!$skip) {
?>
<div id="hikashop_product_files_<?php echo $variant_name;?>" style="display:none;">
<fieldset class="hikashop_product_files_fieldset">
<?php
$html = array ();
echo '<legend>' . JText :: _('DOWNLOADS') . '</legend>';
foreach ($variant->files as $file) {
if (empty ($file->file_name)) {
$file->file_name = $file->file_path;
}
$fileHtml = '';
if (!empty ($file->file_free_download)) {
$fileHtml = '<a class="hikashop_product_file_link" href="' . hikashop_completeLink('product&task=download&file_id=' . $file->file_id) . '">' . $file->file_name . '</a><br/>';
}
$html[] = $fileHtml;
}
echo implode('<br/>', $html);
?>
</fieldset>
</div>
<?php
}
}
}
}
$this->params->set('show_price_weight', 0);
?>
<div class="hikashop_submodules" id="hikashop_submodules" style="clear:both">
<?php
if (!empty ($this->modules) && is_array($this->modules)) {
jimport('joomla.application.module.helper');
foreach ($this->modules as $module) {
echo JModuleHelper :: renderModule($module);
}
}
?>
</div>
<div class="hikashop_external_comments" id="hikashop_external_comments" style="clear:both">
<?php
$config = & hikashop_config();
if ($config->get('comments_feature') == 'jcomments') {
$comments = HIKASHOP_ROOT . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once ($comments);
if (hikashop_getCID('product_id')!=$this->element->product_id && isset ($this->element->main->product_name)){
$product_id = $this->element->main->product_id;
$product_name = $this->element->main->product_name;
}else{
$product_id = $this->element->product_id;
$product_name = $this->element->product_name;
}
echo JComments::showComments($product_id, 'com_hikashop', $product_name);
}
}
elseif ($config->get('comments_feature') == 'jomcomment') {
$comments = HIKASHOP_ROOT . 'plugins' . DS . 'content' . DS . 'jom_comment_bot.php';
if (file_exists($comments)) {
require_once ($comments);
if (hikashop_getCID('product_id')!=$this->element->product_id && isset ($this->element->main->product_name))
$product_id = $this->element->main->product_id;
else
$product_id = $this->element->product_id;
echo jomcomment($product_id, 'com_hikashop');
}
}
?>
</div><?php
}
?>
</div>
Please Log in or Create an account to join the conversation.
11 years 2 months ago #209994
by Xavier
Replied by Xavier on topic change order (width, height ...)
Hi,
In the view "product / show_block_dimensions" you have to move the code:
At the top of the file right after the php opening tag.
In the view "product / show_block_dimensions" you have to move the code:
Code:
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 JText::_('MANUFACTURER').': '.'<a href="'.hikashop_contentLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid,$manufacturer).'">'.$manufacturer->category_name.'</a>';
}
Please Log in or Create an account to join the conversation.
- StudioPrzyLesie
-
Topic Author
- Offline
Less
More
- Posts: 196
- Thank you received: 15
11 years 2 months ago #210131
by StudioPrzyLesie
Replied by StudioPrzyLesie on topic change order (width, height ...)
Thanks - order the manufacturer switched 
How to move blocks of information about dimensions and block the user from fields?
How to move blocks of information about dimensions and block the user from fields?
Please Log in or Create an account to join the conversation.
11 years 2 months ago #210134
by Xavier
Replied by Xavier on topic change order (width, height ...)
Hi,
Please illustrate what you need with a screenshot, because a solution was given in one of my previous posts but it seems to not be what you are looking for
Please illustrate what you need with a screenshot, because a solution was given in one of my previous posts but it seems to not be what you are looking for
Please Log in or Create an account to join the conversation.
- StudioPrzyLesie
-
Topic Author
- Offline
Less
More
- Posts: 196
- Thank you received: 15
11 years 2 months ago #210245
by StudioPrzyLesie
Replied by StudioPrzyLesie on topic change order (width, height ...)
Please Log in or Create an account to join the conversation.
11 years 2 months ago #210250
by nicolas
Replied by nicolas on topic change order (width, height ...)
Hi,
You 're apparently using the "tabular" layout of the product page and thus, instead of editing the file "show_default", you need to edit the file "show_tabular" and do the same changes there.
Then it will work.
You 're apparently using the "tabular" layout of the product page and thus, instead of editing the file "show_default", you need to edit the file "show_tabular" and do the same changes there.
Then it will work.
Please Log in or Create an account to join the conversation.
- StudioPrzyLesie
-
Topic Author
- Offline
Less
More
- Posts: 196
- Thank you received: 15
11 years 2 months ago #210407
by StudioPrzyLesie
Replied by StudioPrzyLesie on topic change order (width, height ...)
It works - great!
Thank you for the great support
That's what I like - great support from HIKASHOP!
On JoomlaDay Poland in September we drink beer
Thank you for the great support
That's what I like - great support from HIKASHOP!
On JoomlaDay Poland in September we drink beer
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
Time to create page: 0.234 seconds