Page 1 of 1
Set ProductVariant / Options on Products.Product
Posted: Tue Apr 21, 2009 10:30 am
by moopa
Is it possible to set Product options without making a basketItem?
For example, I wish to set a default color and size (Options) for my Product and retrieve them from the instance at a later stage?
So pseudo code:
Code: Select all
Product myProduct = new Product();
myProduct.Load(_productId);
// SET DEFAULTS FOR COLOR
_colorOptionId = 2;
myProduct._colorOptionId.OptionChoiceId = 23;
// OTHER STUFF....
...
// GET VALUE FROM INSTANCE
int instanceChoice = myProduct._colorOptionId.OptionChoiceId; // = 23
Thanks
Re: Set ProductVariant / Options on Products.Product
Posted: Tue Apr 21, 2009 1:27 pm
by moopa
Hi again.
Just to reiterate in case my question didn't make sense, is there anyway to set options on an instance of a product?
Re: Set ProductVariant / Options on Products.Product
Posted: Wed Apr 22, 2009 2:46 am
by moopa
Hi.
Could the Ableteam shed some light on this please?
Re: Set ProductVariant / Options on Products.Product
Posted: Wed Apr 22, 2009 6:53 am
by mazhar
I think you are trying to specify some default values for options. You can check following trick may be it work, make use of ac_ProductCusomtFields and customize product admin side to have some interface where you can mark default value for each product option. Finally you can customize the product display area where ever you want product to be displayed with selected choices to take care of settings from ac_ProductCustomFields.
Re: Set ProductVariant / Options on Products.Product
Posted: Wed Apr 22, 2009 7:14 am
by moopa
Hi Mazhar.
Thanks for the reply. I can see that could work.
I have gone with making a new class that inherits from Product and adds properties that take optionChoiceId
All the best
Re: Set ProductVariant / Options on Products.Product
Posted: Wed Apr 22, 2009 7:22 am
by mazhar
Read following topic about how to use ac_ProductCustomFields.
viewtopic.php?f=44&t=9088
Re: Set ProductVariant / Options on Products.Product
Posted: Wed Apr 22, 2009 7:43 am
by moopa
Great stuff. Custom fields look very promising!
Thanks
