Closed turgic closed 5 years ago
@dpfaffenbauer have you an idea please ?
That is quite odd... StoreValues only returns an array if $store is null. In your case, you pass in the whole context as param, which gives you a store. If it doesn't find an store, it throws an exception.... I have absolutely no idea why it isn't working for you. Does it work in the frontend?
@dpfaffenbauer I have the same issue on frontend when I try to open a product. Is odd because the problem appear after running command : bin/console pimcore:deployment:classes-rebuild c
@dpfaffenbauer The problem appear only for products who have variants
try to reinstall everything pls, you messed around too much to understand what really goes on here
@dpfaffenbauer I reinstalled, got the same issue
Completely new? you removed everything and started from scratch? Including Pimcore?
Only i reinstalled coreshop, but I will try right now
@dpfaffenbauer I reinstall both : pimcore and coreshop and get the same issue :(
I have no idea... can you give more context. It works for me on multiple installations...
@dpfaffenbauer
The problem appear only for variants.
So for basic product $storeValues = $subject->getStoreValues($context['store']);
the return is object
But for variants the return is an array of objects.
More information pls, what Pimcore Version?
@dpfaffenbauer "require": { "php": ">=7.1", "cocur/slugify": "^3.1", "coreshop/core-shop": "dev-master", "divante-ltd/coreshop-vsbridge": "dev-master", "gesdinet/jwt-refresh-token-bundle": "^0.5.3", "gfreeau/get-jwt-bundle": "^2.0", "nelmio/cors-bundle": "^1.5", "ongr/elasticsearch-bundle": "^5.2", "pimcore/pimcore": "~5.8.0", "symfony-bundles/json-request-bundle": "^2.0", "wikimedia/composer-merge-plugin": "^1.4" },
I confirm that on normal product works fine, but when I tried to get the price for product variant I have this issue
In the function /var/classes/DataObject/CoreShopProduct.php getStoreValues()
:
public function getStoreValues (\CoreShop\Component\Store\Model\StoreInterface $store = null) {
$this->storeValues = $this->getClass()->getFieldDefinition("storeValues")->preGetData($this);
if (is_null($store)) {
return $this->storeValues;
}
....
}
$this->storeValues
is null, have you an idea ?
Any ideas @dpfaffenbauer please ?
@dpfaffenbauer are you here ?
I am, but I am also busy with other stuff.
I will look at your issue, but not straight away, this is open-source work, I do it for free, so please don't except immediate support for problems you have with free software!
@dpfaffenbauer I found a possible error :
in /var/classes/DataObject/CoreShopProduct
function getStoreValues()
, here :
try {
return $this->getValueFromParent("storeValues");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
Have you a date when is supposed to be merged ? And in which coreshop version ? Thx @dpfaffenbauer
later today or tomorrow morning. it is in master branch, so 2.1-dev
Thank you @dpfaffenbauer
@turgic it is merged!
Thank you @dpfaffenbauer
Hello guys, I tried to get the price for a product with specific rules, I do :
But I get the error :
From what I debug the error comes from
/vendor/coreshop/core-sho/src/CoreShop/Component/Core/Product/Calculator/StoreProductPriceCalculator.php
:$storeValues is an array. Have you an idea ?