My magento store has 3 languages. If someone links me a product from the "English" store view for example, and I'm on the "Spanish" store view, that product returns a 404 error.
So far in my investigation I've found this blog, but I'm currently trying to understand where that code goes. I understand it's in the file /app/code/core/Mage/Core/Model/Url/Rewrite.php
but I can't figure out where exactly in that file I should add that code snippet.
And I ain't even certain that will solve my problem.
Edit:
Ok, I've found this link: http://freegento.com/doc/db/d5d/_url_2_rewrite_8php-source.html
According to this, my file should have something similar to what I saw in the blog above, unfortunately, the function loadByRequestPath
on my file is different and it goes like this:
/** * Load rewrite information for request * If $path is array - we must load possible records and choose one matching earlier record in array * * @param mixed $path * @return Mage_Core_Model_Url_Rewrite */ public function loadByRequestPath($path) { $this->setId(null); $this->_getResource()->loadByRequestPath($this, $path); $this->_afterLoad(); $this->setOrigData(); $this->_hasDataChanges = false; return $this; }