View Issue Details

IDProjectCategoryView StatusLast Update
0006590OXID eShop (all versions)4.12. Subshop handlingpublic2017-02-14 16:50
Reporterchoeft Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version4.10.3 / 5.3.3 
Summary0006590: Function getSubShopList of Model oxShop returns list of supershops instead of subshops
DescriptionWe found the following bug:

When trying to retrieve a list of subshops of a current shop (which is a supershop), you'll recieve a list of supershops.

Steps To ReproduceTry the following setup:

Shop A - Supershop (ID: 1)
Shop B - Subshop of A (ID: 2)
Shop C - Supershop (ID: 3)

When now executing this code:

$currentShop = oxNew("oxshop");
$currentShop->load(3);
$subShops = $currentShop->getSubShopList();

You'll recieve a list of the shops A + B, which is not what we expect of this function. The function getSubShopList() calls oxShopList::loadSuperShopList() if the current shop is a supershop, which is wrong I suppose; the correct function to call would be oxShopList::loadSubShopList()

If we use use this code instead of the above:

$oShopList = oxNew("oxShopList");
$oShopList->loadSubShopList(3);

it is working as expected.
Additional InformationThank you for investigating.
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Activities

QA

2017-02-14 15:59

administrator   ~0011976

Last edited: 2017-02-14 16:49

This is the expected behaviour of the method \oxShop::getSubShopList().
When a shop is a supershop you can assign products to any shop. Hence all other shops are listed using this method.

For example: The Mall tab under shipping methods should list all the shops other than the supershop selected. The method \oxShop::getSubShopList() is used here.

For the setup mentioned in the "Steps To Reproduce":

Shop A - Supershop (ID: 1)
Shop B - Subshop of A (ID: 2)
Shop C - Supershop (ID: 3)

when only B is to be listed as subshop for Shop A, then the \oxShopList::loadSubShopList() could be used.

Question: Are there any specific shop functionalities affected due to this method?

choeft

2017-02-14 16:33

reporter   ~0011977

Thank you for your quick feedback.

The function name suggested, that if I create an object of e.g. Shop A and then call a function by the name "getSubShopList", I would get only the assigned subshops of Shop A. Hence, if I call it on Shop C, I would get an empty list.

As I wrote, we already found a workaround. So if this is the intended behaviour, ok; we just found it confusing.

QA

2017-02-14 16:50

administrator   ~0011978

Thanks for the reply. Closing the issue.