Home Forum
Welcome, Guest
Please Login or Register.  Lost Password?
Go to bottomPage: 1
TOPIC: Putting the Option Name under the larger selected
#2
Putting the Option Name under the larger selected 1 Year, 6 Months ago  
Hi,

Firstly let me say what a great product, it is perfect for my customer who does cosmetics and need images of all the shades. It's a bit longwinded to add PAP images, and the attributes using QT Pro but delivers what the customer wants so makes me happy!

I have managed to hack around with the code a bit and have the name field giving the Product name when hovering over the Thumb picture using <a name="" > but I'd really love to get the Option Name to appear under the Select Option (larger image) when selected, so that the users can see the name of the option they have selected, as well as the image. For my example, if they select colour thumb "Red" under the select option it reads Red, then if they select the colour thumb image "Green" the Select Option image changes to Green and under the image it now reads Green.

I was messing around with this code snippet :

<?php if($heading_conf['sav']) echo str_replace('[',' ',$paps_delegate->getAttributeOptionName($arr_attrib_arrays[$i][$x])); ?>

but it doesn't output anything when I put it under the Selected Option image. I'm really new to php so I'm guessing it is something to do with the if else loop being closed before this section but I can't figure out how or where.

Anyways, I hope someone can assist with how I can do this,

Thanks in advance,

Quentin
ukelele
Moderator
Posts: 131
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#3
Re: Putting the Option Name under the larger selected 1 Year, 6 Months ago  
Hi Quentin

Thanks for your enquiry.

First of all, let me quickly say that the premium version (v5.0) of PAPs solves BOTH of your problems - it sets up native attributes when uploading image files (no need to deal with the 'Product Attributes' admin page at all), AND it dynamically changes the selected image title as you require. You can see this in action if you set it up in the 'Interactive Demo' page.

Right, plug over. Your problem is that you are trying to code client-side dynamics with PHP alone. This can't be done. You need to use Javascript. Roughly, these are the steps you need to take:

1) Set up a div HTML element where you want the dynamic attribute values to change. Give it id="att_val_names" or something like that.

2) When the thumbnail is clicked, part of the 'onclick' code should be

document.getElementById("att_val_names").innerHTML=XXX;

where XXX is the attribute value generated by PHP for each image. So this line should be generated via PHP inside the 'onclick' parameter of each image.

This is just a very general overview and there are various ways of achieving your goal with Javascript, but hopefully this will give you a start.

Regards

Nick
ukelele
Moderator
Posts: 131
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1

Copyright © 2012 Product Attribute Pictures. All Rights Reserved.