Forum
Perch Shop Error
Hi,
Getting this error in when showing the cart:
A non-numeric value encountered in /admin/addons/apps/perch_shop/lib/PerchShop_Product.class.php on line 399
I've echo'd out the variable responsible for this, and it returns string(0) ""
.
It's a variant of a product, that has a price set. Once again, mini diagnostics:
Perch Runway: 3.0.8, PHP: 7.1.6, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.8), assets (3.0.8), categories (3.0.8), perch_blog (5.5.1), perch_forms (1.9), perch_shop_orders (1.2.2), perch_shop_products (1.2.2), perch_shop (1.2.2), chirp_seo (1.1), perch_members (1.6.2)
App runtimes: <?php $apps_list = [ 'perch_members', 'perch_shop', 'perch_forms', 'perch_blog', 'chirp_seo' ];
What is the price set to? What is the tax rate set to?
It seems to coming off the trade and sale prices, which aren’t set to anything, just empty fields.
Do you have trade or sale pricing enabled?
Where do I enable/disable that?
There's a few different ways. If you've checked the box to use sale pricing on a product, or created a sale period, or enabled either sale or trade pricing on your page would be a few of the main ones.
Sale pricing isn't checked, there is a promotion created, but no sale period. No code references.
So to answer you're question - not to my knowledge!
Ok, so where does that leave things?
Well, the easy way for me to eradicate the error was to add a fix, which I noted:
// TODO: Bug fix if (empty($base_price)) { $base_price = 0; }
Not ideal at all, but it removes all errors and things appear to work as usual. I'm presuming it's referencing an empty field of either sale/trade price for some reason, so if a sale/trade price hasn't been set, it's returning the empty string.