Inhalte aufrufen

Profilbild

URL-Alias

SEO; URL Alias

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
3 Antworten zu diesem Thema

#1 shadi81

shadi81

    Newbie

  • Members
  • Punkt
  • 3 Beiträge

Geschrieben: 03 September 2019 - 13:34

Dear Smartstore Team,

 

I developed a software to import Product list to Smartstore database. I inserted in UrlRecord table the Slug value alongside with the Product information i.e Entity='Product ' and EntityId. The problem is that the URL-Alias field is still empty in the "Edit Product" page!

 

For any suggestion I would be more than grateful.

 

Many thanks in advance for your efforts



#2 Marcel Schmidt

Marcel Schmidt

    SmartStore AG

  • Administrators
  • 149 Beiträge

Geschrieben: 03 September 2019 - 16:03

Hi shadi

 

try deleting the cache

 

best regards,

 

 

Angehängte Bilder


  • shadi81 gefällt das

#3 shadi81

shadi81

    Newbie

  • Members
  • Punkt
  • 3 Beiträge

Geschrieben: 04 September 2019 - 11:13

Many thanks for the great help! It worked like a charm :)

still one small problem: since my software does not import all products at once i.e the user (who does not have access to Smartstore Dashboard) can import "x" products everyday. In this case other user, who has access to Smartstore Dashboard, should "clear cache" manually so the "x" imported products can have valid URLs.

My question is: is there a way to clear the cache programmatically?

 

Kind regards,



#4 Marcel Schmidt

Marcel Schmidt

    SmartStore AG

  • Administrators
  • 149 Beiträge

Geschrieben: 05 September 2019 - 19:13

Hi shadi81

 

yes of course you can do that via code, but this may not be good practice.

 

The question is, how do you import products? Do you directly insert data sets into the db tables? If this is the case, you should think about changing your logic to use build-in functionalities like a repository which automatically handles import logic (i.e. hooks and events get fired accordingly and so on), so there would be no need to clear cache manually.

 

 

Take a look at this:

https://github.com/s...terBase.cs#L217

 

As you can see (line 256) a repository is used to handle inserts.

Of course you'll need to adjust it to your needs, but this should take care of your problems and help you to implement a good import functionality :)

 

 

Best regards