We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Runway, Shop

Shop promotions limited to category

Hi

I am getting the same issue as a couple of posts on the forum with discounts applied to a category.

I've set up a category called discounts. I've applied that category to a couple of products. I've applied the same category to a promotion. When the promotion code is applied to the cart it discounts all the products in the cart, regardless of the category setting. I've tried deleting the category, set and promotion but it doesn't make any difference. I've also tried this offline and on the production server.

The debug on the updated cart page doesn't appear to mention any categories in the SQL – not sure if that's the issue here?:

SELECT * FROM perch3_shop_promotions WHERE promoFrom<='2017-11-10 09:39:00' AND promoTo>'2017-11-10 09:39:00' AND promoActive=1 AND promoDeleted IS NULL ORDER BY promoOrder ASC
Promo (Artist 25% off) qualifies!
Percentage discount promo

Diagnostics:

Perch Runway: 3.0.10, PHP: 7.0.20, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (3.0.10), assets (3.0.10), categories (3.0.10), perch_forms (1.9.1), perch_shop_orders (1.2.5), perch_shop_products (1.2.5), perch_shop (1.2.5), perch_members (1.6.2), perch_mailchimp (3.1)
App runtimes: <?php $apps_list = [ 'perch_mailchimp', 'perch_members', 'perch_shop', 'perch_forms', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/ellimondo/Dropbox/Sites/ellipress/dev.ellipress.co.uk/perch
PERCH_CORE: /Users/ellimondo/Dropbox/Sites/ellipress/dev.ellipress.co.uk/perch/core
PERCH_RESFILEPATH: /Users/ellimondo/Dropbox/Sites/ellipress/dev.ellipress.co.uk/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: dev.ellipress.co.uk
DOCUMENT_ROOT: /Users/ellimondo/Dropbox/Sites/ellipress/dev.ellipress.co.uk
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Jonathan Elliman

Jonathan Elliman 27 points

  • 2 years ago

Looking deeper at the Shop code in PerchShop_Promotions.class.php and debug, it seems the check for categories set is only made when the promotion is set to "Use Sale Price" only.

So discounts (percentage or fixed) skip this check and don't look for categories. Is this how it's supposed to work at the moment?

Many thanks,

Jon

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm not sure, we'll have to look into it.