Skip to content

Commit afd34dc

Browse files
committed
Merge pull request #6 from Mertiozys/price-calculation
Price calculation
2 parents 5fab19d + 488829a commit afd34dc

File tree

81 files changed

+13345
-532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+13345
-532
lines changed

AdminIncludes/module-config-js.html

-31
This file was deleted.

AdminIncludes/module_configuration.html

-163
This file was deleted.

Config/config.xml

+80-23
Original file line numberDiff line numberDiff line change
@@ -7,65 +7,122 @@
77
<loops>
88
<loop name="customer_family" class="CustomerFamily\Loop\CustomerFamilyLoop" />
99
<loop name="customer_customer_family" class="CustomerFamily\Loop\CustomerCustomerFamilyLoop" />
10+
<loop name="customer_family_price" class="CustomerFamily\Loop\CustomerFamilyPriceLoop" />
11+
<loop name="product_purchase_price" class="CustomerFamily\Loop\ProductPurchasePriceLoop" />
12+
<loop name="customer_family_pse_calculated_prices" class="CustomerFamily\Loop\CustomerFamilyProductPriceLoop" />
1013
</loops>
1114

1215
<forms>
1316
<form name="customer.family.create.form" class="CustomerFamily\Form\CustomerFamilyCreateForm" />
1417
<form name="customer.family.update.form" class="CustomerFamily\Form\CustomerFamilyUpdateForm" />
18+
<form name="customer_family_update_default_form" class="CustomerFamily\Form\CustomerFamilyUpdateDefaultForm" />
1519
<form name="customer.family.delete.form" class="CustomerFamily\Form\CustomerFamilyDeleteForm" />
1620

1721
<form name="customer.customer.family.form" class="CustomerFamily\Form\CustomerCustomerFamilyForm" />
18-
</forms>
1922

20-
<commands>
21-
<!--
22-
<command class="MyModule\Command\MySuperCommand" />
23-
-->
24-
</commands>
23+
<form name="customer_family_price_update" class="CustomerFamily\Form\CustomerFamilyPriceForm" />
24+
</forms>
2525

2626
<services>
27-
<service id="customer.family.action" class="CustomerFamily\EventListeners\CustomerFamilyListener" scope="request">
27+
<!-- Service class -->
28+
<service id="customer.family.service" class="CustomerFamily\Service\CustomerFamilyService">
29+
<argument type="service" id="thelia.securityContext"/>
30+
<argument type="service" id="thelia.taxEngine"/>
31+
</service>
32+
33+
<!-- Main listener -->
34+
<service id="customer.family.action" class="CustomerFamily\EventListeners\CustomerFamilyListener">
2835
<argument type="service" id="request" />
2936
<argument type="service" id="thelia.parser" />
3037
<argument type="service" id="mailer"/>
3138
<tag name="kernel.event_subscriber"/>
3239
</service>
3340

3441
<!-- Listening to create and update customer form actions -->
35-
<service id="customer.family.form.action" class="CustomerFamily\EventListeners\CustomerFamilyFormListener" scope="request">
42+
<service id="customer.family.form.action" class="CustomerFamily\EventListeners\CustomerFamilyFormListener">
3643
<argument type="service" id="request" />
3744
<tag name="kernel.event_subscriber"/>
3845
</service>
46+
47+
<!-- Listening produt price edition -->
48+
<service id="customer.family.product.purchase.price" class="CustomerFamily\EventListeners\PseExtendPriceFormListener">
49+
<tag name="kernel.event_subscriber"/>
50+
</service>
51+
52+
<!-- Listening PSE price edition -->
53+
<service id="customer.family.pse.purchase.price" class="CustomerFamily\EventListeners\ProductExtendPriceFormListener">
54+
<tag name="kernel.event_subscriber"/>
55+
</service>
56+
57+
<!-- Listening product loop creation -->
58+
<service id="customer.family.price" class="CustomerFamily\EventListeners\CustomerFamilyPriceListener">
59+
<argument type="service" id="thelia.securityContext"/>
60+
<argument type="service" id="thelia.taxEngine"/>
61+
<argument type="service" id="customer.family.service"/>
62+
<tag name="kernel.event_subscriber"/>
63+
</service>
64+
65+
<!-- Listening cart product adding & loop creation -->
66+
<service id="customer.family.cart" class="CustomerFamily\EventListeners\CustomerFamilyCartListener">
67+
<argument type="service" id="customer.family.service"/>
68+
<tag name="kernel.event_subscriber"/>
69+
</service>
70+
71+
<!-- Listening order creation -->
72+
<service id="customer.family.order" class="CustomerFamily\EventListeners\CustomerFamilyOrderListener">
73+
<argument type="service" id="customer.family.service"/>
74+
<tag name="kernel.event_subscriber"/>
75+
</service>
76+
77+
<!-- Listening customer login / logout tu update cart items prices -->
78+
<service id="customer.family.customer.connection" class="CustomerFamily\EventListeners\CustomerFamilyCustomerConnectionListener">
79+
<argument type="service" id="request" />
80+
<argument type="service" id="customer.family.service"/>
81+
<tag name="kernel.event_subscriber"/>
82+
</service>
3983
</services>
4084

4185
<hooks>
86+
<!-- Global hook class -->
87+
<hook id="customer.family.hook" class="CustomerFamily\Hook\CustomerFamilyHook">
88+
<tag name="hook.event_listener" event="main.head-css" type="back" method="onAddCss"/>
89+
</hook>
90+
91+
<!-- Admin configuration templates -->
92+
<hook id="customer.family.config">
93+
<tag name="hook.event_listener" event="module.configuration" type="back" templates="render:module_configuration.html" />
94+
<tag name="hook.event_listener" event="module.config-js" type="back" templates="render:assets/js/module-config-js.html" />
95+
</hook>
96+
97+
<!-- Admin customer edit -->
98+
<hook id="customer.family.customer.edit">
99+
<tag name="hook.event_listener" event="customer.edit" type="back" templates="render:customer-edit.html" />
100+
</hook>
101+
102+
<!-- Admin product edit purchase price -->
103+
<hook id="customer.family.product.price.edit" class="CustomerFamily\Hook\CustomerFamilyProductPriceHook">
104+
<tag name="hook.event_listener" event="product.combinations-row" type="back" method="onPsePriceEdit" />
105+
<tag name="hook.event_listener" event="product.details-pricing-form" type="back" templates="render:product-details-pricing.html" />
106+
<tag name="hook.event_listener" event="product.details-promotion-form" type="back" templates="render:product-details-promo.html" />
107+
<tag name="hook.event_listener" event="product.edit-js" type="back" templates="render:assets/js/product-edit-js.html" />
108+
</hook>
109+
42110
<!-- Additional fields for the register form -->
43-
<hook id="customer.family.register.form" class="CustomerFamily\Hook\CustomerFamilyRegisterFormHook" scope="request">
111+
<hook id="customer.family.register.form" class="CustomerFamily\Hook\CustomerFamilyRegisterFormHook">
44112
<tag name="hook.event_listener" event="register.form-bottom" type="front" method="onRegisterFormBottom"/>
45113
<tag name="hook.event_listener" event="register.after-javascript-include" type="front" method="onRegisterAfterJSInclude"/>
46114
</hook>
47115

48-
<!-- Showing customer family informations -->
49-
<hook id="customer.family.account.display" class="CustomerFamily\Hook\CustomerFamilyAccountDisplayHook" scope="request">
116+
<!-- Showing customer family information -->
117+
<hook id="customer.family.account.display" class="CustomerFamily\Hook\CustomerFamilyAccountDisplayHook">
50118
<tag name="hook.event_listener" event="account.additional" type="front" method="onAccountAdditional"/>
51119
</hook>
52120

53121
<!-- Additional fields for the account update form -->
54-
<hook id="customer.family.update.form" class="CustomerFamily\Hook\CustomerFamilyUpdateFormHook" scope="request">
122+
<hook id="customer.family.update.form" class="CustomerFamily\Hook\CustomerFamilyUpdateFormHook">
55123
<tag name="hook.event_listener" event="account-update.form-bottom" type="front" method="onAccountUpdateFormBottom"/>
56124
<tag name="hook.event_listener" event="account-update.after-javascript-include" type="front" method="onAccountUpdateAfterJSInclude"/>
57125
</hook>
58126
</hooks>
59127

60-
<!--
61-
<exports>
62-
63-
</exports>
64-
-->
65-
66-
<!--
67-
<imports>
68-
69-
</imports>
70-
-->
71128
</config>

0 commit comments

Comments
 (0)