Skip to content

Instantly share code, notes, and snippets.

@winzard
Created January 23, 2018 14:50
Show Gist options
  • Save winzard/0f1792ab7b17b8d07ac1935581f7a463 to your computer and use it in GitHub Desktop.
Save winzard/0f1792ab7b17b8d07ac1935581f7a463 to your computer and use it in GitHub Desktop.
command change line
def change_line_product(line_id, product_id):
pass
if changed:
self.calculate_total()
def change_line_quantity(line_id, qty):
pass
if changed:
self.calculate_total()
def change_line_price(line_id, price):
pass
if changed:
self.calculate_total()
# vs
def change_line(line_id, product_id, qty, price):
self.change_product(line_id, product_id)
self.change_quanity(line_id, qty)
self.change_line_price(line_id, price)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment