Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to load thumbnail images using ajax update call #26

Closed
satishsojitra opened this issue Jun 25, 2015 · 15 comments
Closed

Not able to load thumbnail images using ajax update call #26

satishsojitra opened this issue Jun 25, 2015 · 15 comments

Comments

@satishsojitra
Copy link

Hi
Extension is working fine. But had some issue after sometime. Whenever I am clicking on color it's not making ajax call to update images. I debug code in swatches-extend.js where in function ConfigurableMediaImages.updateImage returning false before making ajax call due to getting product id null while calling the var pid = ConfigurableMediaImages.getSwatchProdId(productId, label, selectedLabels); so below code returning false before ajax update call :
f(!pid){
return false;
}

What can be the solution ? Is there I am doing something wrong ?

@wigman
Copy link
Owner

wigman commented Jun 26, 2015

Hi Satish,

What version are you using? Are the swatches working when you disable my plugin?
Is the main image switching?

@satishsojitra
Copy link
Author

Hi Wigman
I am using Magento 1.9.1.0. Yes main image switching working fine but it was not making ajax call while clicking on color. I have disabled default configurable swatches and again enabled it and cleared the cache. Now it's working fine.

I was not able to find the issue. Can you please explain brief what are the things I need to take care and keep in mind while using AjaxSwatches extension ?

Thanks for response and great extension !

@wigman
Copy link
Owner

wigman commented Jun 26, 2015

I meant which version of my module, but ok.

You should have images in your simple products. There's not much else you have to do. I can't debug your problem without details or access to your system. There's many factors that could interfere, but none really related to my module, just basic Magento 101 things.
Let's see if it keeps working now.

@wigman wigman closed this as completed Jun 26, 2015
@satishsojitra
Copy link
Author

I am using version 0.4.4 of your module.
Right now it's working fine. I will let you know if any issue.
Thanks. Keep it up ! keep smiling :)

@satishsojitra
Copy link
Author

Hi Wigman

Again it's stopped working. I am stuck now. What to do now ?

@wigman
Copy link
Owner

wigman commented Jun 26, 2015

send me a link to the test-environment if you have it available

@satishsojitra
Copy link
Author

Let me install in test-environment

@satishsojitra
Copy link
Author

It's working fine on dev. server. in my localhost I have override view.phtml and media.phtml for make look and feel of configurable product different. I am changing layout based on attribute set.

@wigman
Copy link
Owner

wigman commented Jun 26, 2015

Then it's a matter of customization issues. The ajax call should still be fired, but It's very possible that the javascript can't find the thumbnails that have to be replaced because you altered the elements. I can't really support you much further, try to trace back your changes.

@satishsojitra
Copy link
Author

Okay let me try to trace it.

@satishsojitra
Copy link
Author

Hi Wigman

please refer stackoverflow below link:
http://stackoverflow.com/questions/31097254/attribute-set-specific-product-view-page-design-not-working

Thanks

@satishsojitra
Copy link
Author

Hi Wigman
I solved the issue. It was happening due to custom modifications. But now there is white border appearing in thumbnail. I already implemented keepFrame(false) in media.phtml. Is there anyother file in AjaxSwatches extension where I need to implement keepFrame(false) ?

Thanks

@wigman
Copy link
Owner

wigman commented Jun 29, 2015

You can comment to my post on stackoverflow (and accept the answer if it helped you). I will respond there.

@wigman
Copy link
Owner

wigman commented Jun 29, 2015

To debug the keepFrame issue enable template hints, you'll find out what file is being used. If that doesn't work, post a question on magento.stackexchange.com (you'll get fasted answers then on the general stackoverflow).

@LoganGS
Copy link

LoganGS commented Sep 8, 2015

I believe I was having a similar issue - I would click a product swatch and it would return images from a different child product.

The following line was returning an empty array:
var compatibleProducts = ConfigurableMediaImages.getCompatibleProductImages(fallback, selectedLabels);

It ended up not being a problem with any of the Wigman plugin files, but an issue with the ConfigurableMediaImages.arrayIntersect() function.

I rewrote the function and now everything is working properly:

arrayIntersect: function(a, b) {
    var result = new Array();
    for( var i=0; i<a.length; i++ ){
        if( b.indexOf(a[i])>-1 ){
            result.push( a[i] );
        }
    }

    return result;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants