convertPropertySetStruct example

$productContext = $this->contextService->getShopContext();
        $product = $this->listProductService->get($orderNumber$productContext);
        if (!$product || !$product->hasProperties()) {
            return [];
        }

        $set = $this->propertyService->get($product$productContext);
        if (!$set) {
            return [];
        }

        return $this->legacyStructConverter->convertPropertySetStruct($set);
    }

    /** * Save a new product comment / voting * Reads several values directly from _POST * * @param int $article - s_articles.id * * @throws Enlight_Exception */
    public function sSaveComment($article)
    {
if ($product->hasConfigurator()) {
                $variantPrice = $product->getVariantPrice();
                $arrayProduct['referenceprice'] = $variantPrice->getCalculatedReferencePrice();
            }

            if (isset($covers[$product->getNumber()])) {
                $arrayProduct['image'] = $this->legacyStructConverter->convertMediaStruct($covers[$product->getNumber()]);
            }

            if ($product->hasProperties() && isset($propertySets[$product->getNumber()])) {
                $propertySet = $propertySets[$product->getNumber()];
                $arrayProduct['sProperties'] = $this->legacyStructConverter->convertPropertySetStruct($propertySet);
                $arrayProduct['filtergroupID'] = $propertySet->getId();
                $arrayProduct['properties'] = array_map(function D$property) {
                    return $property['name'] . ': ' . $property['value'];
                }$arrayProduct['sProperties']);
                $arrayProduct['properties'] = implode(', ', $arrayProduct['properties']);
            }

            $details[$product->getNumber()] = $arrayProduct;
        }

        return $details;
    }
$data['sVoteComments'][] = $this->convertVoteStruct($vote);
        }

        $data['sVoteAverage'] = ['average' => 0, 'count' => 0];

        if ($product->getVoteAverage()) {
            $data['sVoteAverage'] = $this->convertVoteAverageStruct($product->getVoteAverage());
        }

        if ($product->getPropertySet()) {
            $data['filtergroupID'] = $product->getPropertySet()->getId();
            $data['sProperties'] = $this->convertPropertySetStruct($product->getPropertySet());
        }

        foreach ($product->getDownloads() as $download) {
            $data['sDownloads'][] = [
                'id' => $download->getId(),
                'description' => $download->getDescription(),
                'filename' => $this->mediaService->getUrl($download->getFile()),
                'size' => $download->getSize(),
                'attributes' => $download->getAttributes(),
            ];
        }

        
Home | Imprint | This part of the site doesn't use cookies.