change the context_processor in the shopping cart to return a pointer to... - #6242
Conversation
|
@jbau @cpennington @andy-armstrong This will fix the performance issue regarding shopping cart Mako context processing. @jbau since I was in that area of the code, I opportunistically implemented an "does shoppingcart exist" check for us to be able to stop creating empty shoppingcarts when people simply visit the site. This is something we talked about in the past, so I figured I'd just go for it while I was in here :-) |
There was a problem hiding this comment.
I had trouble reading this until I realized that the function doesn't actually display the shopping cart. I think it would be clearer if it was named something like 'should_display_shopping_cart_fun' or 'has_shopping_cart_func' or something like this that implies that it will return a boolean.
There was a problem hiding this comment.
This function is also missing a doc string which is why the quality build failed.
|
👍 Thanks for tackling this so quickly, @chrisndodge. |
4fcae3b to
b168087
Compare
… to a function so that only the templates that actually need to know if the shopping cart button should be shown will actually make the database roundtrips
b168087 to
1148366
Compare
|
@andy-armstrong renamed methods to be more descriptive. Need to rebuild due to a method name being too long :-( |
|
👍 |
…ection change the context_processor in the shopping cart to return a pointer to...
... a function so that only the templates that actually need to know if the shopping cart button should be shown will actually make the database roundtrips