1999 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Product attributes in ecommerce module
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 2460 Views |
-
Product attributes in ecommerce module

10 August 2009 at 12:21am Last edited: 10 August 2009 12:28am
Hello!
The e-commerce module is pretty complex and I'm realizing that i should ask you who might have build it before I go crazy.I'm wondering how I can implement attributes for a product. For instance, one product can be in different colors that shouldn't affect the price. However the user must chose a color on the product-page before adding to cart. I can't say its obvious how to implement such functionality. I would very much appreciate all the help you can give. I've started to look at the orderattribute class but it's still not obvious.
Another, more secondary, question is why it is not possible to add several variations of the same product to your cart. I've noticed that if I add a product variation to my cart, and then add the same product with another type of variation, the former addition just disappears. I just got one item in my cart and it's the latest product variation addition. The first addition is gone. Weird right? How can i approach this?
I'll be glad for some pointers!
Thanks -
Re: Product attributes in ecommerce module

10 August 2009 at 12:57am
Ok i Solved my secondary question.
What I did was that in shoppingcart.php i edited the funtion add_new_item so that it checks if you are trying to add a productvariation or a product:
FROM: self::set_item($item->getProductID(), $item);
TO: if(($item->getProductVariationID())){
self::set_item($item->getProductVariationID(), $item);
}else{
self::set_item($item->getProductID(), $item);
}Further i added functions in productvariation.php, in class "ProductVariation_OrderItem". I overrode the removeallLink, removeLink, addLink, setquantityLink that it inherited from product_orderitem.
ex: function removeallLink() {
return ShoppingCart_Controller::remove_all_item_link($this->_productVariationID);
}Now it seems to work.
Now if i only could add product attributes in a simple way....
-
Re: Product attributes in ecommerce module

5 October 2009 at 5:54am
Thanks a lot for this! I got it working now. May I add that you also need to add the function getProductVariationID() as well.
function getProductVariationID() {
return $this->_productVariationID;
}Cheers!
-
Re: Product attributes in ecommerce module

9 October 2009 at 1:39pm
how did you get on with Product attributes, did you find a solution ?
-
Re: Product attributes in ecommerce module

9 July 2010 at 6:41am
Ive got it all working: see post
http://www.silverstripe.org/e-commerce-module-forum/show/288081?showPost=288136
| 2460 Views | ||
|
Page:
1
|
Go to Top |



