title: Magmi url_key slug - how to include sku?
body: <p>I'm trying to figure out the best course of action to change URL keys in the store to be name-sku.html</p>
  
  <p>Currently MAGMI seems to be dictating the url key, which is fine.  Some of our products are not imported through MAGMI, so I think I'd probably have to also use the updateurl event to change the url on save -- I found this here for that -- <a href="https://magento.stackexchange.com/questions/24869/manufacturer-in-product-url-key">https://magento.stackexchange.com/questions/24869/manufacturer-in-product-url-key</a></p>
  
  <p>The question is, how is it best to do this within MAGMI?  I'm importing about 300,000 products currently.  The URL also needs to change, as it currently just uses the default settings.</p>
  
  <p>I've looked into the wiki here -- <a href="http://wiki.magmi.org/index.php?title=Value_Replacer" rel="nofollow noreferrer">http://wiki.magmi.org/index.php?title=Value_Replacer</a> -- I guess the following code could work for the way it is currently working -- but what do I actually type into the value replacer box?</p>
  
  <pre><code>{{ Slugger::slug({item.name}) }}
  </code></pre>
  
  <p>Does anyone know how to add the sku to this as well?  Would I just do something like....</p>
  
  <pre><code>{{ Slugger::slug({item.name} ."-". {item.sku}) }}
  </code></pre>
  
  <p>Also, does anyone know if this automatically adds the dashes and the .html?</p>
  
  <p>Any guidance would be extremely appreciated.</p>
  
  <p>EDIT:</p>
  
  <p>I have successfully tested this as working in my test environment, but it is not working as expected in my production environment.  I'll go over what happens, and what I did.</p>
  
  <p>1) I purged the core_url_rewrite table
  2) I deleted all cache
  3) I set up MAGMI (updated it to the most current version as well, and triple checked all my settings)
  4) MAGMI went through fine, and the url key on about 5 products that I checked for were how I would expect
  5) During the catalog url rewrites reindex, all url keys disappeared.
  6) After the reindex was done, they were now in the default magento format (using just the name, and not the sku)</p>
  
  <p>Any ideas?</p>
  
  <p>The only difference between production and development that I can think of at the moment that may have anything to do with this is the fact that I did create a module based on the linked manufacturer-in-product-url-key question on production.  Now that I think of it, maybe that's the main difference that I need to address..... I didn't think reindexing would have anything to do with that, but maybe I'm wrong.</p>
  
  <p>Anyway, if anyone has any insight, I would still appreciate it.  I have a feeling maybe MAGMI should also be rewriting the url_path??  I think I read something about that somewhere.</p>