Jump to:

2082 Posts in 1002 Topics by 452 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Universal Pricing Variations - Shop 0.8.5

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 475 Views
  • SnowBoarder82
    Avatar
    Community Member
    52 Posts

    Universal Pricing Variations - Shop 0.8.5 Link to this post

    Hey Guys,

    Using SS2.4.7 and Shop 0.8.5

    I am creating a website selling artwork. The pricing variations for the artwork are exactly the same for each product - the variations being for “dimensions” and “print medium”. However, sometimes a product may not have all of the variations applied to it.

    I would like to create a way where there is one place to create & edit these variations and pricing, which are then applied to every applicable product across the website - as opposed to each product having it's separate variations.

    I have started by creating a universal pricing class and admin to create the variations and pricing. I have also created a many to many relationship between the universal pricing and the product so that the optional relationship of a product having a certain variation can be selected in the cms for a product page.

    I am a little stuck with how to then incorporate these created variations into the cart functionality, to add an item to an order etc… Any clues?
    Also would there be a way to just integrate this desired outcome by modifying the main variation code instead?

    Thanks Guys, would definitely appreciate any help on this.

  • SnowBoarder82
    Avatar
    Community Member
    52 Posts

    Re: Universal Pricing Variations - Shop 0.8.5 Link to this post

    Any feedback on this guys,
    Thinking the best way to achieve this would be to somehow integrate it into the Variations functionality of the Shop module, or override this somehow... - any clues into how I would be best to go about this?

    Thank you,

  • Jedateach
    Avatar
    Forum Moderator
    227 Posts

    Re: Universal Pricing Variations - Shop 0.8.5 Link to this post

    I would approach this problem by not using the variations system. I faced the same issue when building http://www.printmighty.co.nz/. You have many products, and variations will always be the same, if not a subset of the possible variations.

    I would start by extending the Product model with something like “ArtProduct”.
    Then there’s a bunch of places you’ll need to make changes to the system:

    • Create a ArtProduct_OrderItem model (extends Product_OrderItem)
    • Create a ArtProduct_Controller (extends Product_Controller)
    • Create your model for storing sizings
    • Possibly add a ArtProduct many_many Sizings relationship to limit sizes.
    • Override the AddProductForm to allow choosing sizings
    • Create a special order item for storing the selected size in cart/orders
    • Update CMS ui, if necessary

    Hopefully this is enough to get you going, assuming you think it’s the best approach. It does introduce a bit of custom code, which will be more difficult to maintain as the shop module grows and develops. But that said, if you find ways of generalising things, then we could look at incorporating those kinds of things into the core, or a submodule.

    475 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.