Product Code Display Questions

  • Posts: 38
  • Thank you received: 0
12 years 3 months ago #60622

Hello,

I want to have the Product Code displayed only on the checkout page and in order confirmations email and in order history. I do not want it displayed in product listings next to the product name, but it would fine if was displayed on the actual product page, similiar to how the original poster wanted it displayed from this thread...

www.hikashop.com/en/forum/2-general-talk...e-display.html#59302

... but I could not get it to work according to the last reply of the topic.


Also, can the product code be displayed under its own listing on the checkout page like Image, Name, Unit Price, Quantity and Total Price is?

So it would be displayed like...

Image Name Product Code Unit Price Quantity Total Price


Thank you!

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

  • Posts: 13201
  • Thank you received: 2322
12 years 3 months ago #60630

Hi QuantumView,

If I understand well, you want to display the product code everywhere except on the products listing.

To do that you have to go in HikaShop > Configuration > Display, and under the "Default parameters for products" tab check yes for the option "Display product code".
Then go in HikaShop > Display > Views, and edit the view "product / listing_img_title.php". (listing_img_title is the view used by default, if you use another view edit the other one).

In this view, you can comment the line:

//echo $this->row->product_code;

To change the way to display the product code in the checkout, edit the view "checkout / cart.php".
Add:
          <th id="hikashop_cart_product_code_title" class="hikashop_cart_product_code_title hikashop_cart_title">
            <?php echo JText::_('CART_PRODUCT_CODE'); ?>
          </th>
Before:
          <th id="hikashop_cart_product_name_title" class="hikashop_cart_product_name_title hikashop_cart_title">
            <?php echo JText::_('CART_PRODUCT_NAME'); ?>
          </th>

And comment the line:
//echo $row->product_code;
Add:
              <td>
                  <a href="<?php echo hikashop_completeLink('product&task=show&cid='.$row->product_id.$url_itemid);?>" >
                    <?php if ($this->config->get('show_code')) { ?>
                      <span class="hikashop_product_code_checkout"><?php echo $row->product_code; ?></span>
                    <?php } ?>
                  </a>
              </td>
Before:
	<td class="hikashop_cart_product_price_value">

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

  • Posts: 38
  • Thank you received: 0
12 years 3 months ago #60933

Hi Xavier,

I believe I was able to get this to work, with the following changes...

I couldn't find the line:

//echo $row->product_code;

So I believe it was actually the line:

<span class="hikashop_product_code_checkout"><?php echo $row->product_code; ?></span>

And I couldn't (or don't know how) to comment out the <?php echo $row->product_code; ?> part of the line. I tried /* */ around it but it just displayed the backslashes and stars in the description. So I actually deleted that part of the line. It appears to be working.

If I did something I should not have, please let me know.


Also, I would like to be able to hide the croduct code from being displayed in the Shopping Cart that displays the list of items, the quantity and price. Can you tell me which file to modify and what I need to do to that file?

Thank You!!!!

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

  • Posts: 13201
  • Thank you received: 2322
12 years 3 months ago #60961

Hi QuantumView,

No it's ok, delete works too. to comment in php you have to use "//" before the code to comment.

You have to edit the file "Product / cart", and delete or comment the line:

<span class="hikashop_product_code_checkout"><?php echo $row->product_code; ?></span>

If you want to remove the product code in the checkout edit the view "Checkout / cart" and remove the same code.

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

  • Posts: 38
  • Thank you received: 0
12 years 3 months ago #61120

Hi Xavier,

I am not realy a web developer or coder, but I seem to get by. I just could not figure out how to get the // to work in order to comment out the line in the php code, so I just deleted it.

Thank you for your help!

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

Time to create page: 0.068 seconds
Powered by Kunena Forum