Prestashop: Price section on a product sheet does not save the changes - Cost price & unit price

Created on 11 Nov 2019  ·  43Comments  ·  Source: PrestaShop/PrestaShop

Describe the bug
Price in product sheet do not stay like I wrote them.

Edit

Steps to reproduce the issue:

  1. Create 3 suppliers
  2. Create a product with
    2.1 Price = 12 tax included / =10 tax excluded
    2.2 Tax =20%
    2.3 Price per unit= 10 /ml
    2.4 Cost price = 10
    2.5 In the Options Tab, select one supplier as a default.
    2.6 Price (tax excl.) for the supplier = 10
  3. Enable product & Save
  4. Go to the Catalog page
  5. Edit the product
  6. change the Price (tax excl.) for the supplier = 8
  7. Click on the Go to catalog page
  8. Check this product again & check the Price per unit, it is 0 & the cost price became 8.
  9. if you try to change the cost price & save => green alert is displayed => but it is always saved as 8.

Price unit issue: https://drive.google.com/file/d/1mfzCbJhyqcrzLyD00ggF6OhWyNio8ios/view
Cost price issue: https://drive.google.com/file/d/1Gt9uAlYgAgeKI4WMneCyUB5jJBvJA7ij/view
To Reproduce
Steps to reproduce the behavior:

  1. Go to Catalogue -> Produits
  2. Click on a product created and go to "Prix" section
  3. Write a price in "Prix unitaire (HT)" and in "Prix d'achat"
  4. Click on "Options" section
  5. Click on a supplier and write a price at the bottom of the page in "Montant (HT)"
  6. Save and then come back to the product sheet; in "Prix" section, "Prix unitaire (HT)" is now 0.000 and "Prix d'achat" is the same as the supplier one ("Montant (HT)") in "Options" section.

Screenshots
Step 3
Step 5
Step 6

Additional information
PrestaShop version: 1.7.6.1
PHP version: 7.0.33

1.7.6.0 1.7.6.1 BO Bug Fixed Major Products Regression Suppliers Taxes and Prices

Most helpful comment

@khouloudbelguith

Not good... I hope this bug will be solved asap.

Thanks for the support!

All 43 comments

Hi @nicoladze,

I did not manage to reproduce the issue with PS1.7.6.1.
I attached a screen record
https://drive.google.com/file/d/1MBtGdSLmUrdxAT4U_EUGQrz4cf87fS7I/view
Thanks to check & feedback.

Hi @khouloudbelguith

I have tried on another product sheet and there is no problem; it seems that it is a mater of this pecular sheet...

@nicoladze, Could you please provide us with more info? We need more details to understand how we can reproduce your issue:

  • server setup and configuration
  • PrestaShop version (source)
  • debug mode report
  • PHP error logs
  • apache error log
  • javascript console log

Don't you know how to get this information? Please read the following article:
http://build.prestashop.com/howtos/misc/how-to-create-bug-report/

Thanks!

@khouloudbelguith

I do not know how to provide you with all you have asked (and your link http://build.prestashop.com/howtos/misc/how-to-create-bug-report/ is not helping)

And I have another issue, that is part of this opened issue, in "Options" section of the product sheet, when I fulfill "Montant (HT)" of the supplier part with "519.80", it changes automatically to "519.799999"

Regards

@nicoladze,

And I have another issue, that is part of this opened issue, in "Options" section of the product sheet, when I fulfill "Montant (HT)" of the supplier part with "519.80", it changes automatically to "519.799999"

We are aware of this issue, it is added to our bug roadmap as reported in this ticket: https://github.com/PrestaShop/PrestaShop/issues/12078

I do not know how to provide you with all you have asked

  • _server setup and configuration_ : Go to BO => Advanced Parameters => Information page & Get your configuration
  • _PrestaShop version (source)_: the exact version PrestaShop are you using?
  • _debug mode report_: Got to Advanced Parameters > Performance, In the Debug Mode section,, set “Debug Mode” to “Yes” & Click the “Save” button.
  • _PHP error logs_: if you are using Apache: you can find it in the path Project_Folder/var/log/apache/php_error.log

  • _javascript console log_: if you are using the browser Firefox or Chrome: press Ctrl+Shit+J or Cmd+Shift+J.

Thanks!

@khouloudbelguith

  • Server :

Informations sur votre serveur Linux #1 SMP Wed May 15 10:40:34 CEST 2019 x86_64
Version du logiciel serveur : Apache
Version de PHP : 7.0.33
Limite de mémoire : 512M
Temps maximal d'exécution : 300
Taille max. pour envoi de fichiers : 128M

  • Prestashop :

Version de PrestaShop : 1.7.6.1

  • debug mode is activated but I do not know how to get a report

  • javascript console log :

GET https://filler-france.com/admin7417/themes/new-theme/public/index.php?controller=AdminOrders&token=7b1fdf2f12e506ed7b4f71e565385836 net::ERR_ABORTED 404

Regards

@nicoladze, We need to retrieve the PHP error log and the debug mode report in order to find out what's wrong.

You need to enable debug mode in your store and debug request which is sent for product save in your browser, using DevTools, so:

  1. enable debug mode
  2. go to the product page
  3. open up developer tools
  4. go to Network tab
  5. save product => check if there are any exceptions displayed
  6. wait for an error, you should see red request information in Network tab
  7. click on it, you should see the error message in "Response" or "Preview" tab

The PHP error log file, you can find it in this path: Project_Folder/var/log/apache/php_error.log

Thanks!

@khouloudbelguith

I will try to provide you with the PHP error log later (Now, I do not have my IDs to FileZilla)

About the developer tools -> Network

There is no exception and/or error while or once I save the product

Regards

@khouloudbelguith

PS : I had no problem while I was on Prestashop 1.7.2.4, it appears once I updated to 1.7.6.1

@nicoladze,

I will try to provide you with the PHP error log later (Now, I do not have my IDs to FileZilla)

Thanks!, waiting for your feedback.

@khouloudbelguith

Log from debug mode :

DEPRECATIONS :

User Deprecated: Tools::displayPrice() is deprecated since version 1.7.6.0. Use PrestaShop\PrestaShop\Core\Localization\Locale::formatPrice() instead.

Hide context    Hide trace

[▼
  "exception" => ErrorException {#617 ▼
    #message: "User Deprecated: Tools::displayPrice() is deprecated since version 1.7.6.0. Use PrestaShop\PrestaShop\Core\Localization\Locale::formatPrice() instead."
    #code: 0
    #file: "/home/fillerfrzg/www/classes/Tools.php"
    #line: 759
    #severity: E_USER_DEPRECATED
    trace: {▼
      /home/fillerfrzg/www/classes/Tools.php:759 {▼
        ›     . 'Use ' . Locale::class . '::formatPrice() instead.',
        ›     E_USER_DEPRECATED
        › );
      }
      /home/fillerfrzg/www/src/Adapter/Product/AdminProductDataProvider.php:388 {▼
        › if ($formatCldr) {
        ›     $product['price'] = Tools::displayPrice($product['price'], $currency);
        ›     $product['price_final'] = Tools::displayPrice($product['price_final'], $currency);
      }
      /home/fillerfrzg/www/src/PrestaShopBundle/Controller/Admin/ProductController.php:154 {▼
        ›     $sortOrder,
        ›     $request->request->all()
        › );
      }
      /home/fillerfrzg/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151 {▼
        › // call controller
        › $response = \call_user_func_array($controller, $arguments);
        › 
      }
      /home/fillerfrzg/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68 {▼
        › try {
        ›     return $this->handleRaw($request, $type);
        › } catch (\Exception $e) {
      }
      /home/fillerfrzg/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200 {▼
        › try {
        ›     return $this->getHttpKernel()->handle($request, $type, $catch);
        › } finally {
      }
      /home/fillerfrzg/www/admin7417/index.php:86 {▼
        › require_once __DIR__.'/../autoload.php';
        › $response = $kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, false);
        › $response->send();
      }
    }
  }
]
{▼
  /home/fillerfrzg/www/classes/Tools.php:759 {▼
    ›     . 'Use ' . Locale::class . '::formatPrice() instead.',
    ›     E_USER_DEPRECATED
    › );
  }
  /home/fillerfrzg/www/src/Adapter/Product/AdminProductDataProvider.php:388 {▼
    › if ($formatCldr) {
    ›     $product['price'] = Tools::displayPrice($product['price'], $currency);
    ›     $product['price_final'] = Tools::displayPrice($product['price_final'], $currency);
  }
  /home/fillerfrzg/www/src/PrestaShopBundle/Controller/Admin/ProductController.php:154 {▼
    ›     $sortOrder,
    ›     $request->request->all()
    › );
  }
  /home/fillerfrzg/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151 {▼
    › // call controller
    › $response = \call_user_func_array($controller, $arguments);
    › 
  }
  /home/fillerfrzg/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68 {▼
    › try {
    ›     return $this->handleRaw($request, $type);
    › } catch (\Exception $e) {
  }
  /home/fillerfrzg/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200 {▼
    › try {
    ›     return $this->getHttpKernel()->handle($request, $type, $catch);
    › } finally {
  }
  /home/fillerfrzg/www/admin7417/index.php:86 {▼
    › require_once __DIR__.'/../autoload.php';
    › $response = $kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, false);
    › $response->send();
  }
}

----------------------------------------

Enabling the "sensio_framework_extra.router.annotations" configuration is deprecated since version 5.2. Set it to false and use the "Symfony\Component\Routing\Annotation\Route" annotation from Symfony itself.

Hide context    Hide trace

[▼
  "exception" => SilencedErrorContext {#6842 ▼
    +count: 1
    -severity: E_USER_DEPRECATED
    trace: {▼
      /home/fillerfrzg/www/vendor/sensio/framework-extra-bundle/DependencyInjection/SensioFrameworkExtraExtension.php:41 {▼
        › if ($config['router']['annotations']) {
        ›     @trigger_error(sprintf('Enabling the "sensio_framework_extra.router.annotations" configuration is deprecated since version 5.2. Set it to false and use the "%s" annotation from Symfony itself.', \Symfony\Component\Routing\Annotation\Route::class), E_USER_DEPRECATED);
        › 
      }
      /home/fillerfrzg/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:71 {▼
        › 
        ›     $extension->load($config, $tmpContainer);
        › } catch (\Exception $e) {
      }
    }
  }
]
{▼
  /home/fillerfrzg/www/vendor/sensio/framework-extra-bundle/DependencyInjection/SensioFrameworkExtraExtension.php:41 {▼
    › if ($config['router']['annotations']) {
    ›     @trigger_error(sprintf('Enabling the "sensio_framework_extra.router.annotations" configuration is deprecated since version 5.2. Set it to false and use the "%s" annotation from Symfony itself.', \Symfony\Component\Routing\Annotation\Route::class), E_USER_DEPRECATED);
    › 
  }
  /home/fillerfrzg/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:71 {▼
    › 
    ›     $extension->load($config, $tmpContainer);
    › } catch (\Exception $e) {
  }
}

@nicoladze, did you find only some deprecations?
image

Have you any Errors?

Thanks!

@khouloudbelguith

No Errors, only Info

Log


Matched route "admin_product_catalog".

Hide context

[▼
  "route" => "admin_product_catalog"
  "route_parameters" => [▼
    "_controller" => "PrestaShopBundle\Controller\Admin\ProductController::catalogAction"
    "_legacy_controller" => "AdminProducts"
    "limit" => "last"
    "offset" => 0
    "orderBy" => "last"
    "sortOrder" => "last"
    "_route" => "admin_product_catalog"
  ]
  "request_uri" => "https://filler-france.com/admin7417/index.php/sell/catalog/products?_token=1_imqFUIngvpDxqOc553l-6_jc54HpzJ5ROTmPaTRu8"
  "method" => "GET"
]

@nicoladze, previously we just reported those issues similar to your problem:

  1. https://github.com/PrestaShop/PrestaShop/issues/10792
  2. https://github.com/PrestaShop/PrestaShop/issues/15785

Thanks to check & feedback.

@khouloudbelguith

Yes, it seems to come from the same problem.

I tried to change things step by step and I found that there were no error if there were no default supplier selected and that the problem was already reported here : #15724

I also tried with a product sheet with a supplier by default but whith no problem because finished when I was on PS 1.7.2.4.
I opened it, there were no problem with it; I just clicked on "Go to catalog" and the problem appears -> unit price was replaced by 0, the unity is still written; and the purchasing price was replaced by the amount from the supplier on "Options" section.

Hi @nicoladze,

Your ticket is a duplicate of #15724
So, I close it.
Thanks!

Duplicate of #15724

There is a another error than the one stipulated here.
The purchasing price on "Price" part is also set to the supplier price fulfilled in "Options" part when a default supplier is selected.

@nicoladze, this issue occurs only when you have a product assigned to a supplier?

Thanks!

@khouloudbelguith

Yes, it does when a supplier by default is selected.

When we select one more supplier and put it by default then we deselect it;
so there is one supplier selected and no supplier by default; the error
disappears.

But this a not a long term solution if I want to put a default supplier.

@nicoladze, it is ok in my case.
I attached a screen record
https://drive.google.com/file/d/1z7JliPLyZ-xHGuB066a8NDNM-mfMj4f2/view
Thanks to check & feedback.

@khouloudbelguith

To get the error, you have to have more than one supplier listed but you have to select only one supplier and to put it by default also.

@nicoladze, Thanks for your feedback.
I attached a new screen record
https://drive.google.com/file/d/1Kq0Q6XSFsxpHxHgqLd_dtv0bLGAmQjT-/view
Thanks to check & feedback.

@khouloudbelguith

I just checked and I do not have the error when I create a new product sheet.
I only have the error when I change things on a previous product sheet (created with a previous version of PS) or when I use the "duplicate" option on a previous one.

@khouloudbelguith

It has worked one time but then I came back on my new product sheet and when I clicked on "Go to catalog" and came back to the sheet, the error was there again...

@nicoladze, what is the exact previous version did you use?
Did you make an upgrade using the 1-click upgrade module?

Thanks!

@khouloudbelguith

I was on PS 1.7.2.4 and I did the upgrade with the 1-click upgrade module

Hi @nicoladze,

I manage to reproduce the issue with PS1.7.6.1 & ps1.7.6.2build1.
Steps to reproduce the issue:

  1. Create 3 suppliers
  2. Create a product with
    2.1 Price = 12 tax included / =10 tax excluded
    2.2 Tax =20%
    2.3 Price per unit= 10 /ml
    2.4 Cost price = 10
    2.5 In the Options Tab, select one supplier as a default.
    2.6 Price (tax excl.) for the supplier = 10
  3. Enable product & Save
  4. Go to the Catalog page
  5. Edit the product
  6. Click on the Go to catalog page
  7. Check this product again & check the Price per unit

https://drive.google.com/file/d/1mfzCbJhyqcrzLyD00ggF6OhWyNio8ios/view

It is OK with ps1.7.5.0 & ps1.7.5.2.
PS1.7.5.0: https://drive.google.com/file/d/1D63BPnI7zwQF4QAWzcGPmbCPUxQREnA_/view
PS1.7.5.2: https://drive.google.com/file/d/1u14znT7lPpBw9u1QXbBMFfDhwTp210IW/view

I’ll add this to the debug roadmap so that it’s fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!

@khouloudbelguith

And if you fulfill a different price (tax excl.) for the supplier on Options tab (8€), it will set the cost price in Pricing tab to 8€ instead of the 10€ previously fulfilled.

@nicoladze, yes, you are right, I just edited the first comment.
https://drive.google.com/file/d/1Gt9uAlYgAgeKI4WMneCyUB5jJBvJA7ij/view
Thanks!

@khouloudbelguith

Create a product with
2.1 Price = 12 tax included / =10 tax excluded
2.2 Tax =20%
2.3 Price per unit= 10 /ml
2.4 Cost price = 10
2.5 In the Options Tab, select one supplier as a default.
2.6 Price (tax excl.) for the supplier = 10

only the points 2.1 - 2.4 - 2.5 are necessary to reproduce the issue.

@fabio-zetaweb, about the cost price issue, if you try to create a product with:

  1. price = 0
  2. cost price = 0
  3. in the options tab, select a supplier as a default
  4. Price (tax excl) for the supplier = 12
  5. Enable product
  6. Click on Go to catalog
  7. check cost price = 12

https://drive.google.com/file/d/1YUFAyo4sgXPQyJxal46reinpBmMIl0ad/view
Thanks!

Yes, you're right! I considered implied points 1 and 2. What happens with more than one suppliers?

@fabio-zetaweb, the price of the supplier by default.

Thanks!

@khouloudbelguith

Not good... I hope this bug will be solved asap.

Thanks for the support!

Hi @colinegin,

This is a major regression in PS1.7.6, ca we add it to the Backlog 1.7.6?

Thanks!

I hope it to! This bug also ensures that my search in the FO does not display the products that a supplier has selected.

@CatchMeZZo, this issue is reported here: https://github.com/PrestaShop/PrestaShop/issues/15640

Thanks!

When will the fix or solution be available? It takes to long time for this kind of bug...

Hello @CatchMeZZo
The bug is already fixed and will be available in PrestaShop 1.7.6.3

I know that... the question is how long it takes to release the update!

1.7.6.3 should be available next week

Was this page helpful?
0 / 5 - 0 ratings