Product code and price in same row

  • Posts: 91
  • Thank you received: 3
11 years 6 months ago #142568

I want at my product-listing (many items at one page) to display the product code and the product price in one row.
If possible I want the code on the left and the price on the right (float).
I went looking in Views - Product - listing_img_title and found the following to code blocks.
Combining these two should do the trick. But I haven't got a clue how :dry:
Anyobdy any idea?

<!-- PRODUCT PRICE -->
<?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();
}

?>
<!-- EO PRODUCT PRICE -->

<!-- PRODUCT CODE -->
  <span class='hikashop_product_code_list'>
    <?php if ($this->config->get('show_code')) { ?>
      <?php if($this->params->get('link_to_product_page',1)){ ?>
        <a href="<?php echo $link;?>">
      <?php }
      echo $this->row->product_code;
      if($this->params->get('link_to_product_page',1)){ ?>
        </a>
      <?php } ?>
    <?php } ?>
  </span>
<!-- EO PRODUCT CODE -->

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

  • Posts: 2334
  • Thank you received: 403
11 years 6 months ago #142619

Hi there,

First thing is that you have to put these two block next to each other (like in the code you posted).
Then you can actually put them next to each other with some css. Edit the front end css code (in System>Configuration>Display) and add this:

.hikashop_product_price_full{
  display:inline;
}
.hikashop_product_code_list{
    display:inline;
}

It will prevent the span to be display with the block attribute (meaning on the top of each other).
Do not hesitate to take a look at our documentation for that kind of issue: www.hikashop.com/support/documentation/i...ize-the-display.html

The following user(s) said Thank You: miracle

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

Time to create page: 0.056 seconds
Powered by Kunena Forum