I have NON-UNIQUE product codes after I upgrade to 110
Posted: 21 July 2009 09:47 PM   Ignore ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  406
Joined  2008-04-21

If you have upgraded to a foxee 110 that was build 019 or lower you may have noticed your product codes set per item are non-unique when they should be.  This is due to a bug in the upgrade method of the module that was missing the where statement.

If you have unique product codes then this post is not for you.
It’s recommended that you shutdown your site temporarily.  This is not required but recommended.
This issue can be resolved by doing the following:

Open the mcp.foxee.php file within the foxee module folder.

find the function Foxee_CP usually around line 80

//
    //  Constructor 
    //
    
function Foxee_CP$switch TRUE )
    
{
        
global $IN$LANG$PREFS$DB$EXT$FNS;
        
        
$this->site_id    $PREFS->ini('site_id');
        
$this->site_url    $PREFS->ini('site_url'FALSE); 

Insert the code within the attached file below the global line.

After you do that the code will look like this.

//
    //  Constructor 
    //
    
function Foxee_CP$switch TRUE )
    
{
        
global $IN$LANG$PREFS$DB$EXT$FNS;
$all_skus    $DB->query("SELECT `id` FROM " FOXEE_SKU_TABLE);
            
            if( 
$all_skus->num_rows {
                
foreach( $all_skus->result as $sku {
                    $id    
sprintf('s'$sku['id']);
                    
$DB->query("UPDATE " FOXEE_SKU_TABLE " SET `product_code`='{$id}' WHERE `id`='{$sku['id']}';");
                
}
            }
            
            $all_order_details    
$DB->query("SELECT `sku` FROM " FOXEE_ORDER_DETAIL_TABLE);
            
            if( 
$all_order_details->num_rows {
                
foreach( $all_order_details->result as $detail {
                    $id    
sprintf('s'$detail['sku']);
                    
$DB->query("UPDATE " FOXEE_ORDER_DETAIL_TABLE " SET `product_code`='{$id}' WHERE `sku`='{$detail['sku']}';");
                
}
            }
        $this
->site_id    $PREFS->ini('site_id');
        
$this->site_url    $PREFS->ini('site_url'FALSE); 

Once that is done, save the file and point your browser to your CP and then the modules section.
Click on the FoxEE module ONCE.
After you click and enter the FoxEE module close your browser. (note: any additional clicking and navigating in the FoxEE module won’t do any harm but this bit of code will run each time you navigate in the FoxEE module.)

Reopen the mcp.foxee.php file and remove the code you just pasted in.
After that the code should look like it was originally.

//
    //  Constructor 
    //
    
function Foxee_CP$switch TRUE )
    
{
        
global $IN$LANG$PREFS$DB$EXT$FNS;
        
        
$this->site_id    $PREFS->ini('site_id');
        
$this->site_url    $PREFS->ini('site_url'FALSE); 

Now check to see your product codes are now unique as they should have been after your upgrade to 110.

*You must use the code within the attached file.

File Attachments 
product_id_update.txt  (File Size: 1KB - Downloads: 220)
Profile
 
Posted: 22 August 2009 02:18 AM   Ignore ]   [ # 1 ]  
Newbie
Rank
Total Posts:  18
Joined  2009-05-25

This didn’t work for us - any other methods we could try?

Profile
 
Posted: 24 February 2010 01:54 PM   Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  17
Joined  2008-11-15

I’m trying to apply the fix for non-unique product codes from http://www.hccdevelopment.com/Web-Based-Software/Support-Forums/viewthread/379/, but when I upload the updated mcp.foxee.php, I get the following error:

Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in [serverpath]/modules/foxee/mcp.foxee.php on line76

I’d try updating to the most recent build, but I’m afraid to do so until the SKU problem is fixed. We’re on version 1.10.51.027.

Profile
 
Posted: 24 February 2010 05:27 PM   Ignore ]   [ # 3 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  1646
Joined  2007-11-23

You will notice that this fix was for build 019 or lower.

@lise - your issue has been addressed of forum.

Signature 

Mike

HCC Development

Profile
 
   
 
 

Join our Mailing List