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

Incorrect prices passed to WooCommerce #4

Open
regianesouzaatelie opened this issue Aug 15, 2023 · 14 comments
Open

Incorrect prices passed to WooCommerce #4

regianesouzaatelie opened this issue Aug 15, 2023 · 14 comments
Labels
bug Something isn't working unconfirmed Unconfirmed behaviors

Comments

@regianesouzaatelie
Copy link

regianesouzaatelie commented Aug 15, 2023

Description

Please, I need help with: https://ofertasdaregi.com.br/p/
Page of tests: https://loja.ofertasdaregi.com.br/ofertas/p/

I’m using the Amazon Auto Links and Auto Amazon Links – WooCommerce Products (Converts unit products to WooCommerce products. Versão 1.0.0 ) in my site. This is importing very well to units, but I have some questions about Amazon Links – WooCommerce Products.

Links of the imported units: https://ofertasdaregi.com.br/amazon_auto_links/pesquisa/ https://ofertasdaregi.com.br/amazon_auto_links/categorias/

Please, check the image attached. Number 2 and 3 on the image: When I hability the Amazon Links – WooCommerce Products:
image1

1- Some products get incorrectly price, because the plugin is not considering the comma in the “price field” from woocomerce. So, the product that costs 93.90 becomes 9390.
logs.txt
Plese, verify if the "error logs" is enought to this question

2- In the some products the plugin fills the promotional price field with “zero (0)”. So, the product has the a wrong price because "the field discount product price" or "promotional price" is filled with zero (0).
About that, I mean... "Promotional price field", it would be like a "discount product price".

Please see the image
image2

Please, I would like get some help, because I’ need to adjusting manually all these details in each products. Thanks very much.

Steps to reproduce

Hability the Amazon Auto Links and Amazon Links – WooCommerce Products.
Configure some units (for exemplo URLS) and put the url will be import.
Atualize. The result is:

1- Some products get incorrectly price, because the plugin is not considering the comma in the “price field” from woocomerce. So, the product that costs 93.90 becomes 9390.

2- In the some products the plugin fills the promotional price field with “zero (0)”. So, the product has the a wrong price because "the field discount product price" or "promotional price" is filled with zero (0).

Screenshots, screen recording clips, or code snippets

No response

Environment

Auto Amazon Links Versão 5.3.1
Auto Amazon Links - WooCommerce Products Versão 1.0.0
WordPress Versão 6.3
Google Chrome Versão 115.0.5790.111

Please confirm that you have searched existing issues in this repository.

Yes

Please confirm that the problem occurs with the WooCommerce default theme, StoreFront and all the plugins deactivated except "Auto Amazon Links" and "Auto Amazon Links - WooCommerce Products".

Yes

@regianesouzaatelie regianesouzaatelie added the unconfirmed Unconfirmed behaviors label Aug 15, 2023
@michaeluno
Copy link
Owner

Thanks for the report.

I could reproduce the first issue, but not the second. If you can give a sample product ASIN for the US locale, it would be helpful.

@michaeluno michaeluno added the bug Something isn't working label Aug 16, 2023
@regianesouzaatelie
Copy link
Author

Hi michaeluno,

I'm starting to think there's the same error to both case, see:
image6

I imported this product again (Cremer - Fralda Infantil). And see, it got the normal price because this product has not a promocional price. However, the comma is not correct, and the price stays wrong. The correct price would be 29,90
Link Amazon: https://www.amazon.com.br/Fralda-Disney-Pr%C3%A1tica-Cremer-Branco/dp/B07FGNDSYL/ref=sr_1_1?__mk_pt_BR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=3BX5MWBEBDCTT&keywords=B07FGNDSYL&qid=1692189642&sprefix=b07fgndsyl%2Caps%2C473&sr=8-1

I'm not tell if before I imported this by another form (unit by category or unit by search) and if it was the reason the promocional price was 0. But today, it was imported by unit url, and show like image above.

Than, I imported some products from www.amazon.com to test it. And the comportament was the same
image7

That products has no promocional price
Link Amazon: https://www.amazon.com/Blue-Lizard-Mineral-Sunscreen-Stick/dp/B083VXQ7MG/ref=sr_1_16?qid=1692189673&s=baby-products-intl-ship&sr=1-16

Link unit: https://loja.ofertasdaregi.com.br/ofertas/amazon_auto_links/url/

NOW, see it:
image8

These products (Oster OLIQ610) are the same, only they have different power voltage (110/220)

But, The product was marked by blue was imported by unit url, another, marked by orange was imported by unit category.
When I imported by url, the promocional price is shown and regular price is wrong. Promocional price 178,40 and regular price (correct) 229,90.
When I imported by category, the promocional price is not shown and only is shown the regular price. The comma in the correct place. Even so, the price is still wrong, because the promocional price is not shown. But the comma on regular price is correct.

Links Amazon:
110: https://www.amazon.com.br/Liquidificador-1400-Full-Preto-Oster/dp/B08DFCF9HW/ref=zg_bs_g_17124722011_sccl_4/146-7896303-2674765?psc=1&tag=ofertasdare06-20&language=pt_BR&currency=BRL

220: https://www.amazon.com.br/Liquidificador-1400-Full-Preto-Oster/dp/B08DFJRCJB/ref=sr_1_1?__mk_pt_BR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=QNQ3Q1Z1BGZR&keywords=Oster%2BOLIQ610%2B1400%2BFull%2B-%2BLiquidificador%2C%2B3%2C2L%2C%2B110V%2C%2B1400W%2C%2BPreto&qid=1692190288&s=kitchen&sprefix=oster%2Boliq610%2B1400%2Bfull%2B-%2Bliquidificador%2B3%2B2l%2B110v%2B1400w%2Bpreto%2Ckitchen%2C523&sr=1-1&ufe=app_do%3Aamzn1.fos.6121c6c4-c969-43ae-92f7-cc248fc6181d&th=1

But, I could not estabilice the reason why it is happening. I just could show it to you.
I hope it helps.

@regianesouzaatelie
Copy link
Author

2- In the some products the plugin fills the promotional price field with “zero (0)”. So, the product has the a wrong price because "the field discount product price" or "promotional price" is filled with zero (0). About that, I mean... "Promotional price field", it would be like a "discount product price".

Please see the image image2

Hi michaeluno,

I could reproduce this issue. It happens when the importation is by unit category and the product has not promocional price.
So, importation by:

  • Unit url + product has promocional price = The plugin get normal price incorrectly (with incorrect commas) and show correctly the promocional price (like Oster OLIQ610 marked by blue)

  • Unit url + product has not promocional price = The only imported price is incorrect (with incorrect commas) like (product Cerve Gel Limpeza).

  • Unit category + product has promocional price = The plugin get normal price correctly (with commas) but it disregard the promocional price (like Oster OLIQ610 marked by orange).

  • Unit category + product has not promocional price = normal price is okay, but the plugin fill in 0 (zero) the promocional price field (like Cremer - Fralda Infantil firt example and see image below)

image9

I hope helps.

@regianesouzaatelie
Copy link
Author

Hi michaeluno,

I had not test import by unit search, and I did it now. And the comportament was the same when I imported by unit url. See image below:
image10

Unit search + product has promocional price = The plugin get normal price incorrectly (with incorrect commas) and show correctly the promocional price

Unit search + product has not promocional price = The only imported price is incorrect (with incorrect commas)

** Curiously: One by products imported doesn't show disclaimer.

Unit seach: https://loja.ofertasdaregi.com.br/ofertas/amazon_auto_links/pesquisa/

I didn't test another importations forms (Contextual, Feed and PA-API).

@michaeluno michaeluno changed the title Problems with Amazon Links – WooCommerce Products Incorrect prices passed to WooCommerce Aug 18, 2023
michaeluno added a commit that referenced this issue Aug 18, 2023
Amazon gives price amounts such as 1000 as $10.00 without decimal dots. And they are passed to WooCommerce as 1000, not 10. This change fixes this behavior.

Fixes #4
@michaeluno
Copy link
Owner

michaeluno commented Aug 18, 2023

@regianesouzaatelie You can try the development version which may fix this.

@regianesouzaatelie
Copy link
Author

@regianesouzaatelie You can try the development version which may fix this.

Hi michaeluno,

I downloaded that and I did some tests. Only products importted by unit category and that has not promocional price, still show error. See the image:
image11

For now, I will import by unit url.
Thanks!

@michaeluno
Copy link
Owner

I'm still unable to reproduce it. Can you provide a category of the US locale that can be used to reproduce the issue?

@regianesouzaatelie
Copy link
Author

Than, I imported some products from www.amazon.com to test it. And the comportament was the same image7

That products has no promocional price Link Amazon: https://www.amazon.com/Blue-Lizard-Mineral-Sunscreen-Stick/dp/B083VXQ7MG/ref=sr_1_16?qid=1692189673&s=baby-products-intl-ship&sr=1-16

Hi michaeluno,
I had some tests with these products above, but, now these are in promotion.
So, try it:
https://www.amazon.com/Thermometer-Infant-Floating-Safety-Temperature/dp/B073GGVN3Q/ref=sr_1_30?c=ts&keywords=Baby+Care+Products&qid=1692549065&s=baby-products&sr=1-30&ts_id=17720255011

Category: Baby Products›Baby Care
ASIN | B073GGVN3Q
image13

or

https://www.amazon.com/dp/B0BV2DPW86/ref=sspa_dk_detail_4?ie=UTF8&pd_rd_i=B0BV2DPW86p13NParams&s=baby-products&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWxfdGhlbWF0aWM&th=1

Category: Baby Products›Baby Care›Health›Thermometers
ASIN ‏ : ‎ B0BV2DPW86
image12

These products have not a promocional price. The issue happens when the importation is from the unit by category and the product have not a promocional price.

I could not import they by category here, because my API is from Brazil.

@michaeluno
Copy link
Owner

I cannot reproduce the problem.

image

image

Post the problematic category of the Brazil locale.

As for the currency, you might need to change it to USD in the WooCommerce settings.

@regianesouzaatelie
Copy link
Author

Hi michaeluno,
I don't know if I understanded what I need to do, but, I tried it:

I instaled Amazon Auto links and Auto Amazon Links - WooCommerce Products Versão 1.1.0b01 in another site of tests https://loja.ofertasdaregi.com.br/. I did't insert my API and then I imported products from Amazon.com with the unit by category. And curiously doesn't show issue:

Unit: https://loja.ofertasdaregi.com.br/amazon_auto_links/categoria/

image14

Then, I inserted my API and I imported again from Amazon.com.br:

image16

Some observations:

Unit: https://loja.ofertasdaregi.com.br/amazon_auto_links/categoria-2/

number 3 and 4 on image:

The product price is R$34,90, but in the unit showns R$ 55,07/ R$ 33,82. These values are aditional options of buy. In the importation by category the Auto Amazon Links - WooCommerce Products seems doesn't found theses values and show 0 (zero) on the promocional price.

So, I imported by unit URL the category url. https://www.amazon.com.br/s?rh=n%3A17540141011&language=pt_BR&brr=1&rd=1

image17

However, When I imported the category url by unit URL all these product that has aditional options of buy wasn't imported.

If I import only product url by URL unit, this shows like that:

image18

I don't know if it exactly explain some thing, but it seems strange to me.

Number 2 of [image16]:

This product has no price, only aditional options of buy

image19

michaeluno added a commit that referenced this issue Aug 27, 2023
With this change, when the discount price is zero or unset, the proper price is used for the displaying price.

Before this change, `strlen()` was used to check if a discounted price exists, which might not be reliable when 0.00 is passed. (haven't encountred this value yet though)

(possibly) Fixes #4
@michaeluno
Copy link
Owner

@regianesouzaatelie You can try 1.1.0b02, (the same link as above) which might fix the zero price issue.

@regianesouzaatelie
Copy link
Author

Hi michaeluno,

Well, now I could not import this product by category, it didsn't appear on my list when the importation was by category. See https://loja.ofertasdaregi.com.br/amazon_auto_links/categoria-2/

I also could not import by url. It updates the disclaimer but doesn't the price. I excluded and tried import again but it didn't appear on shop. It appear on unit (https://loja.ofertasdaregi.com.br/amazon_auto_links/url/) but doesn't on the shop. I didn't understand what happened.

So, I imported by url in another site (where I have not imported it not once). So, it appear correctly

image20

Diferent of when I have imported the first time

If I import only product url by URL unit, this shows like that:

image18

I tested importing another product by category that was imported incorrectly on the first:

image21

See first importation:

imagem9

apparently, the problem with importing by category has been resolved.

.....
About that:

Este produto não tem preço, apenas opções adicionais de compra

imagem19

This situation remains the same.

.....

I have another question about how the categories are shown on product page, but I will create a new issue. Thank you!

@michaeluno
Copy link
Owner

@regianesouzaatelie So has this been resolved? If not, please provide the steps to reproduce. Please remember that unless it is reproduced on my end, it won't be fixed.

@regianesouzaatelie
Copy link
Author

Hi @michaeluno , aparently it was resolved. But nowadays, I have imported by unit search. Let me do some tests more with url and category unit and I will tell you soon here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed Unconfirmed behaviors
Projects
None yet
Development

No branches or pull requests

2 participants