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 Specification not found for currency: "" (Viewing suppliers) #14908

Closed
nrcjea001 opened this issue Jul 30, 2019 · 24 comments

Comments

@nrcjea001
Copy link

commented Jul 30, 2019

To Reproduce
Steps to reproduce the behavior:

[Edit by Khouloud]

  1. Go to the BO => => Advanced Parameters => Import page => Import products using the csv file by default
  2. Go to Catalog -> Brands & Suppliers
  3. Click Suppliers -> click view supplier

Screenshots
untitled

Additional information
PrestaShop version: 1.7.6
PHP version: 7.2

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2019

Hi @nrcjea001,

The issue seems to be related to this issue: #14608
Could you please try to change the precision from 6 to 2 in your table ps_currency in your database, check & feedback.

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Jul 30, 2019

untitled

This did not work for me

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2019

@nrcjea001,
Thanks for your feedback.
Could you please follow this comment #14595 (comment), try with this solution and feedback.

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Jul 30, 2019

Tried this solution but no change unfortunately

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2019

@nrcjea001, could you please try with this solution, be sure that you have a back up of your database.
Try to delete all rows with id_currency == 1 from ps_product_supplier.
Thanks to check & feedback.

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Jul 31, 2019

I've tried this as well and it doesn't work. I tried removing all suppliers associated to product and reimporting everything, but still nothing.

All id_currency == 0 now. But why 0? if my default currency ID = 1, how can it be 0 in ps_product_supplier?

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2019

@nrcjea001, could you please try to Truncate the ps_product_supplier, check it this issue occurs again.

PS: you should make a backup of your database.

Thanks!

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Jul 31, 2019

@khouloudbelguith , I deleted all records using the delete option provided by phpmyadmin. Is this different from "truncate" command?

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2019

@nrcjea001, 'truncate' command is to empty all the table.

Thanks!

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Aug 1, 2019

@khouloudbelguith , I truncated table and issue went away. However, when I imported suppliers again, issue came back.

I am using an import module from another vendor. I will get in touch with them first to see if its not an issue on their side.

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

@nrcjea001, yes, you should contact them.
In my case, I tried to empty the table & select suppliers to products => it is OK.
Thanks!
Waiting for your feedback.

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Aug 1, 2019

Hello

Vendor confirmed it is not a bug in the module. I truncated table and it is OK. But then I reimported suppliers and the issue comes back.

Please see attached ps_product_supplier table for reference

untitled

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Aug 1, 2019

untitled

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

@nrcjea001,

But then I reimported suppliers and the issue comes back.

Could you please try to edit the suppliers for your some products manually, from the BO => Products details page => Options Tab
image

Thanks!

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Aug 1, 2019

@khouloudbelguith , I've edited suppliers without error. All seems ok there. But issue above remains

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

@nrcjea001, in the BO => the exception is always displayed?

Thanks!

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Aug 1, 2019

No Exception when editing suppliers in Options Tab. Exception is always thrown when viewing suppliers

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

@nrcjea001, did you use the multistore context?

Thanks!

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Aug 1, 2019

no

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

@nrcjea001, I manage to reproduce the issue with PS1.7.6.0.
In fact, I tried to import new products from the BO => Advanced Parameters => Import page using the CSV file by default.
In the BO => Catalog => Brands & Suppliers page => Supplier Tab => Click on "View" => see error
image
With PS1.7.5.2 => OK.
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!
Thanks!

@eternoendless

This comment has been minimized.

Copy link
Member

commented Aug 1, 2019

The offending line, AdminSuppliersController.php:403

$products[$i]->product_supplier_price_te = Tools::displayPrice($product_infos['product_supplier_price_te'], new Currency($product_infos['id_currency']));

line 397:

$product_infos = Supplier::getProductInformationsBySupplier(
   $this->object->id,
   $products[$i]->id,
   0
);

I'm betting $product_infos['id_currency'] is 0 or null...

@marionf marionf added this to Backlog in PrestaShop 1.7.6 via automation Aug 1, 2019

@marionf marionf moved this from Backlog to To do in PrestaShop 1.7.6 Aug 1, 2019

@jolelievre jolelievre moved this from To do to In progress in PrestaShop 1.7.6 Aug 8, 2019

@jolelievre jolelievre self-assigned this Aug 8, 2019

@jolelievre jolelievre moved this from In progress to To be reviewed in PrestaShop 1.7.6 Aug 8, 2019

@matthieu-rolland matthieu-rolland moved this from To be reviewed to To be tested in PrestaShop 1.7.6 Aug 8, 2019

@khouloudbelguith khouloudbelguith added Fixed and removed To Do labels Aug 8, 2019

@khouloudbelguith khouloudbelguith moved this from To be tested to To be merged in PrestaShop 1.7.6 Aug 8, 2019

@khouloudbelguith khouloudbelguith added this to the 1.7.6.1 milestone Aug 8, 2019

@jolelievre jolelievre moved this from To be merged to Done in PrestaShop 1.7.6 Aug 8, 2019

@jolelievre jolelievre closed this Aug 8, 2019

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Sep 7, 2019

Hello

Although 1.7.6.1 cleared up this issue with my other shops, my shop morganic.mu remains unresolved when attempting to access suppliers.

Untitled

I also found an exception while trying to add a new currency. Please see pdf attached.

exception.pdf

After exception was thrown, 2 new faulty currencies were added at random

Untitled2

As mentioned, all is working fine with my other shops. Perhaps its not working with morganic.mu because we tried to fix this issue previously by truncating the ps_product_supplier table a few weeks ago.

It may be that my database needs to a fresh install. But I'm not sure how to approach this without having to start from scratch.

Thanks

@nrcjea001

This comment has been minimized.

Copy link
Author

commented Sep 7, 2019

Untitled

Untitled2

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

@nrcjea001, This issue is currently closed, can you open a new one with more information about your configuration.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.