Skip to content

Commit

Permalink
Merge branch 'trunk' into develop-pwa-studio-5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Nguyen committed Jul 9, 2020
2 parents fcddd0f + cf3bb52 commit a4a0172
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
8 changes: 5 additions & 3 deletions app/code/Simi/Simiconnector/Helper/Options/Configurable.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ public function getOptions($product)
is_array($option_data['products']) &&
count($option_data['products']) != 0
) {
$isColorValueTypeText = $this->simiObjectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')
->getValue('siminiaconfig/color_options/is_color_type_text');
if($attribute_details['code'] === 'color') {
$option_data['option_value'] = $this->getValueSwatch($option_data['id']);
$option_data['pwa_use_type_text'] = $isColorValueTypeText;
}
if (isset($option_data['option_value']) && $option_data['option_value'])
$updatedOptions[] = $option_data;
$updatedOptions[] = $option_data;
}
}
$attribute_details['options'] = $updatedOptions;
Expand Down Expand Up @@ -76,4 +78,4 @@ private function getValueSwatch($id) {
}
return $value[$id]['value'];
}
}
}
10 changes: 9 additions & 1 deletion app/code/Simi/Simiconnector/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,14 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
<group id="color_options" translate="label" type="text" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Color type swatch or text ?</label>
<field id="is_color_type_text" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Show color option type text on Configurable Product ?</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Default type is color swatch.</comment>
</field>
</group>
</section>
</system>
</config>
</config>
5 changes: 4 additions & 1 deletion app/code/Simi/Simiconnector/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@
<ft_title2>Simicart</ft_title2>
<ft_link>https://www.simicart.com/pwa.html/</ft_link>
</footer_link>
<color_options>
<is_color_type_text>0</is_color_type_text>
</color_options>
</siminiaconfig>
</default>
</config>
</config>

0 comments on commit a4a0172

Please sign in to comment.