{"id":19002164,"date":"2026-08-25T07:08:48","date_gmt":"2026-08-25T07:08:48","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/undefined-property-stdclassline_total\/"},"modified":"2026-08-25T07:08:48","modified_gmt":"2026-08-25T07:08:48","slug":"undefined-property-stdclassline_total","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/undefined-property-stdclassline_total\/","title":{"rendered":"Undefined property: stdClass::$line_total"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Since yesterday, I\u2019ve been getting this error message:<br \/>PHP Warning:\u00a0\u00a0Undefined property: stdClass::$line_total in \/httpdocs\/wp-content\/plugins\/woocommerce-abandoned-cart\/cron\/class-wcal-cron.php on line 544<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">According to AI:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In&nbsp;<code>wcal_check_cart_total()<\/code>&nbsp;the code loops through the cart items and reads&nbsp;<code>$v-&gt;line_total<\/code>&nbsp;for each item. Some cart items in the database (often old or incomplete abandoned carts, for example cart items that have been saved without complete WooCommerce data, or an empty\/corrupted item) do not have a&nbsp;<code>line_total<\/code>&nbsp;property. PHP then issues a warning because you are attempting to read a non-existent property. The script does not crash as a result (the warning is not fatal), but it clutters up your logs considerably if this happens on every cron run.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The fix<\/strong>: Add an\u00a0<code>isset()<\/code>check so that the warning no longer occurs.<\/p>\n","protected":false},"template":"","class_list":["post-19002164","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19002164","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19002164\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19002164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}