Product characteristics in a table

  • Posts: 42
  • Thank you received: 0
12 years 11 months ago #40449

Hello. The product characteristics on my page are shown as in image 1. I want to make them show with seperating lines as in image 2. How can I achieve that?
Thanks

Attachments:

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 11 months ago #40642

Hi,

You need to edit the file different show* files of the view product for your template via the menu Display->Views and change the HTML code and move the different blocks of code around in order to make it look like that.

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

  • Posts: 42
  • Thank you received: 0
12 years 10 months ago #40666

Thanks Nicolas. Can you tell me how to just seperate the characteristics with a line?

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #40889

For that, you can just add the CSS below in the front end CSS file of HikaShop via the Display tab of the configuration:

.hikashop_product_characteristics_table tr{
border-bottom: 1px black solid;
display: block;
}

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

  • Posts: 42
  • Thank you received: 0
12 years 10 months ago #41806

Nicolas thank you. I managed to make my product page look like the attachment. But I couldn't solve my other issue.. Help please!

What I'm trying to do is adding some custom information for each product, from a table in the editor of product page (as shown in attachment), that will automatically be inserted on the top of the product's hikashop_product_characteristics_table. Is there a way to do this?? I only managed to add the class to the table from the html view of the editor...

And also how can I make the price on each product page appear in the last row of that characteristics table?

Thank you in advance!

Attachments:

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #41991

You can move the description of the product above the characteristic table by edit the file "show_default" of the view "product" via the menu Display->Views.
However, if you only want to have a piece of the description there and the rest at the bottom, that's not possible.
The easiest is to create a new custom field of the table "product" via the menu Display->Custom fields (commercial editions) and displayed on the front end. That will allow you to enter additional information about the product that will go automatically where you need it.

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

  • Posts: 42
  • Thank you received: 0
12 years 10 months ago #42039

Aren't custom fields going to show the same information for all products in a specific category? What I want to do is to display this additional short information that will be different for every product, along with the characteristics in a table. Isn't that feasible?

I thought of creating them as characteristics with one variant and when this will be the case, no dropdown will be shown..

Any suggestions?

Thanks!

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #42202

No. The system will display there what you enter in the custom field in the back end.
So that's what you want to do. And so yes, it is feasible.

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

  • Posts: 42
  • Thank you received: 0
12 years 10 months ago #42257

Thank you Nicolas!

I have created new custom fields of the table "product" and I can add the information I need for each product from the back-end. I´ve tried that before but obviously I was doing sth wrong..

What I´ve managed to do now is shown in the attachment. Can you please help me now on how to make these custom fields appear in the same table on top of the characteristics? And if it´s possible to show the price in the last row of this table instead of standing alone above it?

Thanks a lot!

Attachments:

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #42409

You need to edit the file "show_default" via the menu Display->Views.
There, move the code

	if(!empty($this->fields)){
		//LAYOUT show_block_custom_main
		$this->setLayout('show_block_custom_main');
		echo $this->loadTemplate();
	}
before the code
$this->setLayout('show_block_charasteristic');
	echo $this->loadTemplate();

For the price, you will have to remove the code
if ($this->params->get('show_price')) {
			$this->row = & $this->element;
			$this->setLayout('listing_price');
			echo $this->loadTemplate();
		}
from that same file and instead add it in the file "show_block_custom_item" by adding it around HTML tags <tr><td rowspan="2"> and </td></tr> just before the tag </table>

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

  • Posts: 42
  • Thank you received: 0
12 years 10 months ago #42459

Thank you master! :) That worked perfect ! I had to create a custom field of the table "item" though to make the price visible. Maybe I'll use the code in the respective position in the file show_block_charasteristic.

One more question.. How can I use different class for only that price? Because if I edit the class of hikashop_product_price, the style of the price in the cart also changes..

Thank you again Nicolas.

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

  • Posts: 42
  • Thank you received: 0
12 years 10 months ago #42594

Nicolas I noticed that if I have variants with different prices, the price that I added in show_block_custom_item does not update.. Should I add sth else to the code?
Thanks

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #42730

Ah yes, for the variants, you will have to also add the div which was around the PHP code you copied from the show_default file.

For the price, you just need to use some different CSS.
Instead of :
.hikashop_product_price{ color:blue;}

you can do:
.hikashop_product_page .hikashop_product_price{ color:blue;}

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

  • Posts: 42
  • Thank you received: 0
12 years 10 months ago #43537

Nicolas could you please guide me a bit more for the price update in show_block_custom_item? I've tried everything in my knowledge with no success.. I tried adding the code

</div>
  <span id="hikashop_product_price_main" class="hikashop_product_price_main">
    <?php  
    if ($this->params->get('show_price')) {
      $this->row = & $this->element;
      $this->setLayout('listing_price');
      echo $this->loadTemplate();  
    }
just before the tag </table> but I'm doing something wrong obviously!
Help please!
Thanks..

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #43732

It should be like that:

<tr><td rowspan="2"> <span id="hikashop_product_price_main" class="hikashop_product_price_main"><?php if ($this->params->get('show_price')) {
			$this->row = & $this->element;
			$this->setLayout('listing_price');
			echo $this->loadTemplate();
		} ?></span></td></tr>

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

  • Posts: 42
  • Thank you received: 0
12 years 10 months ago #43852

Unfortunately that didn't work Nicolas. I can make the price display where I want but it does not respond to the variant change.. Please find below the show_block_custom_item file if this helps.

<?php
/**
 * @package    HikaShop for Joomla!
 * @version    1.5.6
 * @author    hikashop.com
 * @copyright  (C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
 * @license    GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<div id="hikashop_product_custom_item_info" class="hikashop_product_custom_item_info">
  <table width="100%">
  <?php
  foreach ($this->itemFields as $fieldName => $oneExtraField) {
    $itemData = JRequest :: getString('item_data_' . $fieldName, $this->element-> $fieldName);
    ?>
    <tr id="hikashop_item_<?php echo $oneExtraField->field_namekey; ?>" class="hikashop_item_<?php echo $oneExtraField->field_namekey;?>_line">
      <td class="key">
        <span id="hikashop_product_custom_item_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_item_name">
          <?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
        </span>
      </td>
      <td>
        <span id="hikashop_product_custom_item_value_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_item_value">
          <?php $onWhat='onchange'; if($oneExtraField->field_type=='radio') $onWhat='onclick'; ?>
          <?php echo $this->fieldsClass->display($oneExtraField,$itemData,'data[item]['.$oneExtraField->field_namekey.']',false,' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'item\',0);"'); ?>
        </span>         
      </td>
      </tr>
   <?php   
   }  
  ?>     
  </table>
 </div>
Thank you.

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #44039

I don't see your code modification in that file.

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

  • Posts: 42
  • Thank you received: 0
12 years 10 months ago #44069

I just posted my show_block_custom_item file so that you could tell me where to add the code.
The modified file is as below.

<?php
/**
 * @package    HikaShop for Joomla!
 * @version    1.5.6
 * @author    hikashop.com
 * @copyright  (C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
 * @license    GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<div id="hikashop_product_custom_item_info" class="hikashop_product_custom_item_info">
  <table width="100%">
  <?php
  foreach ($this->itemFields as $fieldName => $oneExtraField) {
    $itemData = JRequest :: getString('item_data_' . $fieldName, $this->element-> $fieldName);
    ?>
    <tr id="hikashop_item_<?php echo $oneExtraField->field_namekey; ?>" class="hikashop_item_<?php echo $oneExtraField->field_namekey;?>_line">
      <td class="key">
        <span id="hikashop_product_custom_item_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_item_name">
          <?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
        </span>
      </td>
      <td>
        <span id="hikashop_product_custom_item_value_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_item_value">
          <?php $onWhat='onchange'; if($oneExtraField->field_type=='radio') $onWhat='onclick'; ?>
          <?php echo $this->fieldsClass->display($oneExtraField,$itemData,'data[item]['.$oneExtraField->field_namekey.']',false,' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'item\',0);"'); ?>
        </span>         
      </td>
      </tr>

 <tr><td rowspan="2"> <span id="hikashop_product_price_main" class="hikashop_product_price_main"><?php if ($this->params->get('show_price')) {
      $this->row = & $this->element;
      $this->setLayout('listing_price');
      echo $this->loadTemplate();
    } ?></span></td></tr>

   <?php   
   }  
  ?>     
  </table>
 </div>
Looking forward for your reply!
Thanks

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #44346

That modification is fine. If you don't see any difference, please make sure that you're modifying the view file of the correct front end template.

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

  • Posts: 42
  • Thank you received: 0
12 years 10 months ago #44383

Nicolas I can view the price at the correct position, so it`s in the correct file for sure..
The problem is that when selecting another variant, all the information for that variant change normally but not the price.
If you could help me find a solution on this it would be much appreciated! So that you will not have to answer to another post on this subject as it`s gone too far.
I am also messaging you the link to view the issue.
I look forward for your reply to solve this!
Thanks a lot.

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

Time to create page: 0.086 seconds
Powered by Kunena Forum