• Resolved IRD-dev

    (@ird-dev)


    First of all, thank you WooCommerce for this great toolset. It’s nice to know that the Lead Dev for WC Mike Jolley spends time here in the support forums as well.

    Working well:

    • Each gallery image discussed herein has an assigned Title, Caption and Description.
    • The main product configuration has a Product Image, as chosen from the gallery during product configuration. This is the DEFAULT image that is shown to patron at pageload, since no selections have yet been made.
    • Each variation of the product has a unique image assigned, as chosen from the gallery during product configuration.
    • When patron first views the variable product, the aforementioned Product Image is shown.
    • When patron completes the selection process, the product image is properly swapped (client-side) to the unique, associated variation.
    • When patron hovers mouse over the unique, associated variation image, the proper TITLE is shown.
    • When patron clicks the unique, associated variation image, the proper image is shown in lightbox.

    Not working well:

    • Although the proper image is shown in lightbox, the wording shown beneath the lightbox is INCORRECT – it is showing the CAPTION of the DEFAULT product image.

    What should occur:

    • When patron clicks the unique, associated variation image, the wording beneath the lightbox should be the TITLE (or caption) from the image that is being shown – not the main product default image.

    As the website is in development state, please direct message me for example URL.

    I am not sure if this is an issue with WooCommerce or the employed theme.

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    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.

    Thread Starter IRD-dev

    (@ird-dev)

    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.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    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.

    Thread Starter IRD-dev

    (@ird-dev)

    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.

    Thread Starter IRD-dev

    (@ird-dev)

    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.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Thread Starter IRD-dev

    (@ird-dev)

    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!

    Thread Starter IRD-dev

    (@ird-dev)

    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

    Thread Starter IRD-dev

    (@ird-dev)

    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

    Thread Starter IRD-dev

    (@ird-dev)

    Hello Mike. Sorry to bother .. was hoping for a follow-up on the aforementioned error.

    Thread Starter IRD-dev

    (@ird-dev)

    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 ??

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    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.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Thread Starter IRD-dev

    (@ird-dev)

    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

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Issue with image Title, Caption, Description on VARIABLE products’ is closed to new replies.