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

Add to Cart button is missing on all product pages #6823

Closed
viktor-zhuromskyy opened this issue Sep 30, 2016 · 18 comments
Closed

Add to Cart button is missing on all product pages #6823

viktor-zhuromskyy opened this issue Sep 30, 2016 · 18 comments
Labels
bug report Component: Catalog Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Progress: needs update

Comments

@viktor-zhuromskyy
Copy link

After successful upgrade from 2.0.9 to 2.1.1 the "Add to Cart" button is missing on all product pages in the entire store.

I am using latest Porto theme. Everything was working before the upgrade.
I suppose the issue is with the $isSaleable status attribute, but I can't find anywhere in DB where is the status recorded.

Nonetheless, category pages display the "Add to Cart" button as intended.

Please check https://endohaus.com

image 2016-09-30 14 41 49
image 2016-09-30 14 42 17

@paales
Copy link
Contributor

paales commented Oct 2, 2016

@devdesco-ceo It seems there is a problem with the Porto theme not being compatible with Magento 2.1.1. The best course of action would be to contact the maintainer of the Porto theme.

@viktor-zhuromskyy
Copy link
Author

Thank you! I will check in with the Porto developers. By the way,
what should be the code piece for addtocart.phtml in M2.1.1?

@viktor-zhuromskyy
Copy link
Author

Actually,
I temporarily deleted addtocart.phtml from Porto theme folder for M2 to use it's native addtocart.phtml, but still the issue is present,
so I do not think it's Porto's compatibility problem.

@viktor-zhuromskyy
Copy link
Author

I switched over to magento/blank theme, but the Add to Cart button is missing in this case as well.
Maybe when running database upgrade when upgrading from 2.0.9 to 2.1.1 broke some relations or settings in DB?

Any clue?

@veloraven
Copy link
Contributor

@devdesco-ceo thank you for your report.
Please confirm that you have cleaned cache, reindexed, and re-generated statics.

@viktor-zhuromskyy
Copy link
Author

Sure.
I am getting the following error message in console:
DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://endohaus.com" from accessing a cross-origin frame.(…)
May be that is the cause?

@viktor-zhuromskyy
Copy link
Author

What I just discovered, is in my multi-store / multi-view setup of M2 (actually after update from 2.0.9 to 2.1.1 and afterwards to 2.1.2) only default store views with English locale do not have "add to cart" present on product pages, and functionality of checkout is broken on the same store views.

I tried to change default store views to another locales, but to no avail.

Please see yourself - https://endohaus.us/catalog/product/view/id/10/s/c-mount-video-coupler-for-storz-compatible-rigid-endoscopes-and-fiberscopes-vcc-bmw-35f-050 is missing the "Add to cart" button, but
https://es.endohaus.us/catalog/product/view/id/10/s/c-mount-video-coupler-for-storz-compatible-rigid-endoscopes-and-fiberscopes-vcc-bmw-35f-050 has all the shopping functionality present.

Also, I went through all settings in admin, and everything looks the same. As I guess, either there is an issue with en_US locale in config / locale files,, or something is screwed up in DB.

I am ready to spend my time and offer Team View session to one of M2 developers to get deeper into the issue right at my production host.

So, as I said before, it is not a compatibility issue of Porto theme, but a BUG in M2 2.1.x core.

image 2016-10-19 02 51 38
image 2016-10-19 02 52 00

@nomuprive
Copy link

@devdesco-ceo Thanks for sharing! Were you able to find a solution to this issue? I'm also having "Add to Cart" and checkout problem with Porto. A Magento Developer on here confirmed that Porto was causing the problem because the "Add to Cart" and checkout is working just fine with Magento 2 default theme. But it looks like our issues are not the same but a little crossing for one to suggest they might be related one way or the other. For me when I click on "Add to Cart" button it redirects to homepage causing a loop and the checkout process never complete. I contacted Porto Developers and they suggest making sure I use the patch, which I did several times, but still with no success.

@viktor-zhuromskyy
Copy link
Author

No, I did not solve the issue yet. The code in Porto theme seems fine, but I am going to upgrade Porto to 2.4.0 today and see what happens.

Also, Porto Theme developer are very sluggish with support, no matter how good their theme is. I did a lot of modifications and CSS styling of it, and it looks awesome. Check it out and tell me what you think - https://endohaus.com

As to default blank theme, I have to recheck if it is the core issue, or the Porto's. Will keep you updated here.

@viktor-zhuromskyy
Copy link
Author

Checked again on upgraded 2.4.0 Porto theme... same thing - Add to Cart button is missing on all default store views, even when switched o Magento/Blank theme. That is definitely a bug.

@viktor-zhuromskyy
Copy link
Author

viktor-zhuromskyy commented Nov 2, 2016

By digging deeper into log files, in system.log I discovered the following error (thousands on error lines like this) produced on default, i.e. main/default store views of each and separate websites in my multi-store installation:

[2016-11-02 08:11:46] main.CRITICAL: Warning: Magento\Framework\Locale\Format::getPriceFormat(): Cannot load resource element 'default' in /var/data/mfs/www/magento/lib/internal/Magento/Framework/Locale/Format.php on line 112 [] []

@viktor-zhuromskyy
Copy link
Author

Finally, resolution came from another issue #5183.
I compared lib/internal/Magento/Framework/Locale/Format.php both from 2.0.9 and 2.1.2 versions, and in the latest one there is so much bogus code...

I had to replace code on line 112
$defaultSet = $localeData['NumberElements']['default'] ?: self::$defaultNumberSet; with $defaultSet = self::$defaultNumberSet; and here is the miracle... default store views have "Add to Cart" button back again, and the error is gone.

Please elevate the issue into a bug and fix it.

Links with the same problem:
https://github.com/magento/magento2/issues/5183
http://magento.stackexchange.com/questions/128418/magento-2-1-0-checkout-page-is-blank

@davideghz
Copy link

In my case this does not solve the issue, I still see the contents partially. Any idea whether this issue has been addressed by the core devs or not?

@ndungujackson
Copy link

In my case I have resolved this issue by setting intl.error_level to 0 in my php.ini

@dmitriyprime
Copy link
Contributor

dmitriyprime commented Jun 21, 2017

Thanks for reporting this issue. Is it actual for you or we can close it?

@El-Rico
Copy link

El-Rico commented Aug 21, 2017

<div class="product-addcart-wrap"></div>
is empty...

@magento-engcom-team
Copy link
Contributor

@viktor-zhuromskyy we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

@nelero
Copy link

nelero commented Jul 19, 2018

So, nothing to solve this but issue closed ? so many issues aren't fixed with this process.
Magento 2.X really needs to fix, Thousands of regression compared to 1.9 version.
I know it's not the same engine and so on, but why loosing all the work ?

i reproduced this : multistore (2 websites with 1 store and 1 store view each) If i checked it to be displayed on the 2 websites, and put them in the 2 root categories => no add to cart button
(magento 2.2.3)

magento-engcom-team pushed a commit that referenced this issue May 5, 2021
[Lynx] Update phpcpd to ~6.0.3 to be PHP8 compatible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Catalog Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Progress: needs update
Projects
None yet
Development

No branches or pull requests