Problem with Product Code
Posted: 17 March 2009 08:28 PM   Ignore ]  
Newbie
Rank
Total Posts:  5
Joined  2009-02-23

I have created a set of custom fields for my products that includes a Product Code that mirrors the code used in brick and mortar store. It’s stored in the exp_weblog_data table in field_id_6.

How can I get it to display in the order details instead of the SKU NUMBER which only relates to the id of the specific entry and doesn’t help me manage my store ata ll.

thanks

Profile
 
Posted: 17 March 2009 10:23 PM   Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  1653
Joined  2007-11-23

Hi Brian,

I moved this to the “How To” section.

Your question was kinda vauge, can you be more specific.

Thanks

Signature 

Mike

HCC Development

Profile
 
Posted: 18 March 2009 12:52 PM   Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  5
Joined  2009-02-23

I have attached a couple of screen shots that will hopefully clarify what I am saying. Essentially, the SKU number as it is currently assigned by FoxEE doesn’t give my retail store any useful information, they need a unique Product Code which I have created as a custom field.

In order for them to easily satisfy orders and sync orders up with our retail system (which is irrelevant, but happens to be Microsoft RMS) they need the Product Code. Since the existing Order Detail page doesn’t provide this information they have to pull inventory solely based on the item name which isn’t how the inventory is organized in our warehouse.

Please see the screenshots and I think it will be more clear…if not then I probably need more coffee smile

thanks,
brian

Image Attachments  foxee-order-detail-screen.jpgfoxee-product-edit-screen.jpg
Profile
 
Posted: 18 March 2009 05:03 PM   Ignore ]   [ # 3 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  1653
Joined  2007-11-23

Hi Brian,

It sounds like you want a Product code field which is not part of build 109. It’s a good idea though, and we are considering the ability to add it to the next build, or soon after. Unfortunately, it is not currently capable with build 109 or without hacking the core files.

Mike

Signature 

Mike

HCC Development

Profile
 
Posted: 18 March 2009 05:52 PM   Ignore ]   [ # 4 ]  
Newbie
Rank
Total Posts:  5
Joined  2009-02-23

Hey Michael,

I’m totally comfortable hacking the core. All I really need is to display the custom field “product_code” where the SKU NUMBER displays right now. Can you tell me which file I would need to hack? I figure since it is getting the product name from the same table, getting the product code must be relatively simple right?

Profile
 
Posted: 16 April 2009 04:45 PM   Ignore ]   [ # 5 ]  
Newbie
Rank
Total Posts:  9
Joined  2009-02-27

I’m interested in using my own defined “SKU”, too. We’re just about ready to go live with a site that has an existing fulfillment center, and we need some way of showing the existing Product ID/SKU on the cart receipt. There seems to be a “product_code” lurking in the extension files and also sent to FoxyCart as part of the JSON, but it’s not displayed in the control panel.

"products":[
    {
        
"id""408350",
        
"name""31 Day One Piece",
        
"code""I WANT TO USE THIS VALUE HERE",
        
"options"{"sku":"153"},
        
"quantity"1,
        
"price_each"24.99,
        
"price"24.99,
        
"weight_each"0,
        
"weight"0,
        
"shipto""",
        
"category""DEFAULT"
    
}
]

How can I get my custom product id input into the “code” above?

Thanks.

PS: Fantastic product. Nearly every issue I’ve run into has been solved either here or at the FoxyCart forums. But this one I can’t figure a workaround.

Profile
 
Posted: 17 April 2009 10:37 AM   Ignore ]   [ # 6 ]  
Newbie
Rank
Total Posts:  9
Joined  2009-02-27

Here’s what I ended up doing: I replaced the entry_id with my own sku. In mod.foxee.php, right around line 487:

$sku intval($TMPL->fetch_param('id'));
$product array_popUtils::fetch_foxee_items(array('id' => $sku)) ); 

I added:

$sku_sql "SELECT `exp_weblog_data`.`field_id_67` as `sku_id`
     FROM   `exp_weblog_data`
     WHERE  `entry_id` = '"
.$product['id']."'";
$sku_query $DB->query$sku_sql );
$sku_id $sku_query->row['sku_id']

where field_id_67 is my custom field for my own product sku.

Then at line 522 ($product_params), I replaced

'sku'     => $sku

with

'sku'     => $sku_id

That puts my own sku into the hidden field and thus into the cart.

Do you anticipate any issues with this method?

Profile
 
Posted: 18 April 2009 01:47 PM   Ignore ]   [ # 7 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  1653
Joined  2007-11-23

Hi Mike,

Unfortunately FoxEE needs to use the EE default entry ID for your products, by manipulating the SKU there is potential for ID’s to collide. We don’t recommend that you use the method you outlined.

Our solution is to make a custom field available the you can enter internal Product codes and then display that information in your templates and in the order information. We are working on the best way to add that feature.

Thanks

Signature 

Mike

HCC Development

Profile
 
Posted: 18 April 2009 05:48 PM   Ignore ]   [ # 8 ]  
Newbie
Rank
Total Posts:  9
Joined  2009-02-27

If the SKUs for our site are unique, would that be OK?

Profile
 
Posted: 18 April 2009 05:58 PM   Ignore ]   [ # 9 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  1653
Joined  2007-11-23

I just looked at your code again, that should work. I thought you were actually changing the entry id. You will certainly have to test that there are no other areas that rely on the entry ID number, I know theres a URL hack check when the purchase returns from FoxyCart.

Test it out and let me know what you find.

Signature 

Mike

HCC Development

Profile
 
Posted: 18 April 2009 06:10 PM   Ignore ]   [ # 10 ]  
Newbie
Rank
Total Posts:  9
Joined  2009-02-27

Thanks, Michael. It’s actually live now: http://mts-mt.com/consumers/ . No problems yet….

Profile
 
Posted: 18 April 2009 06:22 PM   Ignore ]   [ # 11 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  1653
Joined  2007-11-23

Nice site, don’t forget to post in our Site Showcase forum.

I am going to look into some of the security checks but I think this method should work for you.

Signature 

Mike

HCC Development

Profile
 
Posted: 09 August 2009 09:34 AM   Ignore ]   [ # 12 ]  
Newbie
Rank
Total Posts:  14
Joined  2008-11-08

I’d love to do the same thing - “displaying the custom field “product_code” where the SKU NUMBER displays right now”. My client has a number of product lines - but each has its own product item field. I’m a newbie when it comes to PHP - can anyone help me rewrite this statement so it includes my multiple field_ids:

$sku_sql = “SELECT `exp_weblog_data`.`field_id_67` as `sku_id`


Guess I’m looking for something like:

$sku_sql = “SELECT `exp_weblog_data`.`field_id_X or field_id_XX or field_id_XXX` as `sku_id`

Profile
 
   
 
 

Join our Mailing List