Add-to-cart form not styled according theme for product with only 1 variant

paradoxx's picture
paradoxx
Sat, 12/05/2015 - 03:48
#1
Add-to-cart form not styled according theme for product with only 1 variant

Hi,

My client has the need for products that have only 1 size and 1 color attribute.

Once entered such product, i noticed that the add-to-cart-form from the theme is not being styled as expected :

Image title

Not immediately visible on the product page itself, but after i open the "edit" pane, there are warnings showns to my opinion related to the case: 

Image title

EDIT: The errors also show up here on product-grid page :

Image title

Could you have a look at this ?

Thanks !

paradoxx's picture
paradoxx
Sat, 12/05/2015 - 19:38

Hi,

While searching through some core stuff to solve another issue with altered default product preselection, i found this fragment of code inside commerce_cart.module that might be involved in the way the add-to-cart form is themed inside your theme : 

Image title

$form['product_id']  is in case of 1 product reference set to type 'hidden'.

Maybe a red wire you can follow when debugging this case.

paradoxx's picture
paradoxx
Sun, 12/06/2015 - 15:47

Hello,
Solved this issue changing the product display setting for the add to cart form :

Image title

khoa's picture
khoa
Sun, 12/06/2015 - 16:32

Hello,

Thank you so much. You helped us a lot.

paradoxx's picture
paradoxx
Mon, 12/07/2015 - 01:58

Hi Khoa and colleagues,

You're welcome. It is in my nature to act like this, certainly if i feel i am being treated likewise.

Have a nice day!

Bart

khoa's picture
khoa
Mon, 12/07/2015 - 02:35

Thank you, Paradoxx. You the man :)

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.