Change in price display in Product Explorer

  • Posts: 130
  • Thank you received: 1
11 years 11 months ago #77871

Hi,

Is there a way to display price with tax in product explorer backend? Currently price w/o tax is displayed which is clunky for our need and my stuff is complaining a lot about it.

Thanks,

Karol

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

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #77934

Hi,

You can override the view "product listing" for the HikaShop backend.
The view does not have all prices but, if you have just one tax, it could be simple to make this modification.

In the "backend / product listing" view, you would find this part of code.

<?php echo $this->currencyHelper->displayPrices(@$row->prices); ?>
So, you can add a price with some fixed tax (in my example 5.5%).
<?php echo $this->currencyHelper->displayPrices(@$row->prices) . '<br/>' . $this->currencyHelper->displayPrices(@$row->prices * 1.055); ?>

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 130
  • Thank you received: 1
11 years 11 months ago #78022

Jerome wrote: Hi,

You can override the view "product listing" for the HikaShop backend.
The view does not have all prices but, if you have just one tax, it could be simple to make this modification.

In the "backend / product listing" view, you would find this part of code.

<?php echo $this->currencyHelper->displayPrices(@$row->prices); ?>
So, you can add a price with some fixed tax (in my example 5.5%).
<?php echo $this->currencyHelper->displayPrices(@$row->prices) . '<br/>' . $this->currencyHelper->displayPrices(@$row->prices * 1.055); ?>

Regards,


Unfortunately I have two different taxes at the moment so that won't work.

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

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

Hi,

I think that you can multiply depending on the tax applied on the product with:

									if($row->product_tax_id == '1')
										$taxedPrice = @$row->prices * 1.055;
									else
										$taxedPrice = @$row->prices * 1.049;
And use "$this->currencyHelper->displayPrices($taxedPrice);" instead of "$this->currencyHelper->displayPrices(@$row->prices * 1.055);".

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

  • Posts: 108
  • Thank you received: 4
  • Hikashop Business
11 years 11 months ago #78952

Hello there

I replaced the following Code in the file "Back end / product / listing" from Backend:


<td>
   <?php echo $this->currencyHelper->displayPrices(@$row->prices); ?>
</td>

and just replaced this line with "888" to test, if there is a change in the backend:
<td>
   888
</td>

But it seems, that nothing happens (see Screenshot).
I don't know, where the problem may be...

I recently updated to HikaShop 2.0.0, but I don't know, if this is the problem (I don't think this is a problem).

Joomla is 2.5.8

Best regards
Mike

Attachments:

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

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

Hi,

Are you sure that you have edited the good template file ?

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

  • Posts: 108
  • Thank you received: 4
  • Hikashop Business
11 years 11 months ago #79114

Hmm, I think I have... the following code is the content of what I have in the file:

<?php
/**
 * @package  HikaShop for Joomla!
 * @version  2.0.0
 * @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 class="iframedoc" id="iframedoc"></div>
<?php if($this->config->get('category_explorer')){?>
<?php if(!HIKASHOP_J30) { ?>
<div id="page-product">
  <table style="width:100%">
    <tr>
      <td style="vertical-align:top;border:1px solid #CCC;background-color: #F3F3F3" width="200px">
        <?php echo hikashop_setExplorer('product&task=listing',$this->pageInfo->filter->filter_id,false,'product'); ?>
      </td>
      <td style="vertical-align:top;">
<?php } else { ?>
<div id="page-product" class="row-fluid">
  <div class="span2">
    <?php echo hikashop_setExplorer('product&task=listing',$this->pageInfo->filter->filter_id,false,'product'); ?>
  </div>
  <div class="span10">
<?php } ?>
<?php } ?>
      <form action="index.php?option=<?php echo HIKASHOP_COMPONENT ?>&amp;ctrl=product" method="post"  name="adminForm" id="adminForm">
<?php if(!HIKASHOP_J30) { ?>
        <table style="width:100%">
          <tr>
            <td>
<?php } else {?>
        <div class="row-fluid">
          <div class="span6">
<?php } ?>
              <a href="<?php echo hikashop_completeLink('product&task=listing&filter_id=0'); ?>"><?php echo JText::_( 'ROOT' ); ?>/</a>
              <?php echo $this->breadCrumb.'<br/>'.JText::_( 'FILTER' ); ?>:
              <input type="text" name="search" id="search" value="<?php echo $this->escape($this->pageInfo->search);?>" class="text_area" onchange="document.adminForm.submit();" />
              <button class="btn" onclick="document.adminForm.limitstart.value=0;this.form.submit();"><?php echo JText::_( 'GO' ); ?></button>
              <button class="btn" onclick="document.adminForm.limitstart.value=0;document.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'RESET' ); ?></button>
<?php if(!HIKASHOP_J30) { ?>
            </td>
            <td>
<?php } else {?>
          </div>
          <div class="span6">
            <div class="expand-filters" style="width:auto;float:right">
<?php } ?>
              <?php echo $this->manufacturerDisplay;?>
              <?php echo $this->publishDisplay; ?>
              <?php echo $this->productType->display('filter_product_type',$this->pageInfo->filter->filter_product_type); ?>
              <?php echo $this->childDisplay; ?>
<?php if(!HIKASHOP_J30) { ?>
            </td>
          </tr>
        </table>
<?php } else {?>
            </div>
            <div style="clear:both"></div>
          </div>
        </div>
<?php } ?>
        <table id="hikashop_product_listing" class="adminlist table table-striped table-hover" cellpadding="1">
          <thead>
            <tr>
              <th class="title titlenum">
                <?php echo JText::_( 'HIKA_NUM' );?>
              </th>
              <th class="title titlebox">
                <input type="checkbox" name="toggle" value="" onclick="hikashop.checkAll(this);" />
              </th>
              <th class="title">
                <?php echo JHTML::_('grid.sort', JText::_('HIKA_NAME'), 'b.product_name', $this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value ); ?>
              </th>
              <th class="title">
                <?php echo JHTML::_('grid.sort', JText::_('PRODUCT_CODE'), 'b.product_code', $this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value ); ?>
              </th>
              <th class="title">
                <?php echo JText::_('PRODUCT_PRICE'); ?>
              </th>
              <th class="title">
                <?php echo JHTML::_('grid.sort', JText::_('PRODUCT_QUANTITY'), 'b.product_quantity', $this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value ); ?>
              </th>
              <?php
                if(!empty($this->fields)){
                  foreach($this->fields as $field){
                    echo '<th class="title">'.JHTML::_('grid.sort', $this->fieldsClass->trans($field->field_realname), 'b.'.$field->field_namekey, $this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value ).'</th>';
                  }
                }
                if($this->doOrdering){?>
              <th class="title titleorder">
                <?php if ($this->order->ordering) echo JHTML::_('grid.order',  $this->rows ); ?>
                <?php echo JHTML::_('grid.sort',    JText::_( 'HIKA_ORDER' ), 'a.ordering',$this->pageInfo->filter->order->dir, $this->pageInfo->filter->order->value ); ?>
              </th>
              <?php }?>
              <th class="title titletoggle">
                <?php echo JHTML::_('grid.sort',   JText::_('HIKA_PUBLISHED'), 'b.product_published', $this->pageInfo->filter->order->dir, $this->pageInfo->filter->order->value ); ?>
              </th>
              <th class="title">
                <?php echo JHTML::_('grid.sort',   JText::_( 'ID' ), 'b.product_id', $this->pageInfo->filter->order->dir, $this->pageInfo->filter->order->value ); ?>
              </th>
            </tr>
          </thead>
          <tfoot>
            <tr>
              <td colspan="<?php
              $count = 8 + count($this->fields);
              if(!empty($this->doOrdering)){
                $count++;
              }
              echo $count;
              ?>">
                <?php echo $this->pagination->getListFooter(); ?>
                <?php echo $this->pagination->getResultsCounter(); ?>
              </td>
            </tr>
          </tfoot>
          <tbody>
            <?php
              $k = 0;
              for($i = 0,$a = count($this->rows);$i<$a;$i++){
                $row =& $this->rows[$i];
                $publishedid = 'product_published-'.$row->product_id;
            ?>
              <tr class="<?php echo "row$k"; ?>">
                <td align="center">
                <?php echo $this->pagination->getRowOffset($i); ?>
                </td>
                <td align="center">
                  <?php echo JHTML::_('grid.id', $i, $row->product_id ); ?>
                </td>
                <td>
                  <?php if($this->manage){ ?>
                    <a href="<?php echo hikashop_completeLink('product&task=edit&cid[]='.$row->product_id); ?>">
                  <?php } ?>
                      <?php echo $row->product_name; ?>
                  <?php if($this->manage){ ?>
                    </a>
                  <?php } ?>
                </td>
                <td>
                  <?php if($this->manage){ ?>
                    <a href="<?php echo hikashop_completeLink('product&task=edit&cid[]='.$row->product_id); ?>">
                  <?php } ?>
                    <?php echo $row->product_code; ?>
                  <?php if($this->manage){ ?>
                    </a>
                  <?php } ?>
                </td>
                <td>
                  <!-- <?php echo $this->currencyHelper->displayPrices(@$row->prices); ?> -->
                  8888
                </td>
                <td>
                  <?php echo ($row->product_quantity==-1?JText::_('UNLIMITED'):$row->product_quantity); ?>
                </td>
                <?php
                if(!empty($this->fields)){
                  foreach($this->fields as $field){
                    $namekey = $field->field_namekey;
                    echo '<td>'.$this->fieldsClass->show($field,$row->$namekey).'</td>';
                  }
                }

                if($this->doOrdering){?>
                <td class="order">
                  <?php if($this->manage){ ?>
                    <span><?php echo $this->pagination->orderUpIcon( $i, $this->order->reverse XOR ( $row->ordering >= @$this->rows[$i-1]->ordering ), $this->order->orderUp, 'Move Up',$this->order->ordering ); ?></span>
                    <span><?php echo $this->pagination->orderDownIcon( $i, $a, $this->order->reverse XOR ( $row->ordering <= @$this->rows[$i+1]->ordering ), $this->order->orderDown, 'Move Down' ,$this->order->ordering); ?></span>
                    <input type="text" name="order[]" size="5" <?php if(!$this->order->ordering) echo 'disabled="disabled"'?> value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" />
                  <?php }else{ echo $row->ordering; } ?>
                </td>
                <?php }?>
                <td align="center">
                  <?php if($this->manage){ ?>
                    <span id="<?php echo $publishedid ?>" class="spanloading"><?php echo $this->toggleClass->toggle($publishedid,(int) $row->product_published,'product') ?></span>
                  <?php }else{ echo $this->toggleClass->display('activate',$row->product_published); } ?>
                </td>
                <td width="1%" align="center">
                  <?php echo $row->product_id; ?>
                </td>
              </tr>
            <?php
                $k = 1-$k;
              }
            ?>
          </tbody>
        </table>
        <input type="hidden" name="option" value="<?php echo HIKASHOP_COMPONENT; ?>" />
        <input type="hidden" name="task" value="" />
        <input type="hidden" name="ctrl" value="<?php echo JRequest::getCmd('ctrl'); ?>" />
        <input type="hidden" name="boxchecked" value="0" />
        <input type="hidden" id="filter_id" name="filter_id" value="<?php echo $this->pageInfo->filter->filter_id; ?>" />
        <input type="hidden" name="filter_order" value="<?php echo $this->pageInfo->filter->order->value; ?>" />
        <input type="hidden" name="filter_order_Dir" value="<?php echo $this->pageInfo->filter->order->dir; ?>" />
        <?php echo JHTML::_( 'form.token' ); ?>
      </form>
<?php if($this->config->get('category_explorer')){?>
<?php if(!HIKASHOP_J30) { ?>
      </td>
    </tr>
  </table>
</div>
<?php } else { ?>
  </div>
</div>
<?php } ?>
<?php } ?>
I have here the price replaced with 8888!
Still no change in the product overview tables in the backend!

It's the following link that it opens:
www.waffenmarti.ch/shop/administrator/in...|product|listing.php

allrounder-j1.6 is my template

Last edit: 11 years 11 months ago by mike.

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

  • Posts: 108
  • Thank you received: 4
  • Hikashop Business
11 years 11 months ago #79123

hmm... after another hour of trying now... I can't get it work :dry:

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

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

Hi,

Could you give us a backend access ?

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

  • Posts: 108
  • Thank you received: 4
  • Hikashop Business
11 years 11 months ago #79225

I am very ashamed now: I found the problem!

I use different templates for backend/frontend. And since I was very accustomed to change view on the FRONTEND Template I also did these changes on the FRONTEND template instead on the BACKEND template.

I appologize for the trouble I caused and the messages and so on!

:blush:

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

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

Are you sure that you have edited the good template file ?


I told you ;)

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

  • Posts: 108
  • Thank you received: 4
  • Hikashop Business
11 years 11 months ago #79243

Xavier wrote:

Are you sure that you have edited the good template file ?


I told you ;)

Yes, sry... You did and I was too stupid ;) sry! :) omfg, I could directly sink to the bottom of the ocean... :blush:

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

  • Posts: 87
  • Thank you received: 5
  • Hikashop Business
11 years 4 months ago #111407

Hi,

Thanks for explaining how to make the prices including tax show in the product list.
However I would also like to be able to show the price of an option including tax in the product detail window, and to display the prices including tax in the 'manage variants' window for a product. Can this also be done by editing back-end views? If so, could you explain which ones and how?

Kind regards,
Chris

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

  • Posts: 82758
  • Thank you received: 13346
  • MODERATOR
11 years 4 months ago #111428

Hi,

Prices are not preloaded on these pages like on the product listing, so it's more complex to do.

Also, with next version of HikaShop during summer, the product edition page will be completely redone so I wouldn't recommend to do it, at least not until then.

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

Time to create page: 0.114 seconds
Powered by Kunena Forum