Forum
Perch Shop - Free Shipping Over X Promotion Not Working
Hi Guys,
I'm trying to create an automatic "Free Shipping over £50" promotion in Perch Shop.
So far, it's not working - if I create the promotion, and select the Shipping Method that it applies to, I get this error onscreen:
Warning: trim() expects parameter 1 to be string, array given in /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/addons/apps/perch_shop/fieldtypes.php on line 139
Warning: PDO::quote() expects parameter 1 to be string, array given in /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/core/lib/PerchDB_MySQL.class.php on line 382
Warning: Cannot modify header information - headers already sent by (output started at /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/addons/apps/perch_shop/fieldtypes.php:139) in /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/core/lib/PerchUtil.class.php on line 1210
Warning: Cannot modify header information - headers already sent by (output started at /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/addons/apps/perch_shop/fieldtypes.php:139) in /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/core/lib/PerchUtil.class.php on line 1211
Warning: Cannot modify header information - headers already sent by (output started at /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/addons/apps/perch_shop/fieldtypes.php:139) in /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/core/lib/PerchUtil.class.php on line 1212
Warning: Cannot modify header information - headers already sent by (output started at /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/addons/apps/perch_shop/fieldtypes.php:139) in /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/core/lib/PerchUtil.class.php on line 1218
Warning: Cannot modify header information - headers already sent by (output started at /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/addons/apps/perch_shop/fieldtypes.php:139) in /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/core/inc/top.php on line 17
and this in the debug:
Invalid query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND shippingDeleted IS NULL LIMIT 1' at line 1
If I save the promotion without selecting the shipping method that it applies to, I don't get any errors. However, obviously that doesn't work for the promotion.
Here's my diagnostics:
Perch Runway: 2.8.29, PHP: 7.0.6, MySQL: 5.5.53, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29), perch_forms (1.8.3), perch_blog (5.0), perch_shop_orders (1.0.4), perch_shop_products (1.0.4), perch_shop (1.0.4), perch_members (1.5)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_members', 'perch_shop', 'perch_forms' ); ?>
PERCH_LOGINPATH: /cms
PERCH_PATH: /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms
PERCH_CORE: /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/core
PERCH_RESFILEPATH: /nfs/c11/h04/mnt/198028/domains/staging.flykartel.com/html/cms/resources
Image manipulation: GD
PHP limits: Max upload 99M, Max POST 99M, Memory: 99M, Total max file upload: 99M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: staging.flykartel.com
DOCUMENT_ROOT: /home/198028/domains/staging.flykartel.com/html
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Thanks, Harry
Above that line should be the query it's complaining about. If you could let me know what that is that would be helpful.
Hi Drew,
It looks as though the shipping method I've ticked hasn't been assigned an ID?
This is the preceding line:
Are you able to editing your shipping methods?
Hi Drew,
I'm able to edit the shipping methods that are in use without any issues.
So it sounds like your shipping methods do have IDs.
Yep, just checked the debug on the Shipping screen and this method has a shippingID of 1.
Any ideas as to the problem here, then?
Where is the error occurring?
Hi Drew,
I'm trying to create an automatic "Free Shipping over £50" promotion in Perch Shop.
The error occurs when I create/edit the promotion, and select the Shipping Method that it applies to.
Here is the error I get, and the last query just before that:
Can you show me the full debug?
This is the debug message that appears after trying to save a promotion that applies to a selected shipping method.
You're on a very old version of Shop. Is there a reason you can't update?