We’re rewarding the question askers & reputations are being recalculated! Read more.
24

$productCollection = $productObj; Gives from product collection url using loop the collection, foreach($productCollection as $_product){ echo $_product->getProductUrl(); }


7

It's fine to have category paths in URL's as long as you also enable canonicals (system->config->catalog->seo->canonical for categories/products->yes). This will stop any duplicate content issues.


7

Although Swagger doesn't specify "url_key", you can add this attribute value by the following method: { "product": { ... "customAttributes": [ { "attributeCode": "url_key", "value": "<your_value>" } ] } } Note: Next time, you can use GET to know the product JSON structure first. Then any customized ...


5

Try to edit 1st level or 2nd level categories and simply save it and it will generates rewrites for products assigned to that category. This worked for me when i migrated store from Magento 1 to Magento 2.


4

The problem is that the synthax is not the same when there is variable in URL. Please try RewriteCond %{QUERY_STRING} ^format=ATOM$ RewriteRule ^Blog/post/feed/2013/06/20/NASA-Gets-In-On-the-Search-and-Rescue-Game-to-Further-Space-Exploration$ http://www.actuatorzone.com/blog? [L,R=301]


4

You can do this by using catalog_product_save_befoe event .Here details below code MageStack_24869.xml of app\etc\modules\ <?xml version="1.0" ?> <config> <modules> <MageStack_24869> <codePool>local</codePool> <active>true</active> </MageStack_24869> </modules> &...


4

if you are loading product then you just need to set store id in product object like below $store = Mage::app()->getDefaultStoreView(); // Gets the current store's id $this->_storeId = $store->getStoreId(); $product->setStoreId($this->_storeId); and then you can try with echo $product->getProductUrl();


4

Turns out it was an external job running from cron. We created a script to remove special pricing from products. The problem was that the script was not loading the entire product object. When it removed the pricing and saved the product the url_key was removed as well. The job grabs a collection of all the products with expired special pricing. First I ...


4

You could get the product id from the core_url_rewrite table using the url for this, try this: $url = Mage::helper->getURL(); $rewrite = Mage::getModel('core/url_rewrite') ->setStoreId(Mage::app()->getStore()->getId()) ->loadByRequestPath($url); $productId = $rewrite->getProductId(); $product = Mage::getModel('catalog/product')-&...


4

There could be a lot of causes. your db is inconsistent and there is not url_path for your product. (most probably this is not it) Your intexes are not up to date You are calling $product->getUrlPath() from a product collection and the url_path attribute is not added to the collection. The correct way to add them is like this: $collection = Mage::...


4

In javascript you can get hash value like this var hash = window.location.hash; and in php you can do like this $url = parse_url("http://localhost/b/index.php/review/product/list/id/27/#review-form"); $val = $url["fragment"]; $val is your hash value


4

The issue resolved with below solution. As I said url_key was not regenerating only with Migrated Products from Magento 1 to Magento 2 with UB Migration Tool Lite Extension. At the time of Migrating the products UB Migration Tool created multiple url_key and url_path entries for each product instead of creating just 1 entry for url_key. So I deleted the ...


3

Better approach imo would be to look up product url using core_url_rewrite table. At least you avoid full product load. $productUrls = array(); $idPath = 'product/887'; $rewrite = Mage::getResourceModel('core/url_rewrite'); $read = $rewrite->getReadConnection(); $select = $read->select() ->from($rewrite->...


3

I had the same issue with the CREARESEO extension. I fixed it by doing the following: Open /app/code/community/Creare/CreareSeoCore/Model/Observer.php Find: public function forceProductCanonical(Varien_Event_Observer $observer) { if (Mage::getStoreConfig('catalog/seo/product_canonical_tag') && !Mage::getStoreConfig('product_use_categories'...


3

Alyssa, you can remove old redirect in Magento admin backend in Catalog -> URL Rewrite Management. Try to filter grid by entering your old URL key in Request Path field. If you use Magento 1.13 or newer, this grid is accessible in Catalog -> URL Redirects.


3

In the CMS pages and the static blocks you should use the Catalog Category Link widget: {{widget type="catalog/category_widget_link" template="catalog/category/widget/link/link_block.phtml" id_path="category/5"}} If you use this the correct links will be built on each store and you won't have to rewrite them.


3

Here's a number of options: Update the URL keys the same way you updated the product titles. Export, transform values, import. Unset the URL keys programmatically and have them regenerated automatically. While the former are rather self-explanatory, this is how the scripted approach looks like: $collection = Mage::getModel('catalog/product')->...


3

Since you don't have access to URLs from the URL rewrites you'll need to add a setStoreId() when loading the product. Note, it's faster to have a URL key and query it instead of loading up the entire product Model. $productId = 1234; $product = Mage::getModel('catalog/product') ->setStoreId(2) // set your store ID ->load($...


3

you can export the id, sku, name and request & target paths with this sql: select e.entity_id, e.sku, ev.value as name, u.request_path, u.target_path from catalog_product_entity e inner join catalog_product_entity_varchar ev on ev.entity_id = e.entity_id and ev.attribute_id = (select attribute_id from eav_attribute a inner join eav_entity_type ...


3

I got reference for the answer from this answer and I add addition part to show url_key column, please try this sql query : SELECT e.entity_id AS 'id', v1.value AS 'name', v0.value AS 'url_key', e.sku, d1.value AS 'price', t1.value AS 'short_description', t2.value AS 'description', v2.value AS 'image', ...


2

I am not sure if this works also for direct_url's but you might also be interested in the Magento Languages URL's extension: https://github.com/klein0r/magento-language-routes Magento Language Routes Features: Translate all URLs for each store (e.g. /customer/account/create -> /kunde/konto/erstellen) Easy translation without development skills by using ...


2

Check whether you've actually set the URLs on the right scope on import. You've got a minimum of two scopes (website and store) that the URL can be defined on. If you have imported your new URLs under a different scope, then when you reindex you'll have URLs generated for both.


2

Magento have a feature to back to last visited page after product cart and prevent to goto cart page. and it has been managed from admin. Setting: admin>System>Configuration>Sales>Checkout>Shopping Cart and make the value of After Adding a Product Redirect to Shopping Cart to no If you will enable this setting from admin then you can easy ...


2

I assumed this could be the reason of the get productUrl and i found the solution, which is: instead of getProductUrl use getUrlPath()


2

I don't have much code for this, but I have an idea. You will have to do things a bit different than the default approach Magento has for configurable products. By default, the configurable product is visible and the simple products associated are not visible. You will have to do it the other way around. Configurable product is not visible and the simple ...


2

Please follow these steps Jelle. back up your database I suppose that your url_key attribute code for product will have attribute_id = 97 You can check by run this query SELECT attribute_id FROM `eav_attribute` where `attribute_code` = 'url_key' and `entity_type_id` = 4 run this query DELETE FROM catalog_product_entity_varchar WHERE attribute_id = 97 ...


2

I got this patch from Magento Support: SUPEE-7854 (New products and categories will not display on front end unless we reindex all) NOTE: This patch includes the fix from SUPEE-7345 --- URL Keys are in incorrect, non-SEO format Which I installed, and then flushed the URL redirect tables as specified above, and reindexed. The patch and reindexing ...


2

As per as your code,you have tried to get product($product) 's Seo Url from a product collection ($categoryProducts). In order to get seo url you need to add addUrlRewrite() function to that collection ($categoryProducts). So changes <?php $product = $categoryProducts->getFirstItem();?> to <?php $categoryProducts->addUrlRewrite(); $...


2

I hope this will help you. It works for me $products=Mage::getModel('catalog/product')->load($productid); return $products->getUrlModel()->getProductUrl($products);


2

You can use product sku value in product "URL Key" field. Or You can use an extension for custom product URL. Its free and easy to use. https://www.magentocommerce.com/magento-connect/catalog/product/view/id/30396/s/custom-product-urls-seo/


Only top voted, non community-wiki answers of a minimum length are eligible