First off big thanks to everyone in the Drupal community for all their hard work. It means more then I can say:)

Issue: The issue at hand is when we shop using our views catalog the add to cart button is broken "some times". Now we have seen a bit around drupal on this topic but really have not found our issue.

Reproduce: Install commerce kickstart import products via feeds, create catalog view using content node type then add to cart form in the product ref. (CentOS 5.6 only) Every thing works great on our dev server Ubuntu 12.04lts!

Specs:
Dev Server: Ubuntu 12.04 lts, php 5.3, apache 2, mysql the basic LAMP stack for ubuntu. Everything works fine. When you click add to cart the product is added like a charm. No issues at all?

Production server: CentOS 5.5, php 5.2.17, apache 2 mysql. Now when we try to add to cart same site, just uploaded and installed using drush. No errors in the log. The site is a charm. The add to cart button "some times" does not add. I would say about 50% of the time as user 1 and or as anon user the form is broken. Nothing happens! We usually do not create issues - just fix them... but at this time we can not come to terms with how this is possible to **NOT** happen on Ubuntu at all and happen about 50% of the time on CentOS.

Does anyone know if this could be an issue with PHP?
Also is this possible from file permissions?
Any help would be huge:)
Thanks in advance from everyone that makes Drupal so great!

**MORE**
views caching: if your on page (1) of the view add to cart works. then if you return to page (1) and try to add another product then it will not add. But by proceeding to the next page of the view you can add A product. another way of saying this is you can add 1 product per view page.

Comments

merlinofchaos’s picture

Project: Views (for Drupal 7) » Commerce Kickstart
Version: 7.x-3.5 » 7.x-2.x-dev
Component: Views Form » Code

Views doesn't provide an Add To Cart form -- let's try commerce kickstart.

Jooblay.net’s picture

Thanks for the reply merlinofchaos?

When we add the field "product referenced - product sku off the product node" and select "add to cart form" we render "Add to cart" button. Which seems to add products about 50% of the time or "some times"? The products content type node "add to cart - product ref." works great as long as the views ajax of the ref. product is not turned on.

Further the "product ref. add to cart form" which is the rendered "add to cart button" only breaks on CentOS which is ref. above. We can add to cart 100% of the time off our Ubuntu 12.04lts server. One main differance being PHP 5.2.17 of our production server and PHP 5.3 on our Ubuntu dev server.

Again thanks merlinofchaos your a legend:)

JUST TO BE CLEAR - WE ARE ADDING A "FIELD: PRODUCT SKU" WHICH IS A PRODUCT REFERENCE TO THE PRODUCT TYPE AND NODE.

Jooblay.net’s picture

Configure field: Commerce Product: Add to Cart form
The above is the title of the field we are adding that does not add to cart. We would like to be able to allow shoppers to add to cart items from each view page. Then have an option to click the title into the product display. Which all works great.

Jooblay.net’s picture

Further more the "Configure field: Commerce Product: Add to Cart form" works great right off the view page of our dev server?

jsacksick’s picture

Project: Commerce Kickstart » Commerce Core
Version: 7.x-2.x-dev » 7.x-1.x-dev
Component: Code » Cart

I'd say it's a cache issue but I'm not 100% sure about that, let's move that to the Drupal Commerce issue queue.

rszrama’s picture

Category: bug » support
Status: Active » Closed (duplicate)

Yeah, this is a duplicate support request in the Commerce queue - you can search for Views cache to find more info. Basically, if the same form HTML is used for multiple users, it's not going to process for the next user. That's why it's working only once.

Jooblay.net’s picture

Hello rszrama great work ...

On testing views caching, this continues to happen when using the field (add to cart) + (add to cart form) on all views "some times" even with the views caching off, clearing cache in the admin as well as drush cache-clear.

We will look for the duplicate ticket... do you have a link by any chance?

Also why would this happen on our production server and not on our Ubuntu server with the exact same cloned site. The only change is Php versions and CentOS to Ubuntu...

Thanks again for all of your comments:)

Jooblay.net’s picture

Another note may or may not be related is our Views Ajax when turned on breaks the actual node product add to cart button. ?

Here is an open issue that seems to relate to our Views Ajax breaking on the add to cart http://drupal.org/node/1191928

We will look for another issue on this...

rszrama’s picture

I don't have it off the top of my head - it's one I answered last week. Also note that randomized Views sorting will break things. It's all just a matter of understanding how the forms API builds and validates forms before processing them.

Jooblay.net’s picture

ok thanks:)

rszrama’s picture

No sweat, hope you get it sorted out. : )

I need to do some more playing with Views powered Add to Cart forms; I bet there's a way we can work around these limitations.

Jooblay.net’s picture

Agree, I have read a few of your comments about this issue && architecture in views. It seems the following:)

1. Views add to cart form breaks when it is on a views node type product ref. Which in turn breaks Ajax "Yes".
2. If you have Ajax "Yes" then you add to cart button on your product node ref. is broken.

At this time we are researching how our taxonomy terms work with views && add to cart form.

One possible work around maybe to add to cart via another view and or ref the exact nid (node id) in the path as you have said. To date we have not had any luck with this.

What about adding a view field view to as the add to cart?

Thanks everyone I have so much respect for your contributions to the web and making it possible to small business to act "BIG" at least on the web... right!

Jooblay.net’s picture

More...

We have having some great luck dealing with this issue by using the (Taxonomy term) instead of the content product type. At this time the [add to cart form] is working great.

Our store has the following product set:
1. Product type.
2. Contenty type, Product ref. to above product type.
2. Taxonomy term catalog, with a Product. ref. to above product type.

The ajax enabled "Yes" on the view be it Content or Tax is still broken, but the [add to cart form] seems to be working great off the taxonomy referenced products.

So for now I guess the best work around the Views Add To Cart Form is to use the taxonomy terms for any view you would like to view the add to cart form button off the view.

Jooblay.net’s picture

Priority: Normal » Minor
Status: Closed (duplicate) » Active

Another note
It would be nice to find the duplicate of this issue... no link has been found at this time:)
So I will open this issue up again and close it when we find the duplicate if that is ok with everyone:)

Above we have found a work around at the moment to just using taxonomy.

Jooblay.net’s picture

Here is a similar issue on Ajax Breaking but we are not sure if this is the same issue as the Add to cart form breaking with our case the add to cart form breaks with or without ajax enabled on the views.

http://drupal.org/node/1621210

Anyone with more feed back on this issue could really help.

Is the Add To Cart Form braking and Ajax enabled on the same view related?

Jooblay.net’s picture

Status: Active » Closed (duplicate)
Jooblay.net’s picture

Issue summary: View changes

Added more info.