Skip to content

Commit c4e26c0

Browse files
authored
Merge pull request #295 from fusionspim/21090-move-character-limit-into-package
21090 move character limit into package
2 parents e649499 + 234cef8 commit c4e26c0

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/Writer/Entity/Variant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function __construct(public string $id)
1515

1616
public function addDisplayValue(string $value, string $displayValue): void
1717
{
18-
$this->displayValues[$value] = $displayValue;
18+
$this->displayValues[$value] = mb_substr($displayValue, 0, 256);
1919
}
2020

2121
public function write(XmlWriter $writer): void

tests/Writer/VariantsTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ class VariantsTest extends TestCase
1414
public function test_variants_xml(): void
1515
{
1616
$variants = [
17-
'colour' => ['red' => 'Red', 'blue' => 'Blue'],
18-
'height' => ['H1' => 'Grande', 'H2' => 'Tall'],
17+
'colour' => ['red' => 'Red', 'blue' => 'Blue'],
18+
'height' => ['H1' => 'Grande', 'H2' => 'Tall'],
19+
'description' => ['body' => 'Experience the UltraComfort Memory Foam Pillow, designed to support your neck and head with premium memory foam for ultimate comfort. The breathable, hypoallergenic cover keeps you cool all night. Perfect for any sleeping position, it promotes restful, refreshing sleep.'],
1920
];
2021

2122
$xml = new XmlWriter;

tests/fixtures/variants.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,11 @@
2020
</variation-attribute-value>
2121
</variation-attribute-values>
2222
</variation-attribute>
23+
<variation-attribute attribute-id="description" variation-attribute-id="description">
24+
<variation-attribute-values>
25+
<variation-attribute-value value="body">
26+
<display-value xml:lang="x-default">Experience the UltraComfort Memory Foam Pillow, designed to support your neck and head with premium memory foam for ultimate comfort. The breathable, hypoallergenic cover keeps you cool all night. Perfect for any sleeping position, it promotes restful, ref</display-value>
27+
</variation-attribute-value>
28+
</variation-attribute-values>
29+
</variation-attribute>
2330
</catalog>

0 commit comments

Comments
 (0)