Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There should be a standard/minimum required fields for serializing sale.line for cart #84

Open
tarunbhardwaj opened this issue Mar 4, 2015 · 1 comment

Comments

@tarunbhardwaj
Copy link
Contributor

{
    'display_name': '<>',  # This can be line.description or product.name
    'url': '<>',           # URL to render item
    'image': '<>',         # Thumbnail image to render for item, like product thumb image
    'remove_url': '',      # 'DELETE' request on this url, will remove this item from cart
    ...
}

Here:

nereid-cart-b2c/sale.py

Lines 163 to 173 in daa90bc

res.update({
'id': self.id,
'product': self.product.serialize(purpose),
'quantity': number_format(self.quantity),
'unit': self.unit.symbol,
'unit_price': currency_format(self.unit_price),
'amount': currency_format(self.amount),
'remove_url': url_for(
'nereid.cart.delete_from_cart', line=self.id
),
})

This will help in changing line rendering according to line type, without any change in web template.

@tarunbhardwaj
Copy link
Contributor Author

@sharoonthomas @prakashpp thoughts 💭 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant