Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Added product variants warning if less than two product options

givanzc7af08358e1d
diff --git a/admin/template/product/product/variant.tpl b/admin/template/product/product/variant.tpl
index e556b50..d33e477 100644
--- a/admin/template/product/product/variant.tpl
+++ b/admin/template/product/product/variant.tpl
@@ -4,11 +4,25 @@
@product-variant|before = <?php
if(isset($this->product['product_variant']) && is_array($this->product['product_variant']))
-foreach ($this->product['product_variant'] as $product_variant_id => $variant) {
+foreach ($this->product['product_variant'] as $i => $variant) {
+ $product_variant_id = $variant['product_variant_id'];
?>
+ @product-variant|data-id = $variant['product_variant_id']
@product-variant input[data-v-variant-*]|value = $variant['@@__data-v-variant-(*)__@@']
- @product-variant [data-v-variant-*] = $variant['@@__data-v-variant-(*)__@@']
+ @product-variant input[data-v-variant-*]|name = <?php echo "product_variant[$product_variant_id][@@__data-v-variant-(*)__@@]";?>
+
+
+ @product-variant [data-v-variant-combination]|before = <?php
+ $name = 'combinations';
+ $selected = $variant['options'] ?? 1;
+ ?>
@product-variant|after = <?php
}
?>
+
+
+[data-v-option-variant-warning]|before = <?php
+ if (!isset($this->product['product_option']) || !is_array($this->product['product_option']) || (count($this->product['product_option']) < 2)) {
+?>
+[data-v-option-variant-warning]|after = <?php } ?>
\ No newline at end of file