Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nicoladze opened this issue Nov 11, 2019 · 43 comments
Closed

Comments

@nicoladze
Copy link

@nicoladze nicoladze commented Nov 11, 2019

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

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 11, 2019

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.

@nicoladze

This comment has been minimized.

Copy link
Author

@nicoladze nicoladze commented Nov 11, 2019

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...

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 11, 2019

@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!

@nicoladze

This comment has been minimized.

Copy link
Author

@nicoladze nicoladze commented Nov 14, 2019

@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

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 14, 2019

@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: #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!

@nicoladze

This comment has been minimized.

Copy link
Author

@nicoladze nicoladze commented Nov 14, 2019

@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

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 14, 2019

@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!

@nicoladze

This comment has been minimized.

Copy link
Author

@nicoladze nicoladze commented Nov 14, 2019

@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

@nicoladze

This comment has been minimized.

Copy link
Author

@nicoladze nicoladze commented Nov 14, 2019

@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

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 14, 2019

@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.

@nicoladze

This comment has been minimized.

Copy link
Author

@nicoladze nicoladze commented Nov 14, 2019

@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) {
  }
}
@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 14, 2019

@nicoladze, did you find only some deprecations?
image

Have you any Errors?

Thanks!

@nicoladze

This comment has been minimized.

Copy link
Author

@nicoladze nicoladze commented Nov 14, 2019

@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"
]
@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 15, 2019

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

  1. #10792
  2. #15785

Thanks to check & feedback.

@nicoladze

This comment has been minimized.

Copy link
Author

@nicoladze nicoladze commented Nov 16, 2019

@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.

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 18, 2019

Hi @nicoladze,

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

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 18, 2019

Duplicate of #15724

@khouloudbelguith khouloudbelguith marked this as a duplicate of #15724 Nov 18, 2019
@khouloudbelguith khouloudbelguith added Duplicate and removed NMI labels Nov 18, 2019
@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 18, 2019

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!

@fabio-zetaweb

This comment has been minimized.

Copy link

@fabio-zetaweb fabio-zetaweb commented Nov 21, 2019

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

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 21, 2019

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

Thanks!

@fabio-zetaweb

This comment has been minimized.

Copy link

@fabio-zetaweb fabio-zetaweb commented Nov 21, 2019

@khouloudbelguith

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

Thanks for the support!

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 22, 2019

Hi @colinegin,

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

Thanks!

@colinegin colinegin added this to Backlog in PrestaShop 1.7.6 via automation Nov 22, 2019
@CatchMeZZo

This comment has been minimized.

Copy link

@CatchMeZZo CatchMeZZo commented Nov 23, 2019

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

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 25, 2019

@CatchMeZZo, this issue is reported here: #15640

Thanks!

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 26, 2019

@matthieu-rolland matthieu-rolland moved this from Backlog to In progress in PrestaShop 1.7.6 Dec 2, 2019
@matthieu-rolland matthieu-rolland self-assigned this Dec 2, 2019
@matthieu-rolland matthieu-rolland moved this from In progress to To do in PrestaShop 1.7.6 Dec 2, 2019
@PierreRambaud PierreRambaud self-assigned this Dec 4, 2019
@PierreRambaud PierreRambaud moved this from To do to In progress in PrestaShop 1.7.6 Dec 4, 2019
@PierreRambaud PierreRambaud moved this from In progress to To be reviewed in PrestaShop 1.7.6 Dec 6, 2019
@Progi1984 Progi1984 moved this from To be reviewed to To be tested in PrestaShop 1.7.6 Dec 19, 2019
@matks

This comment has been minimized.

Copy link
Contributor

@matks matks commented Dec 26, 2019

Fixed by #16729

@matks matks closed this Dec 26, 2019
PrestaShop 1.7.6 automation moved this from To be tested to Done Dec 26, 2019
@matks matks removed the To Do label Dec 26, 2019
@marionf marionf added the Fixed label Dec 26, 2019
@marionf marionf added this to the 1.7.6.3 milestone Dec 26, 2019
@CatchMeZZo

This comment has been minimized.

Copy link

@CatchMeZZo CatchMeZZo commented Jan 12, 2020

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

@marionf

This comment has been minimized.

Copy link
Contributor

@marionf marionf commented Jan 13, 2020

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

@CatchMeZZo

This comment has been minimized.

Copy link

@CatchMeZZo CatchMeZZo commented Jan 16, 2020

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

@marionf

This comment has been minimized.

Copy link
Contributor

@marionf marionf commented Jan 16, 2020

1.7.6.3 should be available next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.