I discovered this bug when attempting to override the value of the 'Add to cart' button for a specific product. To reproduce this issue, follow these steps:

  • Create a new product class, ensuring that a variable price feature is added for every product.
  • Create a product using the content type created by the new product class.
  • Save the product after filling in the required form fields.
  • View the product to ensure the 'add to cart' form is displaying correctly.
  • Edit the node, and navigate to the variable price feature - /node/[nid]/edit/features/[pfid].
  • Edit the variable price feature, and expand the 'Default variable price product feature' fieldset.
  • Select the 'Override the title of the add to cart button' checkbox, and enter a new title in the 'Add to cart button title' field.
  • Save the feature, and view the product again - you'll notice that the submit button still reads 'Add to cart' rather than the new title you provided.

I've created a patch that fixes this issue, and I'll upload it when I have an issue number etc.

Comments

matt.elkins’s picture

Status: Active » Needs review
StatusFileSize
new734 bytes

As promised, patch attached.

matt.elkins’s picture

Updated patch attached. This new patch ensures that default overridden values, defined in the product class, for both the 'Add to cart' submit button and the 'Amount' text field are correctly applied on product node pages. The default overridden values can themselves be overridden at a product node level by following steps 5 to 7 in my original post.

mrcharles’s picture

Thanks Matt,
I applied the patch which fixed the issue...

Although I now receive the following error:

Warning: unserialize() expects parameter 1 to be string, array given in uc_varprice_form_alter() (line 46 of /home/...

Any help on this one appreciated.

fjmachin’s picture

Same issue here. Any help, please?

kfrank’s picture

Issue summary: View changes

Same issue here.