Custom Fields in (shipping) invoice

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
12 years 9 months ago #38726

Is there a way to show the different custom fields I made in the Shipping Invoice (I use this as an ordersheet) on the backend? I need this information to create the ordered product. I guess it's just adding some extra lines, but I don't know wich code to use to show these.

Best Regards

Michel.

Last edit: 12 years 9 months ago by michelpouli.

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 9 months ago #38906

If you're talking about the custom item fields of the products, they will be displayed automatically on the invoice and shipping invoice if you turn on the "back end listing" option of your custom field.
For custom fields of the table product or order, they won't display on the invoices. You will have to edit the file "invoice" of the view "order" via the menu Display->Views and add custom code to display them.

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
12 years 9 months ago #38986

Thank you Nicolas,

Indeed I want a table product code in the invoice, can you tell me what line I have to add to the invoice file?

BR
Michel

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 9 months ago #39084

The product code is already display by default in the invoice. I'm not following you.

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
12 years 9 months ago #39199

"For custom fields of the table product or order, they won't display on the invoices. You will have to edit the file "invoice" of the view "order" via the menu Display->Views and add custom code to display them."

That's indeed what I want, I need this information to produce the product, so I would like to have this information on paper (thus in the invoice on the backend so I can print it). What custom code do I use to display the custom fields of the table "order"?

Michel

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 9 months ago #39273

It's not really complex. Something like that should do the trick:

<?php echo "my field: ".$this->order->CUSTOM_FIELD_COLUMN_NAME; ?>

where CUSTOM_FIELD_COLUMN_NAME is remplaced by the column name of your custom field.

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
12 years 9 months ago #39295

OK, I allready tried that (although my PHP skills are not so good, still studying :) ), what I did wrong was I added the tablename to the customfield.

This works. Thanks.

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

  • Posts: 267
  • Thank you received: 5
12 years 2 months ago #64886

For the table "products" ?
What is the key?

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 2 months ago #65033

After the line:
<?php echo $product->order_product_name.' '.$product->order_product_code;?>

you can do like that:
<?php $class=hikashop_get('class.product');
$prod = $class->get($product->product_id);
echo $prod->CUSTOM_FIELD_NAME;
?>

where CUSTOM_FIELD_NAME is the column name of your custom field.

The following user(s) said Thank You: dvddvd

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

  • Posts: 267
  • Thank you received: 5
12 years 2 months ago #65528

Thank you very much. works perfectly !

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

  • Posts: 4
  • Thank you received: 0
11 years 10 months ago #84173

And what if i need to modify adress field in invoice. for example i need IC number in adress. i figured out that i need to modify address_template.php too but it seems little bit tricky little help will be welcome :)

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

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

I think that you will have to edit the view "order / invoice" in HikaShop > Display > Views.
And add you desired value after the code

foreach($this->element->fields as $field){
                        $fieldname = $field->field_namekey;
                        $html=str_replace('{'.$fieldname.'}',$this->fieldsClass->show($field,$this->element->shipping_address->$fieldname),$html);
                      }

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

  • Posts: 91
  • Thank you received: 0
11 years 2 months ago #122334

Hello

I ve tried this but it doesn t work (i have a custom field in the product table named datedelvnement :

After the line:
<?php echo $product->order_product_name.' '.$product->order_product_code;?>

you can do like that:
<?php $class=hikashop_get('class.product');
$prod = $class->get($product->product_id);
echo $prod->datedelvnement;
?>

where CUSTOM_FIELD_NAME is the column name of your custom field.

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

  • Posts: 91
  • Thank you received: 0
11 years 2 months ago #122339

Here is the code of my view order

<?php
/**
 * @package  HikaShop for Joomla!
 * @version  2.1.3
 * @author  hikashop.com
 * @copyright  (C) 2010-2013 HIKARI SOFTWARE. All rights reserved.
 * @license  GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php
$colspan = 2;
global $Itemid;
$url_itemid = '';
if(!empty($Itemid)){
  $url_itemid='&Itemid='.$Itemid;
}
?>
<div id="hikashop_order_main">
<fieldset>
<?php if($this->invoice_type=='order'){?>
  <div class="header hikashop_header_title">
    <h1>
      <?php if($this->invoice_type=='order'){
        echo JText::_('HIKASHOP_ORDER').':'.$this->element->order_number;
      }else{
        echo JText::_('INVOICE').':'.$this->element->order_invoice_number;
      } ?>     <div id="ribboncontainer">  <h2 id="ribbonh2"><?php echo JText::_($this->element->order_status) ?> <span class="arrow"></span></h2></div>
    </h1>
  </div>
  <div class="toolbar hikashop_header_buttons" id="toolbar">
    <table>
      <tr>
        <?php
        if(hikashop_level(1)){
          if( $this->config->get('print_invoice_frontend') /* && !in_array($this->element->order_status,array('created','refunded','cancelled')) */){ ?>
        <td>
          <?php echo $this->popup->display('<span class="icon-32-print" title="'. JText::_('PRINT_INVOICE').'"></span>'. JText::_('HIKA_PRINTMY'),
              'PRINT_INVOICE',
              hikashop_completeLink('order&task=invoice&order_id='.$this->element->order_id.$url_itemid,true),
              'hikashop_print_invoice',
              760, 480, '', '', 'link'
            ); ?>
        </td>
        <?php }
        } ?>
        <td>
          <a id="hikashop_order_back_button" onclick="submitbutton('cancel'); return false;" href="#" >
            <span class="icon-32-back" title="<?php echo JText::_('HIKA_BACK'); ?>">
            </span>
            <?php echo JText::_('HIKA_BACK'); ?>
          </a>
        </td>
      </tr>
    </table>
  </div>
  <?php } ?>
</fieldset>

<div class="iframedoc" id="iframedoc"></div>
<form action="<?php echo hikashop_completeLink('order'.$url_itemid); ?>" method="post"  name="adminForm" id="adminForm">
  <table width="100%">
    <tr>
      <td>
        <div id="hikashop_order_right_part" class="hikashop_order_right_part">
        <?php echo JText::_('DATE').': '.hikashop_getDate($this->element->order_created,'%d %B %Y ');?><br/>
        <?php if($this->invoice_type=='order'){
            echo JText::_('HIKASHOP_ORDER');
            echo ': '.@$this->element->order_number;
          }else{
            echo JText::_(strtoupper($this->invoice_type));
            echo ': '.@$this->element->order_invoice_number;
          }
        ?>
        </div>
        <div id="hikashop_order_left_part" class="hikashop_order_left_part"><?php
          echo $this->store_address;
        ?></div>
      </td>
    </tr>
    <tr>
      <td>
        <br/>
        <br/>
        <table width="100%">
          <tr>
            <?php
              $params = null;
              $js = '';
            ?>
            <?php if(!empty($this->element->billing_address)){ ?>
            <td>
              <fieldset class="adminform" id="htmlfieldset_billing">
              <legend style="background-color: #FFFFFF;"><?php echo JText::_('HIKASHOP_BILLING_ADDRESS'); ?></legend>
                <?php
                  $html = hikashop_getLayout('address','address_template',$params,$js);
                  if(!empty($this->element->fields)){
                    foreach($this->element->fields as $field){
                      $fieldname = $field->field_namekey;
                      $html=str_replace('{'.$fieldname.'}',$this->fieldsClass->show($field,$this->element->billing_address->$fieldname),$html);
                    }
                  }
                  echo str_replace("\n","<br/>\n",str_replace("\n\n","\n",preg_replace('#{(?:(?!}).)*}#i','',$html)));
                ?>
              </fieldset>
            </td>
            <?php }
            if(!empty($this->element->order_shipping_id) && !empty($this->element->shipping_address)){
            ?>
            <td>
              <fieldset class="adminform" id="htmlfieldset_shipping">
                <legend style="background-color: #FFFFFF;"><?php echo JText::_('HIKASHOP_SHIPPING_ADDRESS'); ?></legend>
                <?php
                  $override = false;
                  if(method_exists($this->currentShipping, 'getShippingAddress')) {
                    $override = $this->currentShipping->getShippingAddress($this->element->order_shipping_id);
                  }
                  if($override !== false ) {
                    echo $override;
                  } else {
                    $html = hikashop_getLayout('address','address_template',$params,$js);
                    if(!empty($this->element->fields)){
                      foreach($this->element->fields as $field){
                        $fieldname = $field->field_namekey;
                        $html=str_replace('{'.$fieldname.'}',$this->fieldsClass->show($field,$this->element->shipping_address->$fieldname),$html);
                      }
                    }
                    echo str_replace("\n","<br/>\n",str_replace("\n\n","\n",preg_replace('#{(?:(?!}).)*}#i','',$html)));
                  }
                ?>
              </fieldset>
            </td><?php
            } ?>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td>
        <br/>
        <fieldset class="adminform" id="htmlfieldset_products">
          <legend style="background-color: #FFFFFF;"><?php echo JText::_('PRODUCT_LIST'); ?></legend>
          <table cellpadding="1" width="100%">
            <thead>
              <tr>
                <th class="hikashop_order_item_name_title title">
                  <?php echo JText::_('PRODUCT'); ?>
                </th>
                <?php
                $files = false;
                foreach($this->order->products as $product){
                  if(!empty($product->files)) $files = true;
                }
                if($this->invoice_type=='order' && $files){ $colspan++;; ?>
                <th class="hikashop_order_item_files_title title">
                  <?php echo JText::_('HIKA_FILES'); ?>
                </th>
                <?php } ?>
                <th class="hikashop_order_item_price_title title" align="center">
                  <?php echo JText::_('UNIT_PRICE'); ?>
                </th>
                <th class="hikashop_order_item_quantity_title title titletoggle">
                  <?php echo JText::_('PRODUCT_QUANTITY'); ?>
                </th>
                <th class="hikashop_order_item_total_title title titletoggle" align="center">
                  <?php echo JText::_('PRICE'); ?>
                </th>
              </tr>
            </thead>
            <tbody>
            <?php
              $k=0;
              $group = $this->config->get('group_options',0);
              foreach($this->order->products as $product){
                if($group && $product->order_product_option_parent_id) continue;
                ?>
                <tr class="row<?php echo $k;?>">
                  <td class="hikashop_order_item_name_value">
                    <?php if($this->invoice_type=='order' && !empty($product->product_id)){ ?>
                      <a class="hikashop_order_product_link" href="<?php echo hikashop_completeLink('product&task=show&cid='.$product->product_id.$url_itemid); ?>">
                    <?php } ?>
                    <p class="hikashop_order_product_name">
                      <?php echo $product->order_product_name; ?>
                      <?php if ($this->config->get('show_code')) { ?>
                        <span class="hikashop_product_code_order"><?php echo $product->order_product_code; ?></span>
						<?php $class=hikashop_get('class.product');
$prod = $class->get($product->product_id);
echo $prod->datedelvnement;
?></span>
                      <?php } ?>
                    </p>
                    <?php
                    if($group){
                      $display_item_price=false;
                      foreach($this->order->products as $j => $optionElement){
                        if($optionElement->order_product_option_parent_id != $product->order_product_id) continue;
                        if($optionElement->order_product_price>0){
                          $display_item_price = true;
                        }

                      }
                      if($display_item_price){
                        if($this->config->get('price_with_tax')){
                          echo ' '.$this->currencyHelper->format($product->order_product_price+$product->order_product_tax,$this->order->order_currency_id);
                        }else{
                          echo ' '.$this->currencyHelper->format($product->order_product_price,$this->order->order_currency_id);
                        }
                      }
                    }

                    if($this->invoice_type=='order' && !empty($product->product_id)){ ?>
                      </a>
                    <?php } ?>
                    <p class="hikashop_order_product_custom_item_fields">
                    <?php
                    if(hikashop_level(2) && !empty($this->fields['item'])){
                      foreach($this->fields['item'] as $field){
                        $namekey = $field->field_namekey;
                        if(!empty($product->$namekey)){
                          echo '<p class="hikashop_order_item_'.$namekey.'">'.$this->fieldsClass->getFieldName($field).': '.$this->fieldsClass->show($field,$product->$namekey).'</p>';
                        }
                      }
                    }
                    if($group){
                      foreach($this->order->products as $j => $optionElement){
                        if($optionElement->order_product_option_parent_id != $product->order_product_id) continue;

                        $product->order_product_price +=$optionElement->order_product_price;
                        $product->order_product_tax +=$optionElement->order_product_tax;
                        $product->order_product_total_price+=$optionElement->order_product_total_price;
                        $product->order_product_total_price_no_vat+=$optionElement->order_product_total_price_no_vat;

                         ?>
                          <p class="hikashop_order_option_name">
                            <?php
                              echo $optionElement->order_product_name;
                              if($optionElement->order_product_price>0){
                                if($this->config->get('price_with_tax')){
                                  echo ' ( + '.$this->currencyHelper->format($optionElement->order_product_price+$optionElement->order_product_tax,$this->order->order_currency_id).' )';
                                }else{
                                  echo ' ( + '.$this->currencyHelper->format($optionElement->order_product_price,$this->order->order_currency_id).' )';
                                }
                              }
                            ?>
                          </p>
                      <?php
                      }
                    }?>
                    </p>
                  </td>
                  <?php if($this->invoice_type=='order' && $files){ ?>
                  <td class="hikashop_order_item_files_value">
                    <?php
                    if(!empty($product->files) && ($this->order_status_download_ok || bccomp($product->order_product_price,0,5)==0)){
                      $html = array();
                      foreach($product->files as $file){
                        $fileHtml = '';
                        if(!empty($this->download_time_limit) && ($this->download_time_limit+$this->order->order_created)<time()){
                          $fileHtml = JText::_('TOO_LATE_NO_DOWNLOAD');
                        }
                        if(!empty($file->file_limit) && (int)$file->file_limit != 0) {
                          $download_number_limit = $file->file_limit;
                          if($download_number_limit < 0)
                            $download_number_limit = 0;
                        } else {
                          $download_number_limit = $this->download_number_limit;
                        }
                        if(!empty($download_number_limit) && $download_number_limit<=$file->download_number){
                          $fileHtml = JText::_('MAX_REACHED_NO_DOWNLOAD');
                        }
                        if(empty($fileHtml)){
                          if(empty($file->file_name)){
                            $file->file_name = JText::_('DOWNLOAD_NOW');
                          }
                          $file_pos = '';
                          if(!empty($file->file_pos)) {
                            $file_pos = '&file_pos='.$file->file_pos;
                          }
                          $fileHtml = '<a href="'.hikashop_completeLink('order&task=download&file_id='.$file->file_id.'&order_id='.$this->order->order_id.$file_pos.$url_itemid).'">'.$file->file_name.'</a>';
                          if(!empty($this->download_time_limit))$fileHtml .= ' / '.JText::sprintf('UNTIL_THE_DATE',hikashop_getDate($this->order->order_created+$this->download_time_limit));
                          if(!empty($download_number_limit))$fileHtml .= ' / '.JText::sprintf('X_DOWNLOADS_LEFT',$download_number_limit-$file->download_number);
                        }else{
                          if(empty($file->file_name)){
                            $file->file_name = JText::_('EMPTY_FILENAME');
                          }
                          $fileHtml = $file->file_name .' '.$fileHtml;
                        }
                        $html[]=$fileHtml;
                      }
                      echo implode('<br/>',$html);
                    }
                    ?>
                  </td>
                  <?php } ?>
                  <td class="hikashop_order_item_price_value">
                    <?php
                    if($this->config->get('price_with_tax')){
                      echo $this->currencyHelper->format($product->order_product_price+$product->order_product_tax,$this->order->order_currency_id);
                    }else{
                      echo $this->currencyHelper->format($product->order_product_price,$this->order->order_currency_id);
                    } ?>
                  </td>
                  <td class="hikashop_order_item_quantity_value">
                    <?php echo $product->order_product_quantity;?>
                  </td>
                  <td class="hikashop_order_item_total_value">
                    <?php
                    if($this->config->get('price_with_tax')){
                      echo $this->currencyHelper->format($product->order_product_total_price,$this->order->order_currency_id);
                    }else{
                      echo $this->currencyHelper->format($product->order_product_total_price_no_vat,$this->order->order_currency_id);
                    } ?>
                  </td>
                </tr>
                <?php
                $k=1-$k;
              }
            ?>
              <tr>
                <td style="border-top:2px solid #B8B8B8;" colspan="<?php echo $colspan; ?>">
                </td>
                <td class="hikashop_order_subtotal_title" style="border-top:2px solid #B8B8B8;" class="key">
                  <label>
                    <?php echo JText::_( 'SUBTOTAL' ); ?>
                  </label>
                </td>
                <td class="hikashop_order_subtotal_value" style="border-top:2px solid #B8B8B8;">
                  <?php
                  if($this->config->get('price_with_tax')){
                    echo $this->currencyHelper->format($this->order->order_subtotal,$this->order->order_currency_id);
                  }else{
                    echo $this->currencyHelper->format($this->order->order_subtotal_no_vat,$this->order->order_currency_id);
                  } ?>
                </td>
              </tr>
              <?php
              $taxes = $this->order->order_subtotal-$this->order->order_subtotal_no_vat;

              if(!empty($this->order->order_discount_code)){ ?>
              <tr>
                <td colspan="<?php echo $colspan; ?>">
                </td>
                <td class="hikashop_order_coupon_title key">
                  <label>
                    <?php echo JText::_( 'HIKASHOP_COUPON' ); ?>
                  </label>
                </td>
                <td class="hikashop_order_coupon_value" >
                  <?php
                  if($this->config->get('price_with_tax')){
                    echo $this->currencyHelper->format($this->order->order_discount_price*-1.0,$this->order->order_currency_id);
                  }else{
                    echo $this->currencyHelper->format(($this->order->order_discount_price-@$this->order->order_discount_tax)*-1.0,$this->order->order_currency_id);
                  } ?>
                </td>
              </tr>
              <?php }
              if($taxes != 0){
                if($this->config->get('detailed_tax_display') && !empty($this->order->order_tax_info)){
                  foreach($this->order->order_tax_info as $tax){ ?>
                  <tr>
                    <td colspan="<?php echo $colspan; ?>">
                    </td>
                    <td class="hikashop_order_tax_title key">
                      <label>
                        <?php echo $tax->tax_namekey; ?>
                      </label>
                    </td>
                    <td class="hikashop_order_tax_value">
                      <?php echo $this->currencyHelper->format($tax->tax_amount,$this->order->order_currency_id); ?>
                    </td>
                  </tr>
                <?php
                  }
                }else{ ?>
                  <tr>
                    <td colspan="<?php echo $colspan; ?>">
                    </td>
                    <td class="hikashop_order_tax_title key">
                      <label>
                        <?php echo JText::_( 'VAT' ); ?>
                      </label>
                    </td>
                    <td class="hikashop_order_tax_value">
                      <?php echo $this->currencyHelper->format($taxes,$this->order->order_currency_id); ?>
                    </td>
                  </tr>
              <?php }
              }
              if(!empty($this->order->additional)) {
                $exclude_additionnal = explode(',', $this->config->get('order_additional_hide', ''));
                foreach($this->order->additional as $additional) {
                  if(in_array($additional->name, $exclude_additionnal)) continue;
              ?>
                  <tr>
                    <td colspan="<?php echo $colspan; ?>">
                    </td>
                    <td class="hikashop_order_additionall_title key">
                      <label><?php
                        echo JText::_($additional->order_product_name);
                      ?></label>
                    </td>
                    <td class="hikashop_order_additional_value"><?php
                      if(!empty($additional->order_product_price)) {
                        $additional->order_product_price = (float)$additional->order_product_price;
                      }
                      if(!empty($additional->order_product_price) || empty($additional->order_product_options)) {
                        if($config->get('price_with_tax')){
                          echo $this->currencyHelper->format($additional->order_product_price+@$additional->order_product_tax, $this->order->order_currency_id);
                        }else{
                          echo $this->currencyHelper->format($additional->order_product_price, $this->order->order_currency_id);
                        }
                      } else {
                        echo $additional->order_product_options;
                      }
                    ?></td>
                  </tr>
              <?php }
              }
              if(!empty($this->order->order_shipping_method)){ ?>
              <tr>
                <td colspan="<?php echo $colspan; ?>">
                </td>
                <td class="hikashop_order_shipping_title key">
                  <label>
                    <?php echo JText::_( 'SHIPPING' ); ?>
                  </label>
                </td>
                <td class="hikashop_order_shipping_value" >
                  <?php
                  if($this->config->get('price_with_tax')){
                    echo $this->currencyHelper->format($this->order->order_shipping_price,$this->order->order_currency_id);
                  }else{
                    echo $this->currencyHelper->format($this->order->order_shipping_price-@$data->order_shipping_tax,$this->order->order_currency_id);
                  } ?>
                </td>
              </tr>
              <?php }
              if(!empty($this->order->order_payment_method) && $this->order->order_payment_price != 0){ ?>
              <tr>
                <td colspan="<?php echo $colspan; ?>">
                </td>
                <td class="hikashop_order_payment_title key">
                  <label>
                    <?php echo JText::_( 'HIKASHOP_PAYMENT' ); ?>
                  </label>
                </td>
                <td class="hikashop_order_payment_value" >
                  <?php echo $this->currencyHelper->format($this->order->order_payment_price,$this->order->order_currency_id); ?>
                </td>
              </tr>
              <?php } ?>
              <tr>
                <td colspan="<?php echo $colspan; ?>">
                </td>
                <td class="hikashop_order_total_title key">
                  <label>
                    <?php echo JText::_( 'HIKASHOP_TOTAL' ); ?>
                  </label>
                </td>
                <td class="hikashop_order_total_value" >
                  <?php
                  if($this->config->get('show_taxes') == 'both'){

                  }
                  else if($this->config->get('show_taxes') == 'with'){

                  }
                  else{
                    echo $this->currencyHelper->format($this->order->order_full_price,$this->order->order_currency_id);
                  }?>
                </td>
              </tr>
            </tbody>
          </table>
        </fieldset>
      </td>
    </tr>
    <tr>
      <td>
<?php
  JPluginHelper::importPlugin('hikashop');
  $dispatcher = JDispatcher::getInstance();
  $dispatcher->trigger('onAfterOrderProductsListingDisplay', array(&$this->order, 'order_front_show'));
?>
      </td>
    </tr>
    <?php if(hikashop_level(2) && !empty($this->fields['order'])){?>
    <tr>
      <td>
        <fieldset class="hikashop_order_custom_fields_fieldset">
          <legend><?php echo JText::_('ADDITIONAL_INFORMATION'); ?></legend>
          <table class="hikashop_order_custom_fields_table adminlist" cellpadding="1" width="100%">
            <?php foreach($this->fields['order'] as $fieldName => $oneExtraField) {
              if(!@$oneExtraField->field_frontcomp || empty($this->order->$fieldName)) continue;
            ?>
			
              <tr class="hikashop_order_custom_field_<?php echo $fieldName;?>_line">
                <td class="key">
                  <?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
                </td>
				<td class="key">
                  <?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
                </td>
                <td>
                  <?php echo $this->fieldsClass->show($oneExtraField,$this->order->$fieldName); ?>
                </td>
              </tr>
            <?php }  ?>
          </table>
        </fieldset>
      </td>
    </tr>
    <?php } ?>
    <?php if(hikashop_level(2) && !empty($this->order->entries)){?>
    <tr>
      <td>
        <fieldset class="htmlfieldset_entries">
          <legend><?php echo JText::_('HIKASHOP_ENTRIES'); ?></legend>
          <table class="hikashop_entries_table adminlist" cellpadding="1" width="100%">
            <thead>
              <tr>
                <th class="title titlenum">
                  <?php echo JText::_( 'HIKA_NUM' );?>
                </th>
              <?php
                if(!empty($this->fields['entry'])){
                  foreach($this->fields['entry'] as $field){
                    echo '<th class="title">'.$this->fieldsClass->trans($field->field_realname).'</th>';
                  }
                }
              ?>
              </tr>
            </thead>
            <tbody>
            <?php
              $k=0;
              $i=1;
              foreach($this->order->entries as $entry){
                ?>
                <tr class="row<?php echo $k;?>">
                  <td>
                    <?php echo $i;?>
                  </td>
                  <?php
                  if(!empty($this->fields['entry'])){
                    foreach($this->fields['entry'] as $field){
                      $namekey = $field->field_namekey;
                      if(!empty($entry->$namekey)) echo '<td>'.$this->fieldsClass->show($field,$entry->$namekey).'</td>';
                    }
                  }
                  ?>
                </tr>
                <?php
                $k=1-$k;
                $i++;
              }
            ?>
            </tbody>
          </table>
        </fieldset>
      </td>
    </tr>
    <?php } ?>
  </table>
  <input type="hidden" name="cid[]" value="<?php echo $this->element->order_id; ?>" />
  <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="cancel_redirect" value="<?php echo JRequest::getString('cancel_redirect'); ?>" />
  <input type="hidden" name="cancel_url" value="<?php echo JRequest::getString('cancel_url'); ?>" />
  <?php echo JHTML::_( 'form.token' ); ?>
</form>
</div><div class="watermark" style="color:#8B0101;"><?php         if(!strcmp($this->element->order_status, "confirmed"))        echo JText::_('MYPAID');        else        echo JText::_('MYNOTPAID');        ?></div>
<div style="page-break-after:always"></div>

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

  • Posts: 2334
  • Thank you received: 403
11 years 2 months ago #122671

Hi there,

Which modification are you trying? A small explanation about what you are trying to do could help us understand your issue and help you ;).
Can you also make sure you have the very last version of Hikashop?

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

  • Posts: 11
  • Thank you received: 0
11 years 2 months ago #123631

Hello Guys,

I am using Hikashop essential. I need the email that goes to the store owner to simply show the shipping method.

I dont know any php. can you give me a code snippet which i can add to the template? also, which template do I use to modify the look of that email?

Thanks in advance..

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

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

Hi,

You have to edit the mail "Order administrator notification" via the menu System > Emails (business edition) or in the folder "media/com_hikashop/mail", be careful with the second solution you will loose your changes after each update.

The shipping method name should be stored in the variable "$data", to know the content of the variable, you can use the function var_dump(), ex: var_dump($data);

You can edit the look of that email, in this same file.
A new email template will arrive in a future version of HikaShop, to easily edit the style.

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

  • Posts: 11
  • Thank you received: 0
11 years 2 months ago #124230

Hey Xavier,

I am a little confused here. First off, since I dont have the business version, I am using the 2nd option.

I get that I am supposed to edit the file order_admin_notification.html.php under the folder media/com_hikashop/mail ...

However, I don't understand how or where I paste the code you give me. And also, i have two shipping methods...so do i need to add it twice? please bare with me...im not a coder at all..

Thanks

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

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

Hi,

You just need to add the code once, it will display the method used.
Thanks to use the following code where you want in the email:

<?php
echo JText::_('SHIPPING_METHOD').':<br/>';
if(!is_array($data->order->order_shipping_method)) $data->order->order_shipping_method = array($data->order->order_shipping_method);
foreach($data->order->order_shipping_method as $method){
    echo $method.'<br/>';
}
?>

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

  • Posts: 11
  • Thank you received: 0
11 years 2 months ago #124340

Hey Xavier,

Thanks again for your help. I exactly copied the code and pasted at the bottom of the file. Now, in the notification email I am only seeing SHIPPING_METHOD: at the bottom of the mail....but it does not mention the shipping method picked. can you please double check the code you gave me?

Thanks

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

Time to create page: 0.152 seconds
Powered by Kunena Forum