Note: This is on Magento EE 1.13.1.0
I had to extend Mage_Catalog_Model_Api2_Product_Rest_Guest_V1::_prepareProductForResponse to make some custom changes to the product feed. But, interestingly, the url being returned from the products has the admin url, and not the frontend store url. For isntance, I make this call to the API:
http://store.example.dev/api/rest/products?store=33&limit=100&page=1&category_id=63
And the tag returned in the feed is this:
http://admin.example.dev/index.php/the-product.html
Instead of:
http://store.example.dev/the-product.html
Near the top of the _prepareProductForResponse method, I can see that it's trying to set the website id on the product object:
$product->setWebsiteId($this->_getStore()->getWebsiteId());
But that doesn't seem to have any effect. I tried setting the store id instead with:
$product->setStoreId($this->_getStore()->getId());
That works to get the correct url, but it also ends up adding the store parameter to the url, even though the system config is set to not display it.
I thought about doing a preg_replace to just remove the store param, but that is hacky, and I don't want to do that.
Anybody have any ideas on how to fix this?