Question

In short: Retrieving a product URL with additional params doesn't work in CE 1.8 & EE 1.13.

URLs have changed with the latest version of Magento. Previously in CE 1.7 and EE 1.12 calling $this->getAddToCartUrl($_product) from a product list would run through the following stages:

  1. Mage_Catalog_Block_Product_Abstract::getAddToCartUrl()
    • Here it would add the query param "options" with the value "cart"
  2. Mage_Catalog_Block_Product_Abstract::getProductUrl()
    • This method essentially gets a value from the URL model
  3. Mage_Catalog_Model_Product_Url::getUrl()
    • A lot of processing occurs until the URL is finally generated, complete with the query parameters originally passed in

Now, with CE 1.8 and EE 1.13, step 3 Mage_Catalog_Model_Product_Url::getUrl() starts like this:

$url = $product->getData('url');
if (!empty($url)) {
    return $url;
}

Because the products in the list have URL data already, the query parameters are not added and the final URL does not contain ?options=cart.

My question: Is this a bug or a feature?

Was it helpful?

Solution

Wow, quite the delta for that class from 1.7.0.2 -> 1.8.0.0! Whereas there are substantial changes this class, and that this is "breaking behavior", it should be considered a bug and should be submitted to EE support.

There is nothing exceptionally novel or edgy about this previously-valid functionality, and even in a minor version update breaking changes should not exist (hence Magento 2).

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top