Import New Products with no slug

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
I have imported some new products, however it appears if the products are new, the products do not generate a slug automatically. I am forced to go into each product and click "Save" so NOP generates the slug itself. Is there a faster alternative to get NOP to generate the slug more efficiently than saving each product? I know I can import the slug which seems to be my only option unless a better suggestion is presented.
7 years ago
How did you import your "new" products?
7 years ago
natek wrote:
I have imported some new products, however it appears if the products are new, the products do not generate a slug automatically. I am forced to go into each product and click "Save" so NOP generates the slug itself. Is there a faster alternative to get NOP to generate the slug more efficiently than saving each product? I know I can import the slug which seems to be my only option unless a better suggestion is presented.


same problem after import

after i save product & slug is created product is still not coming on public store

is import broken in 3.8?
7 years ago
there are 2 problems

all imported products are always unpublished unless i add extra column for publish

if i publish TRUE the products in import they are still not on public store & i have to open each product in admin and save so what is the use of import?

when i save product in admin still can't open product page in public, why?
7 years ago
can any1 help?

i am trying to import products by import excel option in nop 3.8
7 years ago
After you Import with "extra column for publish"  (which I assume you are setting to TRUE  - in caps), if you go to the admin product page, do you see the Published field checked?
Also, if you go to SEO tab (Advanced view), do you see a value in field 'Search engine friendly page name'?
7 years ago
when i import with published TRUE it shows in catalog products list

but slug seo link is missing after excel import and slug link only comes when i go, edit each product and save.

but after saving each product, the product page still dont work on public store

i think there is bug in import excel option in nop3.8. can anyone test?
7 years ago
Please elaborate on " the product page still dont work on public store".
7 years ago
(Pepper,  please don't use PM for questions that can be answered in forum.  If you post in forum  a) many others may be able to answer, b) many others benefit from the answer ;)
pepper wrote:

1st. When I import excel with a product, the product is visible in product list in admin but there is no slug. Slug only gets created when I edit the imported product and save it (which defeats the purpose of mass import)

2nd. What I mean by product not available on public store is - When I edit the product and save it, then slug is generated so now product should be available to  view but when I go to link of new added product, it redirects me to home. Product is not available in search on public store.

If  you can try adding a new product in 3.80, you will know what I mean. import does not work. products never show up on public store when imported.


I have nopCommerce 3.80 test system installed with the sample data.  I Edit any product and be sure that I'm in "Advanced" fields mode.  I go to product list and Export a single product (e.g. Apple iCam).  I open the sheet and edit the record:
a) change Name to Apple iCam New
b) change SKU to NEW_APPLE_CAM
c) clear the value in the SeName field  (this is the slug)

I then save it and close it.  Then I Import it.   It works fine.  I see new product in public store.  It comes up in the search too.  I check in Admin, and the SEO tab shows the "Search engine friendly page name" as "apple-icam-2".
6 years ago
I had same problem . when I was importing new products with excel import feature , new products has no slug and was not accessible in main site (had not link to view) until I open each one and save it.
I added this small code to Import manager and problem solved.

in file :
\SourceCode\Libraries\Nop.Services\ExportImport\ImportManager.cs
line : about 981


// available Code
tempProperty = manager.GetProperty("SeName");
if (tempProperty != null)
{
  var seName = tempProperty.StringValue;
  //search engine name
  _urlRecordService.SaveSlug(product, product.ValidateSeName(seName, product.Name, true), 0);
}
// NEW CODE, continue after old one
else // if excel not contains column 'SeName' for products
{
  // check if product has slug befor
  // I'm not sure about this line
  var curretntSlug = _urlRecordService.GetActiveSlug(product.Id, product.Name, 0);
  if(string.IsNullOrEmpty(curretntSlug))
  {
    // Add new slug based on Nop utilities for creating slug and insert it
    var SeName = Nop.Services.Seo.SeoExtensions.ValidateSeName(product, "", product.Name, true);
    _urlRecordService.SaveSlug(product, SeName, 0);
  }
  
}


I have tested this code one or two times , It may crash , but has no danger
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.