Skip to content

[Draft] Product override #17

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

Merged
merged 6 commits into from
Jan 12, 2021
Merged

Conversation

akaplya
Copy link
Contributor

@akaplya akaplya commented Nov 30, 2020

Description (*)

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/catalog-storefront#<issue_number>

Questions or comments

Code Review Checklist (*)

  • Story AC is completed
  • proposed changes correspond to Magento Technical Vision
  • new or changed code is covered with web-api/integration tests (if applicable)
  • no backward incompatible changes

@akaplya
Copy link
Contributor Author

akaplya commented Nov 30, 2020

@magento run all tests

Copy link
Contributor

@rossbrandon rossbrandon left a comment

Choose a reason for hiding this comment

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

I'm still going through some of the more detailed pieces of the query builder/processor, but it looks good so far. Very interesting. I do have some comments/questions regarding usage of query xml vs in code queries and what exactly defines a "legacy feed"


## Release notes

*Magento_DataExporter* module
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: module name copied over here

<filter glue="and">
<condition attribute="entity_id" operator="in" type="placeholder">entityIds</condition>
</filter>
<link-source name="store_website">
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the equivalent of

select cpip.entity_id, ..., sw.code as websiteCode from catalog_product_index_price cpip inner join store_website sw on sw.website_id = cpip.website_id

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, join behavior can be changed through the instruction link type

/**
* Product export feed indexer class
*/
class LegacyFeedIndexer implements IndexerActionInterface, MviewActionInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

What makes a feed "legacy"? Is it because the queries are in code vs in XML?

If so, could it be possible to use either XML query or an in code query? There may be cases where XML is more limiting and a more complex query is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have trouble finding a proper name, this particular class coupled to products and can not be reused, but in the future, I do want to have it at all. for now, removing could cause unnecessary refactoring ...

<attribute name="final_price" alias="finalPrice"/>
<attribute name="min_price"/>
<filter glue="and">
<condition attribute="entity_id" operator="in" type="placeholder">entityIds</condition>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little confused on how these get populated. How is the placeholder actually used in calling this?

public function get(array $values): array
{
foreach ($values as $value) {
$queryArguments['entityIds'][] = $value['productId'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the injection of placeholders in the query XML?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not exactly, it rather preparation of arguments that will be passed

<attribute name="tax_class_id"/>
<attribute name="price" alias="regularPrice"/>
<attribute name="final_price" alias="finalPrice"/>
<attribute name="min_price"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do JSON parsing selects here like feed_data->'$.prices.maximumPrice.finalPrice'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not now, but it is easy to add.

mmansoor-magento pushed a commit that referenced this pull request Dec 10, 2020
…e-data-export-16

[Imported] CatalogExportApi auto-generation
@mmansoor-magento mmansoor-magento merged commit c2696b2 into magento:main Jan 12, 2021
magento-devops-reposync-svc pushed a commit that referenced this pull request Nov 4, 2021
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