Skip to content

Commit f2376e3

Browse files
author
Marten Jansen
committed
Merge branch 'develop'
2 parents f637e6a + 7452f52 commit f2376e3

7 files changed

Lines changed: 45 additions & 5 deletions

File tree

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"issues": "https://github.com/CreditClick/PriceModuleMagento2/issues"
2222
},
2323
"require": {
24-
"php": "~5.5.0|~5.6.0|~7.0.0",
25-
"magento/framework": "*"
24+
"php": "~5.5.0|~5.6.0|~7.0.0|~7.1.0",
25+
"magento/framework": "*"
2626
},
2727
"autoload": {
2828
"files": [

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="CreditClick_PriceModule" setup_version="1.0.0">
3+
<module name="CreditClick_PriceModule" setup_version="1.0.1">
44
</module>
55
</config>

view/frontend/layout/checkout_cart_index.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
>
1414
</block>
1515
</referenceContainer>
16+
<referenceContainer name="content">
17+
<block class="Magento\Framework\View\Element\Template" name="cart.ajax.qty.update" template="CreditClick_PriceModule::product/view/js.phtml" after="-"/>
18+
</referenceContainer>
1619
</body>
1720
</page>

view/frontend/templates/product/view/catalog_category.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $price = 0;
1414
<?=$custom_css;?>
1515
</style>
1616
<script type="text/javascript">
17-
require(["jquery","domReady!PriceModuleMagento2/view/frontend/templates/product/view/catalog_category"], function ($) {
17+
require(["jquery","domReady!"], function ($) {
1818

1919
$('.products.list.items.product-items').children('li').each(function( index ) {
2020
let price_module = $(this).find('.cc-price-module-catalog_category');

view/frontend/templates/product/view/catalogsearch_result.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $price = 0;
1919
<?=$custom_css;?>
2020
</style>
2121
<script type="text/javascript">
22-
require(["jquery","domReady!PriceModuleMagento2/view/frontend/templates/product/view/catalogsearch_result"], function ($) {
22+
require(["jquery","domReady!"], function ($) {
2323

2424
$('.products.list.items.product-items').children('li').each(function( index ) {
2525
let price_module = $(this).find('.cc-price-module-catalogsearch_result');
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<script>
2+
require ([
3+
'jquery',
4+
],
5+
function ($) {
6+
$(window).on("load", function () {
7+
8+
require([
9+
'CreditClick_PriceModule/js/update_price'
10+
]);
11+
});
12+
});
13+
</script>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
define([
2+
'jquery',
3+
'Magento_Checkout/js/model/totals',
4+
// 'Magento_Checkout/js/action/get-totals',
5+
// 'Magento_Checkout/js/action/get-payment-information',
6+
// 'Magento_Customer/js/customer-data'
7+
], function ($, totals) {
8+
9+
$(document).ready(function(){
10+
11+
var inputs_cart = $("form#shipping-zip-form :input, form#shipping-zip-form select, form#form-validate :input");
12+
13+
$(document).on('change, focusout', inputs_cart, function() {
14+
15+
var grandtotal = totals.totals();
16+
var cc_price = grandtotal.grand_total*100;
17+
18+
$('.cc-price-module-checkout_cart').attr('data-cc', cc_price);
19+
20+
loadCreditClick();
21+
22+
});
23+
});
24+
});

0 commit comments

Comments
 (0)