Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 11-28-2010 03:41:44

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

MPN Instead of Product Numbers. - How Do I Make This Change?

I would like to display the MPN next to the product name instead of the product number. I can, and already have, made this change with something like:

Code:

<?php

print '<p style="color: black; text-align: justify;"><strong>' . $prodname . '</strong> <span style="color: red;">- </span>' . $mpn . '</p>';

?>

...but I would really llike to do this 'properly' in , not least so it displays in the order information without needing to add a load more instances of the above to several files.

I could see, looking at the code in  that the change should be quite simple, but when I tried amending it (replacing the instances of ['prodnum'] with ['mpn'] it would not accept the change (: I still had the  values displaying on the product pages).  Obviously I had a look to see whether the replacement value needed to be added to any arrays or the like, but could see nothing like that, - it just looks to be a case of "if its there in the database it should work".  Can anybody help with this, please?

Last edited by Design_Wholesale (11-28-2010 03:43:07)

Offline

 

#2 11-28-2010 09:47:42

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: MPN Instead of Product Numbers. - How Do I Make This Change?

If the column MPN exist in your product database then you will not have any problems pulling that information in the product displays as all database fields are placed into the item array, you just need to make the appropriate call in the product displays. If your wanting that column to show up in the order displays then you need to edit or add that field to the item array that is built for the order as not all column data is placed in that array. You will find where that information is built in the function build_item in the GBU_Cart.php script, you would then have to make edits in all of the ordersummary scripts to display the new column. If you want the information displayed in the second checkout page then it would require a new column in the order database and code to get it displayed.

John

Offline

 

#3 11-30-2010 01:31:59

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

Re: MPN Instead of Product Numbers. - How Do I Make This Change?

Thanks, John, I tried what you suggested, but it still does not appear to be doing what I wanted it to do.

I added the  details to the product and item arrays in  (no problems there) and then modified the following in  to make the display of  next to the product title on the  pages become a display of  next to the product title on the  pages:


Code:

     // +--
     // | Handle displaying product numbers.
     // +--

     if ((!(empty($result[$num]['mpn']))) && ($showprodnums)) {
           $result[$num]['name'] = $result[$num]['mpn'] . ' - ' . $result[$num]['name'];
     }

...unfortunately I still have a display of  next to the product titles, so I guess that I am still missing some modification somewhere.

Offline

 

Board footer