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 > 0 ) {
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 > 0 ) {
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.
