specifications on listing product

  • Posts: 32
  • Thank you received: 2
11 years 8 months ago #92836

Hi,
I would like to show specifications on listing product.

I inserted on my listing_div

$fieldsClass=hikashop_get('class.field');
	// $this->row =& $row; How I have to change this ?????
        $this->setLayout('show_block_custom_main');
        echo $this->loadTemplate();

I suppose I need change $this->row =& $row;
But I don't know how.

Is it possible ?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 8 months ago #92917

Hi,

You can edit the view "product / listing_img_title" which is the default layout for the listing_div.
And in this listing the specifications are in the variable: "$this->row"
So you can use "echo $this->row->product_weight;" to display the product weight, etc.

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

  • Posts: 32
  • Thank you received: 2
11 years 8 months ago #93051

the problem is about custom entries,
I don't know the name of custom field for each product,
so I would like to use 'show_block_custom_main' template.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 8 months ago #93101

The view "show_block_custom_main" require an array to display the custom fields.
One row of this array is, for example:

  'customtext_295_7_25_19' => 
    object(stdClass)[560]
      public 'field_id' => string '28' (length=2)
      public 'field_table' => string 'product' (length=7)
      public 'field_realname' => string '' (length=0)
      public 'field_namekey' => string 'customtext_295_7_25_19' (length=22)
      public 'field_type' => string 'customtext' (length=10)
      public 'field_value' => string '' (length=0)
      public 'field_published' => string '1' (length=1)
      public 'field_ordering' => string '2' (length=1)
      public 'field_options' => 
        array
          'errormessage' => string '' (length=0)
          'cols' => string '' (length=0)
          'filtering' => string '1' (length=1)
          'maxlength' => string '0' (length=1)
          'rows' => string '' (length=0)
          'zone_type' => string 'country' (length=7)
          'size' => string '' (length=0)
          'format' => string '' (length=0)
          'allow' => string '' (length=0)
          'readonly' => string '0' (length=1)
          'customtext' => string '' (length=0)
      public 'field_core' => string '0' (length=1)
      public 'field_required' => string '0' (length=1)
      public 'field_backend' => string '1' (length=1)
      public 'field_frontcomp' => string '1' (length=1)
      public 'field_default' => string '' (length=0)
      public 'field_backend_listing' => string '0' (length=1)
      public 'field_access' => string 'all' (length=3)
      public 'field_categories' => string 'all' (length=3)
      public 'field_with_sub_categories' => string '0' (length=1)
 

So if you want to use this layout in the listing you have to prepare the object $fields. And to prepare it you have to edit the file "components/com_hikashop/views/product/view.html.php" function "listing" it require a good php skill, and good knowledge of HikaShop.

The following user(s) said Thank You: nibel59

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

Time to create page: 0.072 seconds
Powered by Kunena Forum