magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Cart SubTotal Error

Open rudik99 opened this issue 10 years ago • 27 comments

When Display Sub-total = Including Tax per the below

screen shot 2016-01-24 at 10 01 34 pm

The mini-cart sub-total is not show:

screen shot 2016-01-24 at 10 03 22 pm

Error shown in the console:

ReferenceError: Unable to process binding "if: function (){return displaySubtotal() }" Message: Unable to process binding "if: function (){return !display_cart_subtotal_excl_tax && display_subtotal_incl_tax }" Message: Can't find variable: display_subtotal_icl_tax

I believe this is a bug. Same symptom on 2.0.1 & 2.0.0 / clean/fresh installs

rudik99 avatar Jan 24 '16 11:01 rudik99

@rkhoury82 Thank you for reporting this issue. Currently we were unable to reproduce it with the provided information. Could you please provide more detailed steps to reproduce, e. g. settings you have changed, product type you are using? Thanks.

ishakhsuvarov avatar Jan 25 '16 10:01 ishakhsuvarov

Hi @ishakhsuvarov thanks for looking ! I have attached the other tax settings. In Australia all prices must be displayed with taxes, hence why I have everything displayed with tax including.

This was a clean install, i just changed these tax settings attached and created 1 configurable product with some variations.

screen shot 2016-01-25 at 9 38 02 pm screen shot 2016-01-25 at 9 38 09 pm screen shot 2016-01-25 at 9 38 16 pm

screen shot 2016-01-25 at 9 45 57 pm screen shot 2016-01-25 at 9 46 11 pm

I can always dump the database and send across if that helps?

rudik99 avatar Jan 25 '16 10:01 rudik99

I can confirm with a js error

Uncaught ReferenceError: Unable to process binding "if: function (){return displaySubtotal() }" Message: Unable to process binding "if: function (){return !display_cart_subtotal_excl_tax && display_subtotal_incl_tax }" Message: display_subtotal_incl_tax is not defined

quienti avatar Jan 25 '16 17:01 quienti

Another problem with include tax when I'm in checkout

weee.extend.getRowWeeeTaxInclTax @ row_incl_tax.js:35weee.extend.getRowDisplayPriceInclTax @ row_incl_tax.js:29$element.text @ VM15638:3ko.bindingHandlers.text.update @ knockout.js:4260ko.dependentObservable.disposeWhenNodeIsRemoved @ knockout.js:3004evaluateImmediate @ knockout.js:1737ko.computed.ko.dependentObservable @ knockout.js:1946(anonymous function) @ knockout.js:3002ko.utils.arrayForEach @ knockout.js:151applyBindingsToNodeInternal @ knockout.js:2974applyBindingsToNodeAndDescendantsInternal @ knockout.js:2854applyBindingsToDescendantsInternal @ knockout.js:2836applyBindingsToNodeAndDescendantsInternal @ knockout.js:2863applyBindingsToDescendantsInternal @ knockout.js:2836ko.applyBindingsToDescendants @ knockout.js:3052ko.computed.disposeWhenNodeIsRemoved @ knockout.js:4004evaluateImmediate @ knockout.js:1737ko.computed.ko.dependentObservable @ knockout.js:1946ko.bindingHandlers.(anonymous function).init @ knockout.js:3988(anonymous function) @ knockout.js:2989ko.computedContext.ko.dependencyDetection.ignore @ knockout.js:1249(anonymous function) @ knockout.js:2988ko.utils.arrayForEach @ knockout.js:151applyBindingsToNodeInternal @ knockout.js:2974applyBindingsToNodeAndDescendantsInternal @ knockout.js:2854ko.applyBindings @ knockout.js:3065_super @ wrapper.js:73wrapper.extend.applyBindings @ bound-nodes.js:95(anonymous function) @ wrapper.js:78(anonymous function) @ knockout.js:4862invokeForEachNodeInContinuousRange @ knockout.js:4813activateBindingsOnContinuousNodeArray @ knockout.js:4860executeTemplate @ knockout.js:4908ko.dependentObservable.disposeWhen @ knockout.js:4950evaluateImmediate @ knockout.js:1737evaluatePossiblyAsync @ knockout.js:1677ko_subscribable_fn.notifySubscribers @ knockout.js:1103observable.valueHasMutated @ knockout.js:1300observable @ knockout.js:1285(anonymous function) @ engine.js:53fire @ jquery.js:3099self.fireWith @ jquery.js:3211deferred.(anonymous function) @ jquery.js:3301fire @ jquery.js:3099self.fireWith @ jquery.js:3211(anonymous function) @ jquery.js:3263fire @ jquery.js:3099self.fireWith @ jquery.js:3211deferred.(anonymous function) @ jquery.js:3301(anonymous function) @ loader.js:58fire @ jquery.js:3099self.fireWith @ jquery.js:3211deferred.(anonymous function) @ jquery.js:3301(anonymous function) @ loader.js:44context.execCb @ require.js:1650Module.check @ require.js:866(anonymous function) @ require.js:1113(anonymous function) @ require.js:132(anonymous function) @ require.js:1156each @ require.js:57Module.emit @ require.js:1155Module.check @ require.js:917Module.enable @ require.js:1143Module.init @ require.js:774(anonymous function) @ require.js:991(anonymous function) @ require.js:132(anonymous function) @ text.js:149xhr.onload @ text.js:112 knockout.js:3012 Uncaught SyntaxError: Unable to process binding "foreach: function (){return $parent.elems() }" Message: Unable to process binding "template: function (){return getTemplate() }" Message: Unable to process binding "foreach: function (){return getRegion('after_details') }" Message: Unable to process binding "template: function (){return getTemplate() }" Message: Unable to process binding "if: function (){return isPriceInclTaxDisplayed() && getRegion('row_incl_tax') }" Message: Unable to process binding "foreach: function (){return getRegion('row_incl_tax') }" Message: Unable to process binding "template: function (){return getTemplate() }" Message: Unable to process binding "ifnot: function (){return (isDisplayPriceWithWeeeDetails($parents[2])) }" Message: Unable to process binding "text: function (){return getFormattedPrice(getRowDisplayPriceInclTax($parents[2])) }" Message: Unexpected token a

quienti avatar Jan 27 '16 13:01 quienti

@rkhoury82 We have created an internal ticket MAGETWO-48459 to fix the problem. Thank you for reporting

sdzhepa avatar Jan 27 '16 17:01 sdzhepa

Awesome, thanks for your help

rudik99 avatar Jan 27 '16 21:01 rudik99

I'm experiencing the same issue , any updates on this ?

cchamikara avatar Feb 08 '16 07:02 cchamikara

Workaround until fix is released: Override the vendor/magento/module-tax/view/frontend/web/template/checkout/minicart/subtotal/totals.html template and replace display_subtotal_incl_tax with display_cart_subtotal_incl_tax.

kodmaskinen avatar Feb 09 '16 09:02 kodmaskinen

Closing this ticket, as the fix seems to be delivered with the commit 5590fd. Please reopen if you have any additional questions related to this.

ishakhsuvarov avatar Apr 11 '16 08:04 ishakhsuvarov

HI I just downloaded 2.0.4 zip and despite the commit being from October, the fix is not there.

ozgeekmum avatar Apr 12 '16 00:04 ozgeekmum

I'm using 2.0.4 and I also see the problem.

Krapulat avatar Apr 12 '16 16:04 Krapulat

@ozgeekmum @Krapulat Thanks for update. Reopening the ticket for additional investigation on our side.

ishakhsuvarov avatar Apr 14 '16 09:04 ishakhsuvarov

Hei, I also have same problem, i got it work when i added back line what was removed 5590fd

return [ 'display_subtotal_incl_tax' => (int)$this->taxConfig->displayCartSubtotalInclTax(),

/Tax/CustomerData/CheckoutTotalsJsLayoutDataProvider.php

using magento 2.0.4

Think there is a bit mess cause sometimes u need 'display_subtotal_incl_tax' and sometimes 'display_cart_subtotal_incl_tax' as general they should be same value.

friizu avatar Apr 21 '16 08:04 friizu

Hello, any news about that bug? We are also using Magento 2.0.4 and get that error...:(

klarlichter avatar Apr 26 '16 09:04 klarlichter

2.0.5 is also affected.

heldchen avatar May 03 '16 12:05 heldchen

I get this error when I enable configuration Display subtotal including taxes in tax configuration ... Version: 2.0.5.

peec avatar May 13 '16 12:05 peec

I can confirm the same bug on Magento 2.0.6. Pretty much makes the cart broken since it never hides it's spinner

kanduvisla avatar May 19 '16 09:05 kanduvisla

Hello - this is still here in 2.0.7 and am unable to checkout too.

vektor-dev avatar Jun 07 '16 11:06 vektor-dev

I solved this issue thanks to friizu.

I added 'display_subtotal_incl_tax' => (int)$this->taxConfig->displayCartSubtotalInclTax() in /Tax/CustomerData/CheckoutTotalsJsLayoutDataProvider.php.

The function getTotalsConfig() on rule 61 looks like this now:

protected function getTotalsConfig() { return [ 'display_subtotal_incl_tax' => (int)$this->taxConfig->displayCartSubtotalInclTax(), 'display_cart_subtotal_incl_tax' => (int)$this->taxConfig->displayCartSubtotalInclTax(), 'display_cart_subtotal_excl_tax' => (int)$this->taxConfig->displayCartSubtotalExclTax(), ]; }

Tristan-N avatar Jun 13 '16 08:06 Tristan-N

Hi,

Same problem at Magento 2.0.7 over here. Let us know when it is finished in the core.

JamboMedia avatar Jun 13 '16 12:06 JamboMedia