Support » Plugin: WP eCommerce » purchase-log.class.php on line 166 error

  • I had a hard time figuring out the problem with this error and found very little info about it online, so I thought I would post my resolution here in case anyone else has the problem. On checkout, I was receiving a string of these errors.

    PHP Warning:  Illegal string offset 'earnings' in /plugins/wp-e-commerce/wpsc-includes/purchase-log.class.php on line 166
    
    PHP Warning:  Illegal string offset 'sales' in /home/thegca/public_html/wp-content/plugins/wp-e-commerce/wpsc-includes/purchase-log.class.php on line 165

    I could not figure out why something that had been working all of the sudden stopped working. Then I realized that I had made some changes to the variations to that product. The product, I figured out after people started purchasing did not have one of the critical variations, so I went back and added the variation after the fact. This seemed to be the cause.

    The only resolution I found to work was to trash (then delete from trash) the product with the old (and new) variations, Recreate the product and regenerate the new product with the all of the variations that are needed.

    I hope this is helpful to someone.

    https://wordpress.org/plugins/wp-e-commerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • I have the same error. The base have of more than a thousand products and variations. I would appreciate any tips for systemic to eliminate this error.

    workaround for this bug would be

    replacing the code on lines 165-166 in /home/thegca/public_html/wp-content/plugins/wp-e-commerce/wpsc-includes/purchase-log.class.php with:

    if(isset($prod_meta['sales'])) $stats['sales'] += $prod_meta['sales'];
    if(isset($prod_meta['earnings'])) $stats['earnings'] += $prod_meta['earnings'];

    then make sure the sales and earnings are adding up correctly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘purchase-log.class.php on line 166 error’ is closed to new replies.