Skip to main content

Change layout to table

More
11 years 10 months ago #181880 by verzevoul
-- HikaShop version -- : 2.3.3
-- Joomla version -- : 2.5.27
-- PHP version -- : 5.4

Hi ! Is it possible to add a custom field is this layout as in screenshots?

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

More
11 years 10 months ago #181905 by Jerome
Replied by Jerome on topic Change layout to table
Hi,

Yes it is possible.
You have to create an override of the product listing you're currently using and display the custom fields you want to display.
In the product listing, the product object will give you all product data, custom field including.

This documentation will help you for the basic steps of layout customization:
www.hikashop.com/support/support/documen...ize-the-display.html

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

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

More
11 years 10 months ago #182070 by verzevoul
Replied by verzevoul on topic Change layout to table
Can you tell me which template to edit?
And the code to show the description trimmed for greek language (without ?? if the word is cutted) .
I managed to do it before for a custom field, but I never did this for this layout (as in prntscr) and for a part of my description

Thanks!

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

More
11 years 10 months ago #182079 by Xavier
Replied by Xavier on topic Change layout to table
Hi,

You have to edit the view "product / listing_table" of your template.
To show trimmed description, you can use the code :
Code:
echo mb_substr($this->row->product_description),0,300);
To display the custom field value the code to use is:
Code:
echo $this->row->CUSTOMFIELD_NAME;

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

More
11 years 10 months ago #182233 by verzevoul
Replied by verzevoul on topic Change layout to table
It doesn t work for me.
I tried
<th class="hikashop_product_name title" align="center">
<?php echo JText::_( 'PRODUCT' );?>
<span class="hikashop_product_desc-cris">
<?php echo $this->row->short_desc_cris; ?> </span>
</th>


but I get nothing.
I tested its the right template. I wrote aaaa and I saw it.

Part of the message is hidden for the guests. Please log in or register to see it.

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

More
11 years 10 months ago #182238 by Xavier
Replied by Xavier on topic Change layout to table
Hi,

Are you sure that you have set a value in the custom field on the product edition page ?
Is the custom field a custom product field ?

Please set the Joomla error reporting level to "maximum" in order to see if the value is found or not.

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

More
11 years 9 months ago #182446 by verzevoul
Replied by verzevoul on topic Change layout to table
I get this


Notice: Undefined property: ProductViewProduct::$row in /home/mpelis/public_html/templates/1b/html/com_hikashop/product/listing_table.php on line 43

Notice: Trying to get property of non-object in /home/mpelis/public_html/templates/1b/html/com_hikashop/product/listing_table.php on line 43

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

More
11 years 9 months ago #182495 by Jerome
Replied by Jerome on topic Change layout to table
Hi,

Depending where you place your code in the "listing_table" view "$this->row" might not be defined.
The code you pasted should be placed in the table header ; but you don't want to display the content of the line in the table header, you want to display it in the table body.

Header (where you do not have access to the products)
Code:
<th class="hikashop_product_name title" align="center"> <?php echo JText::_( 'PRODUCT' );?> </th>

Body (lines which are duplicated for each displayed product)
Code:
foreach($this->rows as $row){ $this->row =& $row; /* content of the rows */
Where you find the display of the content, like the product name:
Code:
<td class="hikashop_product_name_row"> <span class="hikashop_product_name"> <?php if($this->params->get('link_to_product_page',1)){ ?> <a href="<?php echo $link;?>"> <?php } echo $this->row->product_name; if($this->params->get('link_to_product_page',1)){ ?> </a> <?php } ?> </span> <?php if(!empty($this->row->extraData->afterProductName)) { echo implode("\r\n",$this->row->extraData->afterProductName); } ?> </td>

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: verzevoul

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

Time to create page: 0.210 seconds
Powered by Kunena Forum