forked from MrKrumax/opencart-linkedoptions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.xml
78 lines (75 loc) · 3.32 KB
/
install.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<name>Linked Options</name>
<code>Linked Options</code>
<version>0.0.4</version>
<link>https://github.com/intosKai/opencart-linkedoptions</link>
<author>Petr Ivanov (info@ioqu.pro)</author>
<file path="catalog/controller/product/product.php">
<operation error="skip">
<search><![CDATA[$this->load->model('tool/image');]]></search>
<add position="before"><![CDATA[
$this->document->addStyle('catalog/view/theme/default/stylesheet/custom_option.css');
$this->load->model('catalog/customoptions');
$custom_options = $this->model_catalog_customoptions->getCustomOption($this->request->get['product_id']);
foreach ($custom_options as &$option) {
foreach ($option['values'] as &$value) {
$value['href'] = $this->url->link('product/product', 'product_id=' . $value['product_id']);
$value['class'] = ($this->request->get['product_id'] == $value['product_id']) ? 'active' : '';
}
}
$data['custom_options'] = $custom_options;
]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/product/product.tpl">
<operation error="skip">
<search><![CDATA[<h1><?php echo $heading_title; ?></h1>]]></search>
<add position="after"><![CDATA[
<?php if ($custom_options) { ?>
<?php foreach ($custom_options as $option) { ?>
<h2 class="custom_option_header"><?php echo $option['name']?></h2>
<div class="custom_options">
<?php foreach ($option['values'] as $value) { ?>
<div class="custom_option">
<a href="<?php echo $value['href']; ?>" class="<?php echo $value['class']; ?>">
<?php if ($option['type'] == 1) { ?>
<div class="color_block" style="background:<?php echo $value['value'] ?>"></div>
<?php } else { ?>
<?php echo $value['value']; ?>
<?php } ?>
</a>
</div>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
]]></add>
</operation>
</file>
<file path="catalog/view/theme/netstore/template/product/product.tpl">
<operation error="skip">
<search><![CDATA[<?php if ($price) { ?>]]></search>
<add position="before"><![CDATA[
<?php if ($custom_options) { ?>
<?php foreach ($custom_options as $option) { ?>
<h2 class="custom_option_header"><?php echo $option['name']?></h2>
<div class="custom_options">
<?php foreach ($option['values'] as $value) { ?>
<div class="custom_option">
<a href="<?php echo $value['href']; ?>" class="<?php echo $value['class']; ?>">
<?php if ($option['type'] == 1) { ?>
<div class="color_block" style="background:<?php echo $value['value'] ?>"></div>
<?php } else { ?>
<?php echo $value['value']; ?>
<?php } ?>
</a>
</div>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
]]></add>
</operation>
</file>
</modification>