4 votes

Cogworks Price Breaks For Tea Commerce

Intro
Allows a website administrator to enter different prices for Tea Commerce products based on the quantity being bought.

For example
Buy 20 things, pay (currency)20 per thing
Buy 40 things, pay  (currency)15 per thing
Buy 400 things, pay  (currency)1 per thing
etc etc,

Requirements

  • uComponents 3.1
  • .net 4

How to Install
  • Install the package
  • Go to your Tea Commerce product document type, and create a new property with an alias of "productPriceBreaks{Three Letter Currency ISO Code}" e.g. productPriceBreaksGBP
  • Choose the "[COG] Price Breaks" datatype
  • Repeat for as many currencies as you need

How to use
  • Go to a product in the content tree in the backoffice and populate as per the screenshot
  • Note: the Product Price field is the master Price
  • The Price Breaks field overrides the master Price at the appropriate quantity levels
  • Leave the price breaks field blank for no price breaks

Sample XML output for front end use

<productPriceBreaksGBP>
<items>
<item id="1">
<price nodeName="Price" nodeType="-88">25</price>
<applicableAtAndAboveQuantity nodeName="Applicable at and above (quantity)" nodeType="-88">5</applicableAtAndAboveQuantity>
</item>
<item id="2">
<price nodeName="Price" nodeType="-88">20</price>
<applicableAtAndAboveQuantity nodeName="Applicable at and above (quantity)" nodeType="-88">10</applicableAtAndAboveQuantity>
</item>
</items>
</productPriceBreaksGBP>


Testing, Extending etc
  • Doctype property aliases and various other settings can be customised in the price breaks config file in the config folder. This is cached, so the web config will need to be hit after modification.
  • You can exclude individual nodes from the price breaks logic - this could help with any conflicts. On the product doctype add a checkbox with property alias "excludeFromPriceBreaks" (this property alias is configurable in the config if you want to call it something else) If this is box ticked - the product (and all children of the product) will be excluded from price breaks. If it's a master product then all children of the master product and all related products in the product tree will be excluded from the logic.
  • You can exclude certain node types from prices breaks logic if there is a conflict. This can be activated from the config file.
  • Advanced varients mode (AVM) assumes you have a set up along these lines: http://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/34793-Levels-of-variants-on-one-product and that as a result, you want to apply price breaks accross multiple order lines. This can be activated from the config file.
  • Tested with umbraco 4.7.0. I imagine it is compatible with any version of Umbraco that meets the requirements above?
  • Tested with Tea Commerce versions 1.4.3.1 and 1.4.2.4. I imagine it is backwards compatible!?
  • I imagine it will crash horribly with lots (100 or more?) price breaks per product. Currently the data type is limited to 10.

Revision History
  • Version 2.0 Beta. Added support for Master Products. Added support for variants. Added ability to exclude individual nodes from price break logic. Added ability to exclude certain node types from price breaks logic. Added "Advanced variants mode".
  • Version 1.1 - Refactor Price breaks to not create new OrderLineProperites as there are breaking changes across different versions of the Tea Commerce API

Let me know if there are any issues and I will do my best to fix,

Enjoy :)

Screenshots

Package owner

Tom Smith

Tom Smith

Tom has 172 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions:

Package Information

  • Package owner: Tom Smith
  • Created: 18/05/2012
  • Current version 2.0 Beta
  • License MIT
  • Downloads on Our: 605