|
|
@@ -165,6 +165,11 @@ class AbstractBasket(models.Model):
|
|
165
|
165
|
The 'options' list should contains dicts with keys 'option' and 'value'
|
|
166
|
166
|
which link the relevant product.Option model and string value
|
|
167
|
167
|
respectively.
|
|
|
168
|
+
|
|
|
169
|
+ Returns (line, created).
|
|
|
170
|
+ line: the matching basket line
|
|
|
171
|
+ created: whether the line was created or updated
|
|
|
172
|
+
|
|
168
|
173
|
"""
|
|
169
|
174
|
if options is None:
|
|
170
|
175
|
options = []
|
|
|
@@ -213,6 +218,9 @@ class AbstractBasket(models.Model):
|
|
213
|
218
|
line.quantity += quantity
|
|
214
|
219
|
line.save()
|
|
215
|
220
|
self.reset_offer_applications()
|
|
|
221
|
+
|
|
|
222
|
+ # Returning the line is useful when overriding this method.
|
|
|
223
|
+ return line, created
|
|
216
|
224
|
add_product.alters_data = True
|
|
217
|
225
|
add = add_product
|
|
218
|
226
|
|