Skip to content

Instantly share code, notes, and snippets.

@mbertheau
Created January 5, 2015 10:43
Show Gist options
  • Save mbertheau/5258bb2e64380d808e78 to your computer and use it in GitHub Desktop.
Save mbertheau/5258bb2e64380d808e78 to your computer and use it in GitHub Desktop.
set_of_lines = SetOfLines([])
stock_info = basket.strategy.fetch_for_product(product)
new_line_ref = object()
set_of_lines.add_line(Line(new_line_ref, product, stock_info.stockrecord, 1,
stock_info.price.incl_tax))
applicator = Applicator()
offers = applicator.get_offers(request, basket)
applicator.apply_offers(set_of_lines, offers, request.user)
line = set_of_lines.get_line_by_reference(new_line_ref)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment