View Issue Details

IDProjectCategoryView StatusLast Update
0006670OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2017-07-25 13:40
Reportervanilla thunder 
PrioritylowSeveritytweakReproducibilityalways
Status acknowledgedResolutionopen 
Product Version4.10.3 / 5.3.3 
Target VersionFixed in Version 
Summary0006670: inconsistent active/inactive handling for promotions
Descriptionwhen creating new promotions, the initial label for active state checkox is "always active" or you can set "active for a period" dates.
But if you choose type "promotion", label "always active" becomes just "active" and promotions (type) need valid "active from" timestamp to be loaded, even if they are active.

IMHO promotions (type) should be handled the same way as actions and banners: be "always active" or "active for period".
Steps To Reproducedon't use demoshop, it does not parse smarty in cms pages.

1) copy-paste this code into any cms page (e.g. oxagb or oxstartwelcome):

<h2>active promotions: [{$oView->getPromoCurrentList()|@count}]</h2>
[{foreach from=$oView->getPromoCurrentList() item="_promo"}]
[{$_promo->oxactions__oxtitle->value}]/[{$_promo->oxactions__oxlongdesc->value}]

[{/foreach}]

2) open this cms page in frontend in new tab, it says "active promotions: 0"
3) admin -> Customer Info -> promotions
4) new promotion: check "always active", leave "active from" empty and set type "promotion". save.
5) you will notice "always active" changed to "active", in top promotions list this promotion is listed as active
6) reload cms page in frontend, it still says "active promotions: 0"
7) set "active from" date e.g. 2000-01-01", save
8) reload cms page and you will finally see this promotion.
Additional InformationTherefore the sql query generated in oxActionList::loadCurrent() need to be changed. It is like
"SELECT ... WHERE (oxactiveto == 0 OR oxactiveto > today) AND oxactivefrom != 0 AND oxactivefrom < today"

I think, the oxactivefrom check at least should be "OR" instead of "AND", just like oxactiveto check:
" ... ( oxactivefrom == 0 OR oxactivefrom < today ) ..."
or handled the same way as banners + action: "always active" or "active for a priod" and utilize $oBaseObject->getSqlActiveSnippet().
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
MySQL VersionNot defined

Activities

There are no notes attached to this issue.