![]() |
|
#1
|
|||
|
|||
|
I have a product which has two size attributes and associated prices. That works OK. I want to add another service (these are fine art prints), matting. I tried using an option, but there is no room to tell the buyer what to do: You can say, "Please mat my print" but there is no room to tell the buyer that any text in the box below triggers this. A radio button would be nice.
So, one of the prostores people suggested an attribute. I did that, but now it replaces the size attributes. What do? RON |
|
#2
|
|||
|
|||
|
I don't know what your coding skills are, but I used options to drive additional "attributes and cost" as you mention. What I do is hide the option field, and display my own html elements (radio, dropdown, etc). When the person adds the item to the cart (clicks the add to cart button), I set the value of the hidden option using javascript, and prostores normal pricing functionality takes over from there. It works fine for me, but requires some comfort with coding.
|
|
#3
|
|||
|
|||
|
I can code (mostly in Java and C# with some HTML and Unix shell). Can you send me an example of how you do it (code snippet)? I probably won't do this for the first public version, but soon after.
|
|
#4
|
|||
|
|||
|
Here are the basics (this all happens in the product detail/add to cart templates. Please note that I had to merge the Product Detail and Add to Cart templates, so this is all in one template for me):
1. Add the custom service fields to the form and make them hidden. Code:
<input type="hidden" name="custom1" id="custom1"/> Code:
<select id="matteChoice" name="matteChoice">
<option value="">Please Select</option>
<option value="None">No Matte</option>
<ss:if test="$product.customService1Enabled">
<ss:if test="$product.customService1Fee <> 0">
<option value="Matted">Matted (add <ss:value source="$product.customService1Fee"/>)</option>
<ss:else/>
<option value="Matted">Matted (Free!)</option>
</ss:if>
</ss:if>
</select>
Code:
switch (document.getElementById('matteChoice')[document.getElementById('matteChoice').selectedIndex].value)
{
case '':
alert('You must select your Matte!');
document.getElementById('matteChoice').focus();
return(false)
break;
case 'None':
document.getElementById('custom1').value = '';
break;
case 'Matted':
document.getElementById('custom1').value = 'Matted (add $15)';
break;
}
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|