0

I have a Magento 2.1.5 store, language settings English (United States) for admin and I want to mass update price attribute of a couple of products. I select the products and choose "update attributes".

In "attributes" I scroll to "Price", select change and enter 49.95 (euros). I press save and the strangest thing happens:

My prices for the selected products is changed to 100,00,00.00 euros!

enter image description here

I've searched the forums and the github magento2 issues but can't find which issue this is. I did find a youtube that seems to be related.

So I'm not the only one running into this. Does anyone have a solution or know which issue this is on github magento2 issues?

I really need to get this solved, I can't have my customer mass update his simples and then find out all his simples are now over 100,000,000.00 euros...

Anyone who can point me in the right direction?

1

To answer my own question, I found out that this was due to an error in an extension I had installed together with the fact that I could not see what I was entering.

As for both Price and Special Price there is this "[Inc. Tax]" bit right over the input field which makes it very hard to see what you enter. I have fixed both problems now.

For anyone curious on how to move the "[Inc. Tax]" bit from the input field (in mass attribute update), in your extension extend \Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Price.php and change this:

public function getAfterElementHtml()
{..
if ($attribute->getAttributeCode() !== 'cost') {
     $addJsObserver = true;
     $html .= ' <strong>[' . __(
     'Inc. Tax'
     ) . '<span id="dynamic-tax-' . $attribute->getAttributeCode() . '"></span>]</strong>';
  }

to this:

public function getAfterElementHtml()
{..
if ($attribute->getAttributeCode() !== 'cost') {
     $addJsObserver = true;
     $html .= '<span data-bind="text: addbefore"> <strong>[' . __(
     'Inc. Tax'
   ) . '<span id="dynamic-tax-' . $attribute->getAttributeCode() . '"></span>]      </strong> </span>';

And now the price shows like this:

enter image description here

This still didn't work the way I liked :-(

So now I changed it to this:

public function getAfterElementHtml()
{..
if ($attribute->getAttributeCode() !== 'cost') {
     $addJsObserver = true;
     $html .= '<div class="hidden"> <strong>[' . __(
     'Inc. Tax'
   ) . '<span id="dynamic-tax-' . $attribute->getAttributeCode() . '"></span>]      </strong> </div>';

It will not show the [Incl. Tax] anymore and it works.

0

Perhaps a bit late, but it may help other users about the including tax issue:

The issue is fixed in developer branch 2.2.0

https://github.com/magento/magento2/issues/6867

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.