These appear to be adjusted by WooCommerce here:
https://github.com/woothemes/woocommerce/blob/master/assets/js/frontend/add-to-cart-variation.js#L475-L479
Title and ALT. Can you do a quick test with another theme? And tell us the version.
Thanks for the prompt reply and apologies for my delayed response.
WooCommerce and DB version: 2.5.5 with plans to upgrade to latest by EOW.
WP version: 4.4.2
Server running PHP 5.5.8
At the present time, I unfortunately do not have access to another theme, as the site is in final stage for go-live.
This particular project is using THE7 from Dream-Theme. I’ve also raised this issue with theme dev’s support team, to expedite a resolution on both ends (WC and Theme).
Are you able to reproduce this issue? Aside from having the time, the issue is rather simple to replicate: Variable product with a default Gallery Image plus one unique image and title/caption/desc per each variation.
(1) View variable product. Default image shown.
Mouse hover shows default image’s TITLE.
When clicked, lightbox shows: default image’s CAPTION.
(2) Now, using the selectors, choose a variation.
(3) Note image *correctly* changes.
Mouse hover shows variable image’s TITLE
However, when clicked, lightbox *incorrectly* shows DEFAULT image’s CAPTION instead of the variable image’s CAPTION.
Thank you kind sir for your continued insight.
No this works in my testing on 2.5.5 and default WP theme. This is why you should probably find the time to test another on your install to see if its theme or another plugin.
OK – done as requested. I’ve installed and activated TwentySixteen theme and the issue persists. Latest version of WordPress and WooCommerce is also installed, at this time.
If you are able, we can discuss over PM, so that I may provide you with a URL. The URL is on a dev box and, hence, I need to retain privacy for client’s sake.
I am inspecting closely the rendered client-side code; specifically the JSON data string which resides here:
<form class="variations_form cart" method="post" enctype='multipart/form-data' data-product_id="303" data-product_variations="[...
As noted on my prior feedback, for each variation:
- image_src is GOOD,
- image_link is GOOD,
- image_title is GOOD,
- image_alt is GOOD,
- image_scrset is GOOD,
What’s interesting, and perhaps the root issue, is that CAPTION is *NOT* included in the JSON data string .. and yet that IS the value being referenced by the Lightbox .. which is where the reported issue persists.
I am well pleased. That’s what I consider great teamwork.
I presume this fix will be in the next release of WooCommerce. When might that be?
[2.5] Set captions
File: includes/class-wc-product-variable.php
In the meantime, I’ve snagged your committed update from the repo and will drop it into my client site.
Thanks, Mike, for the prompt attention!
Hello Mike.
Unfortunately, swapping to your patched file caused issues for my site; the variable product page seems to have died in the process of rendering. It’s missing the entire bottom portion of the page now, including the dropdowns, etc.
/wwwroot/wp-content/plugins/woocommerce/includes/class-wc-product-variable.php
I’ve restored the prior version, while I await your feedback.
Site is running:
WC & WCDB 2.5.5
WP 4.4.2
PHP 5.5.8
MySQL 5.6.17
Mike, I believe the error to be as follows:
[31-Mar-2016 15:58:29 UTC] PHP Fatal error: Call to undefined function wc_variation_attribute_name() in E:\HostingSpaces\myuser\mydomain.com\wwwroot\wp-content\plugins\woocommerce\includes\class-wc-product-variable.php on line 340
Hello Mike. Sorry to bother .. was hoping for a follow-up on the aforementioned error.
Hello Mike. As you have not responded, I have changed the status to NOT RESOLVED. Perhaps that is why you weren’t notified. Not trying to stalk you, brother đ
The fix works fine. If you’re struggling to apply it to your site, please just wait for the next update.
Hello –
I am getting the same error. Fatal error: Call to undefined function wc_variation_attribute_name() in …./wp-content/plugins/woocommerce/includes/class-wc-product-variable.php on line 340.
If it works for the Mike I am curious what would be causing this error for IRD-dev and myself.
Mike and Suncat3 –
I confirm that, with the addition of the previously-unmentioned file “/includes/wc-attribute-functions.php”, this bug is NOW FULLY RESOLVED.
Thank you again, Mike. I am also pleased to learn that my follow-up report to you (“error on line 340”) was indeed factual and not related to my implementation.
For anyone else interested, this change is presumably part of the forthcoming WooCommerce 2.6 release which is presently in BETA.
The two files that were changed are:
/includes/wc-attribute-functions.php
and
/includes/class-wc-product-variable.php
Copy and paste the two file’s contents from the repository (linked above) and promote to your web server thereby replacing the former copies.
2016-May-17