Variation with photo

  • aluminiumtechnik
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0

aluminiumtechnik replied the topic: Variation with photo

THX :-)
#208301
  • helena.dobrovic
  • helena.dobrovic's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 1511
  • Karma: 48
  • Thank you received: 129

helena.dobrovic replied the topic: Variation with photo

Hi,

you can take a look now. It's functioning. :)

I've adjusted script which is following:
    // ****************BreezingCommerce custom script*********************** //
    
  $('[name="crbcProperties[]"]').change(function() {
  
  if($('[name="crbcProperties[]"]').val() == "893") {
  
  $("#crbc-zoom-thumbnails li:first-child").addClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(2)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(3)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(4)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(5)").removeClass("current-img");
      
  $("#crbc-zoom-thumbnail").attr("src", "/images/breezingcommerce/products/large/rollfix_300_fussplatte-410521383180763378910864968531862245361.png");
  
  }
  
  else if ($('[name="crbcProperties[]"]').val() == "892") {
  
  $("#crbc-zoom-thumbnails li:first-child").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(2)").addClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(3)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(4)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(5)").removeClass("current-img");
      
  $("#crbc-zoom-thumbnail").attr("src", "/images/breezingcommerce/products/large/rollfix_300_150rollemitspindel-121834821221392737397607459261597342772.png");
  
  
  }
  
  else if ($('[name="crbcProperties[]"]').val() == "874") {
  
  $("#crbc-zoom-thumbnails li:first-child").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(2)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(3)").addClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(4)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(5)").removeClass("current-img");
  
    $("#crbc-zoom-thumbnail").attr("src", "/images/breezingcommerce/products/large/rollfix_300_mit_dreieckausleger-1071588253146619429916052290901970664305.png");

  }
  
  else if ($('[name="crbcProperties[]"]').val() == "873") {
  
  $("#crbc-zoom-thumbnails li:first-child").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(2)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(3)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(2)").addClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(3)").removeClass("current-img");
  
    $("#crbc-zoom-thumbnail").attr("src", "/images/breezingcommerce/products/large/rollfix_300_fussplatte-8696984275471887812513234481864908037.png");

  }
  
  else if ($('[name="crbcProperties[]"]').val() == "872") {
  
  $("#crbc-zoom-thumbnails li:first-child").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(2)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(3)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(4)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(5)").addClass("current-img");
  
    $("#crbc-zoom-thumbnail").attr("src", "/images/breezingcommerce/products/large/rollfix_300_teleskoptraverse-149437142681167175317626404021460220268.png");

  }

  else {
  
  $("#crbc-zoom-thumbnails li:first-child").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(2)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(3)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(4)").removeClass("current-img");
  $("#crbc-zoom-thumbnails li:nth-child(5)").removeClass("current-img");
  
  
  }
  
});

// ****************End of BreezingCommerce custom script*********************** //

It's inside main.js file.

Let us know if this works for you.

Kind Regards,
Helena

=========================================
Need to renew Pro Support?
Buy Here!
=========================================
Satisfied?
Consider a membership!
=========================================
Like us on Facebook
=========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
#208328
  • aluminiumtechnik
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0

aluminiumtechnik replied the topic: Variation with photo

Hi Helen thank you very much :-)
My question: what means this: if($('[name="crbcProperties[]"]').val() == "893") { the number 893 ? Its an id from product?

I have more than one product to enter in this konfigurator. Indeed a lot of them, how can I give this code to another product with outer images? Need an ID?

And I have to put accessories to every product. Is there an possibility to set an small foto to it? See here: konf.altec-alu.de/rollfix/fahrgeruste/31733-rollfix-300

We don't want display the thumbnails and so I setist display:none;
And finaly how or where can I show the productimage bigger and also the zoom? He is very small in the moment.

THX Roman
#208335
  • helena.dobrovic
  • helena.dobrovic's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 1511
  • Karma: 48
  • Thank you received: 129

helena.dobrovic replied the topic: Variation with photo

Hi,

we did some adaptation to make it easier for you :)

Please see following code:
   // ****************BreezingCommerce custom script*********************** //
    
  $('[name="crbcProperties[]"]').change(function() {
  
  if($(this).children("option:first-child").is(":selected")) {
  
  
  $("#crbc-zoom-thumbnails li:first-child").trigger("click");
 
  
  }
  
  else if ($(this).children("option:nth-child(2)").is(":selected")) {
  
 
  $("#crbc-zoom-thumbnails li:nth-child(2)").trigger("click");
  
  
  }
  
  else if ($(this).children("option:nth-child(3)").is(":selected")) {
  
 
  
  $("#crbc-zoom-thumbnails li:nth-child(3)").trigger("click");

  }
  
  else if ($(this).children("option:nth-child(4)").is(":selected")) {
  
 
  
  $("#crbc-zoom-thumbnails li:nth-child(4)").trigger("click");

  }
  
  else if ($(this).children("option:nth-child(5)").is(":selected")) {
  
  
  $("#crbc-zoom-thumbnails li:nth-child(5)").trigger("click");

  }

  
});

// ****************End of BreezingCommerce custom script*********************** //

The principle is when you choose one of the options they are gonna be triggered automatically. That means you don't need to put values and images in your code anymore.

When you want to add new value just add new else if statement with increased nth-child(numberWhichFollows)

Let us know the feedback.

Regards,
Helena

=========================================
Need to renew Pro Support?
Buy Here!
=========================================
Satisfied?
Consider a membership!
=========================================
Like us on Facebook
=========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
#208344
  • helena.dobrovic
  • helena.dobrovic's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 1511
  • Karma: 48
  • Thank you received: 129

helena.dobrovic replied the topic: Variation with photo

Hi,

I'm just double checking is everything good now :)

Did you test it?

Regards,
Helena

=========================================
Need to renew Pro Support?
Buy Here!
=========================================
Satisfied?
Consider a membership!
=========================================
Like us on Facebook
=========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
#208419
  • aluminiumtechnik
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0

aluminiumtechnik replied the topic: Variation with photo

Hi still not, I have to make outer things today :-(

Monday I can try ist and will give you feedback.

THX Roman
#208420
Time to create page: 0.069 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here