Closed
Description
I feel like there may be a bug in the following file because the output of $product->getUrlInStore()
is not what I'd expect. Query params related to the store are added to the URL in the following file:
By setting an entire object ($subject->getScope()
) as the $storeCode
rather than just a string default
it is causing a very messy looking URL.
Preconditions
- Have a Magento installation with more than 1 store
- Add store code to URLs in configuration is set to "no"
- Magento version 2.2.3
Steps to reproduce
Use the following code where a product model is loaded and where you can see the result:
<?= $product->getUrlInStore() ?>
Expected result
The URL produced for the product would look like:
https://www.domain.com/my-product.html?___store=default
Actual result
The URL produced is actually very long winded:
https://www.domain.com/my-product.html?___store%5B_data%5D%5Bstore_id%5D=1&___store%5B_data%5D%5Bcode%5D=default&___store%5B_data%5D%5Bwebsite_id%5D=1&___store%5B_data%5D%5Bgroup_id%5D=1&___store%5B_data%5D%5Bname%5D=UK+Mainland&___store%5B_data%5D%5Bsort_order%5D=0&___store%5B_data%5D%5Bis_active%5D=1&___store%5B_data%5D%5Bavailable_currency_codes%5D%5B0%5D=GBP&___store%5B_data%5D%5Bbase_currency%5D%5B_data%5D%5Bcurrency_code%5D=GBP&___store%5B_data%5D%5Bcurrent_currency%5D%5B_data%5D%5Bcurrency_code%5D=GBP
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.1 release lineThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.3 release lineGate 1 Passed. Automatic verification of issue format passedThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release