Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Product Codes on order details page? Rate Topic   - - - - -

 
  • glyndon
  • Senior Member
  • Members
  • Join Date: 07-Dec 06
  • 187 posts

Posted 11 January 2007 - 11:47 AM #1

Hi all,

Does anyone know how to include the product code in the order details page?

Although the customer can see the product codes on the storefront, it doesn't make sense to omit them from the order details page as they would likely to be used by picking staff.

Many thanks.

 
  • argosmedia
  • Member
  • Members
  • Join Date: 07-Nov 05
  • 70 posts

Posted 13 January 2007 - 12:33 AM #2

Try putting this where you want the code:

{if $product.product_code}
  <div class="sku">{$lang.sku}: <span id="product_code_{$product.product_id}">{$product.product_code}</span></div>
  {/if}

I got that from the product details page. I did not try it out myself, but it might just work on the order details page as well...
Jurgen Nijhuis
www.argosmedia.nl

 
  • glyndon
  • Senior Member
  • Members
  • Join Date: 07-Dec 06
  • 187 posts

Posted 13 January 2007 - 11:52 AM #3

Thank you but that has not worked.

I tried something similar myself, thought I might just get lucky.

I am wondering if the product code needs to be passed into the order details in the db first as some of the code in the order details template show as:

<a href="{$index_script}?{$target_name}=products&{$mode_name}=update&product_id={$oi.product_id}" class="manage-root-item">{$oi.product|escape:html}</a>

There is the extra oi. (order info) in the variables.

Many thanks

 
  • glyndon
  • Senior Member
  • Members
  • Join Date: 07-Dec 06
  • 187 posts

Posted 13 January 2007 - 11:56 AM #4

There is a product code column in the order details table in the database.

The column is blank for all of my test orders and I know some of those products have codes.

Perhaps they are not being passed to the db on order?

 
  • Grennix
  • Junior Member
  • Members
  • Join Date: 02-Nov 06
  • 5 posts

Posted 17 January 2007 - 02:36 PM #5

Try putting this in order_details.tpl before {$oi.product|escape:html}


{$oi.product_code}  



Peter

 
  • glyndon
  • Senior Member
  • Members
  • Join Date: 07-Dec 06
  • 187 posts

Posted 17 January 2007 - 07:47 PM #6

Sorry but it's not worked.

There is a column in the orders table in the database for the product code but I don't see any codes in there from test orders I have done (products which have codes).

That makes me think that the product code is not being written to the db in the first place. No code work in the smarty template is going to get it to work because it is missing the PHP functionality.

I could be wrong but that's what it looks like to me?

 
  • SWS
  • Senior Member
  • Members
  • Join Date: 30-Oct 06
  • 798 posts

Posted 17 January 2007 - 08:28 PM #7

It does work and is quite simple..

Using CS-Cart 1.3.4r2 as mentioned...

EDIT /skins/youskin..../admin/order_pages/order_details.tpl

Add the lines highlighted in RED :

 
{include file="common_templates/subheader.tpl" title=$lang.products_information}
<table cellpadding="2" cellspacing="1" border="0" width="100%">
<tr>
[COLOR=red] <td width="10%"  class="manage-header"> {$lang.product_code}</td>
[/COLOR]<td class="manage-header"> {$lang.product}</td>
 <td class="manage-header"> {$lang.options}</td>
 <td width="5%" class="manage-header" align="center"> {$lang.price}</td>
 <td width="5%" class="manage-header" align="center"> {$lang.amount}</td>
 {if $order_info.use_discount}
 

and then :

{elseif $settings.Modules.product_configurator != 'Y' || !$oi.extra.in_configuration}
<tr {cycle values="class='manage-row', "}>
[COLOR=red]<td class="side-padding" height="22">{$oi.product_code}</td>[/COLOR]
 <td class="side-padding" height="22">
 <a href="{$index_script}?{$target_name}=products&{$mode_name}=update&product_id={$oi.product_id}" class="manage-root-item">{$oi.product|escape:html}</a>
 {if $oi.extra.is_edp && $oi.extra.ekey}
  {assign var="edp_exist" value="Y"}
  <input type="hidden" name="prolongate_data[{$oi.product_id}][ekey]" value="{$oi.extra.ekey}" />
  <table cellpadding="0" cellspacing="0" width="100%">
  <tr>
 

I added extra code so it was easy for you to find...

I know this works 100% as ive been using it since I went live.
[SIZE=3][/SIZE]

 
  • glyndon
  • Senior Member
  • Members
  • Join Date: 07-Dec 06
  • 187 posts

Posted 19 January 2007 - 11:15 PM #8

Yes it does work. (I thought that's what I did but it didn't work earlier, must have done it wrong?)

Thank you

 
  • Luthien
  • Member
  • Members
  • Join Date: 17-Jan 06
  • 134 posts

Posted 14 February 2007 - 08:18 AM #9

I had a go at also adding the product code to the customer side when a customer views their order history.

Using CS-Cart 1.3.4r2 as mentioned...

EDIT /skins/youskin..../customer/order_pages/order_details.tpl

Add the lines highlighted in RED :

{include file="common_templates/subheader.tpl" title=$lang.products_information}
<table cellpadding="2" cellspacing="1" border="0" width="100%">
<tr>
       [COLOR=Red]<td width="10%"
class="table-head"> {$lang.product_code}</td>[/COLOR]
    <td width="100%" class="table-head"> {$lang.product}</td>
    <td class="table-head"> {$lang.options}</td>
        <td class="table-head" align="center"> {$lang.price}</td>
    <td class="table-head" align="center"> {$lang.amount}</td>
    {if $order_info.use_discount}
    <td class="table-head" align="center">{$lang.discount}</td>
    {/if}
    {if $order_info.taxes}
    <td class="table-head" align="center"> {$lang.tax}</td>
    {/if}


and then...
{if $settings.Modules.product_configurator == 'Y' && $oi.extra.configuration}
        {include file="addons/product_configurator/order_details_configurable.tpl"}
{elseif $settings.Modules.product_configurator != 'Y' || !$oi.extra.in_configuration}
<tr {cycle values="class='table-row', "}>
         [COLOR=Red]<td class="side-padding" height="22">{$oi.product_code}</td>[/COLOR]
    <td> <a href="{$index_script}?{$target_name}=products&product_id={$oi.product_id}">{$oi.product}</a>
    {if ($order_info.status == 'P' || $order_info.status == 'C') && $oi.extra.is_edp}
    <div align="right"><a href="{$index_script}?{$target_name}=products&{$mode_name}=download&ekey={$oi.extra.ekey}"><b>[{$lang.download}]</b></a></div>
    {/if}
    </td>

It works ok but you guys are the gurus. I'm learning ...

 

Posted 14 February 2007 - 11:12 PM #10

adding myself as a subscriber.. I'll be looking into this very shortly
I've moved on from CS-Cart to WooC******** - If you need anything I can be of little help.