WordPress.org

Ready to get started?Download WordPress

Forums

YAK for WordPress
[resolved] php error in yak-for-wordpress.php on line 1460 (4 posts)

  1. gkgkgk
    Member
    Posted 1 year ago #

    Hello
    When browsing the checkout page, i am getting the following error:

    Warning: Creating default object from empty value in ...\wp-content\plugins\yak-for-wordpress\yak-for-wordpress.php on line 1460

    The products table looks fine, no quantities because i am working on a downloadable products shop.
    I tried to display $_SESSION and never get a view on $_SESSION[ITEMS_NAME] wich is the argument when the function yak_get_totals(), wich containes that line 1460, is called from yak-view-cart.php (line 67).
    I'am still on localhost with that project, so i can't provide a link to the site.
    But are there any hints, how to fix this? Does anybody have the same problem?
    Tahnks

    http://wordpress.org/extend/plugins/yak-for-wordpress/

  2. gkgkgk
    Member
    Posted 1 year ago #

    Hello
    Think i found a solution:

    This PHP error raises due to enabled strict mode in php error reporting.
    (ini_set('error_reporting', E_ALL | E_STRICT); in php.ini)

    lines 1460 and 1461 triggered that error:
    1460 $totals->quantity = $total_qty;
    1461 $totals->price = $total_price;

    adding the explicit instantiation of $totals fixes this:
    1460 $totals = new stdClass();
    1461 $totals->quantity = $total_qty;
    1462 $totals->price = $total_price;

    @kwoli:
    maybe this finds its way in a future update release...
    BTW: thanks for this great and elegant plugin!

  3. nolongeractive
    Member
    Plugin Author

    Posted 1 year ago #

    Yeah sorry, meant to reply yesterday but then burnt hours trying to figure out how to fix all my broken tests after upgrading my test site to WP3.5 (basically any tests which rely on uploading media/images are now broken and, as far as I can tell, unfixable).

    I've already fixed it locally (didn't use the stdClass route, created a custom class instead), but I won't be releasing it until I can get my test suite working again.

  4. gkgkgk
    Member
    Posted 1 year ago #

    thank you for your reply and good luck with 3.5!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic