I guess there will need to be some kind of 'if' statement to check if there are variants and to bring back the image that relates to the variant. If there are no variants that it shows the main product image.
Might the 'if' look something like this taken from product_options.tpl:
```php
variant_images[{$id}][{$po.option_id}] = {$ldelim}{$rdelim};
{if $var.image_pair}
variant_images[{$id}][{$po.option_id}][{$var.variant_id}] = {$ldelim}
'image_path': '{$var.image_pair.icon.image_path|escape:javascript}'
{$rdelim}
{/if}
```
Any ideas or suggestions would be gratefully received :grin:
Fived
[COLOR="Red"]EDIT: [/COLOR]please jump to [URL="http://forum.cs-cart.com/showpost.php?p=63472&postcount=13"]http://forum.cs-cart.com/showpost.php?p=63472&postcount=13[/URL] to see solution!
Hey Fived, I think the cart already works this way, at least it seems to for me. I think all you have to do is setup option combinations for your variants and assign images to them. See page 90 of the user manual for more info on this but basically all you do is first add your options set and checkmark “inventory” (even if you don’t do anything with inventory) and then once you click on Option Combinations, click “rebuild combinations” and a list of all your options will be displayed and you can assign images to each one.
I think the difference between this route and the regular assigning images to variants route is twofold. One, you can setup little thumbnail swatches for your variant images and then assign larger images to each swatch so that when you click on a swatch or select a variant from the drop down your big image is replaced. Two, your variants are assigned images which then display on the wish list and cart. Not to mention a list of other powerful things you can do with your options
What I’ve done is create a global color option set with all my color thumbnails that show up under the color drop down for each product. The beauty in this system is that I can add the global set to a product and get all my color thumbnails and then use the option combinations to assign my specific images to each color for each article of clothing. It’s been a bit of work getting all this figured out and working but I think it will be worth it in the end because of what it does for the customer experience.
I hope this has been informative for you and get’s you on the right path for what you want to do. Let me know if I can be of further assistance.
Thanks for your reply Jonah, sorry for delay in replying only I didnt get a notification through the forum :rolleyes:
I think maybe I didnt explain myself very well! I had previously gone through all the process that you mentioned in your post and my cart was not reflecting the product variant image, it was showing the product main image. This is why I posted to the forum.
So Jonah when you are in your cart page ie the page just before checkout(this is not product detail page) in the list of products that are included in your shopping cart do your images reflect your variant or your main product image?
I will now also try to see why the forum didnt notify of a reply :?
Yes, when I am on the cart page of my site, for any products where I’ve setup option combinations, if I switch to a different option that has an image, it swaps the image right there. You can try it out on our site if you go to the link I posted earlier - it’s going live sometime tomorrow and the link will be valid until then.
Check it out, and then try setting up those option combinations - they work wonders!
I just wanted to tell you that your site is very nice. I went in to take a look around and test the option colors. You’re right, it does the work the way you say it does which is what I thought I remembered from my site, too. Good luck with your new store…I think it’s a very well laid out site.
Btw…how did you get that notification box to appear in the middle of the screen when the item is added to the cart? I really like that!
@joe: Hey take it easy… I’m working on the different browsers right now - I said it’s going live sometime tomorrow
But I’ll tell you what, there is no way I’m going to work to make IE6 work - instead I’ve installed IE6 Update - I’m done spending hours upon hours to make a site work in a 10 year old browser! That is of course unless a client is willing to pay… But the Wild Child site is my parents business and I’m making the calls here!
@scase: Thanks for the praise! I made a couple edits to the CSS for the notification box to get it positioned in the middle of the screen. It wasn’t too hard and I’d be happy to share if you can’t figure it out.
[quote name=‘jonahcoyote’]@joe: Hey take it easy… I’m working on the different browsers right now - I said it’s going live sometime tomorrow
But I’ll tell you what, there is no way I’m going to work to make IE6 work - instead I’ve installed IE6 Update - I’m done spending hours upon hours to make a site work in a 10 year old browser! That is of course unless a client is willing to pay… But the Wild Child site is my parents business and I’m making the calls here!
@scase: Thanks for the praise! I made a couple edits to the CSS for the notification box to get it positioned in the middle of the screen. It wasn’t too hard and I’d be happy to share if you can’t figure it out.[/QUOTE]
I have definitely followed the setting up of options and variants with images correctly. So I guess it can only be a code issue. Perhaps one that I have played with, that is pivotal. I have checked back to other templates to see the differences and I can’t see anywhere that might be an issue.
Could I possibly ask a really huge favour could you possible copy the code that you have for your cart_items.tpl. I am wondering if something is amiss.
Thank you for your continued support Jonah.
Still not getting email notification of forum responses, so I will try to check back regularly.
I compared the files and there was one tiny, critical element missing from my cart_items.tpl
So for any in the future that may play with the code and the cart product images does not correctly reflect the variant image, the code in red is what is critical!:
Ahhh yes, that dropdown is dynamic. It’s the Top Menu with the main menu items as our main categories and the dropdowns sub-categories of those main cats. The look though is all done with custom CSS by me.