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

[SR-102] Suggestion - Change the SKU's displayed to normal products names and add hyperlinks #197

Open
wants to merge 5 commits into
base: spree-reports
Choose a base branch
from

Conversation

pl-spark
Copy link

No description provided.

@pl-spark pl-spark force-pushed the SR-102-use-names-instead-of-skus-in-product-reports branch 2 times, most recently from 03ee60b to 9c33d61 Compare December 16, 2019 08:10
@pl-spark pl-spark force-pushed the SR-102-use-names-instead-of-skus-in-product-reports branch from 9c33d61 to c898043 Compare December 16, 2019 08:59
variants = variants.group('spree_variants.sku')
.select('spree_variants.sku, sum(spree_line_items.quantity * spree_prices.amount) as line_item_total')
variants = variants.group(
'spree_variants.id',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'spree_variants.id',
"#{Spree::Variant.table_name}.id",

please don't hardcode table names in SQL queries

'spree_variants.id',
'spree_variants.is_master',
'spree_variants.product_id',
'sum(spree_line_items.quantity * spree_prices.amount) as line_item_total'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@piotrleniec-spark this calculation is wrong, it doesn't include discounts or tax, this can be fetched from LineItem model

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damianlegawiec fixed ✅

… github.com:spark-solutions/spree into SR-102-use-names-instead-of-skus-in-product-reports
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

Successfully merging this pull request may close these issues.

3 participants