Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Clean URLs after upgrade

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 04-06-2015, 10:19 AM
 
ant99 ant99 is offline
 

Advanced Member
  
Join Date: Mar 2015
Posts: 39
 

Exclamation Clean URLs after upgrade

We recently upgraded from XC4 to XC5 and have imported only our products. When we upgraded, the clean urls were not transferred over. Is there an "auto-generate clean URLs" feature in X-cart 5 that will generate all of the clean URLs if they have not been defined (for categories & products)?

Also, since we ran the most recent upgrade to 5.2.3 our store has broken links for the categories that do not already have a clean URL defined. Previous to the upgrade, if the clean URL was not defined the category would be linked to a page with URL parameters, (i.e. - /category.php?id=25). Now it links to the parent category instead. It seems broken. Should I open a support ticket?

Thanks!
__________________
Ant

XC v5.3.1.8
Horizontal Flyout Categories Menu Module
CloudSearch / CloudFilters

XC v4.7.6
CloudSearch
Reply With Quote
  #2  
Old 04-06-2015, 01:00 PM
 
ant99 ant99 is offline
 

Advanced Member
  
Join Date: Mar 2015
Posts: 39
 

Default Re: Clean URLs after upgrade

Also, is there a way to import the clean URLs and clean URL history from XC4 to XC5? That would save a lot of time.
__________________
Ant

XC v5.3.1.8
Horizontal Flyout Categories Menu Module
CloudSearch / CloudFilters

XC v4.7.6
CloudSearch
Reply With Quote
  #3  
Old 04-09-2015, 05:22 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Clean URLs after upgrade

Hello @ant99,

1) Here is an external script that can generate SEO-friendly urls for your products and categories:
PHP Code:
<?php

include_once('top.inc.php');

foreach(\
XLite\Core\Database::getRepo('\XLite\Model\Category')->findAll() as $category) {
    
$category->setCleanURL(\XLite\Core\Database::getRepo('\XLite\Model\Category')->generateCleanURL());
    \
XLite\Core\Database::getEM()->flush();
}

foreach(\
XLite\Core\Database::getRepo('\XLite\Model\Product')->findAll() as $product) {
    
$product->setCleanURL(\XLite\Core\Database::getRepo('\XLite\Model\Product')
 ->
generateCleanURL());
    \
XLite\Core\Database::getEM()->flush();
}

Of course, make a backup of your DB before running it.

2) There is no way of importing SEO-friendly urls, but you can put the history of them directly to the xc_clean_urls table. The value with highest ID is used as actual SEO-friendly url. The record with the same product_id, but lesser ID will be assumed as a history url.

Hopefully, it will help.

Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #4  
Old 04-11-2015, 01:24 PM
 
omargerardo1 omargerardo1 is offline
 

Member
  
Join Date: Jan 2015
Posts: 11
 

Default Re: Clean URLs after upgrade

Quote:
Originally Posted by tony_sologubov
Hello @ant99,

1) Here is an external script that can generate SEO-friendly urls for your products and categories:
PHP Code:
<?php

include_once('top.inc.php');

foreach(\
XLite\Core\Database::getRepo('\XLite\Model\Category')->findAll() as $category) {
    
$category->setCleanURL(\XLite\Core\Database::getRepo('\XLite\Model\Category')->generateCleanURL());
    \
XLite\Core\Database::getEM()->flush();
}

foreach(\
XLite\Core\Database::getRepo('\XLite\Model\Product')->findAll() as $product) {
    
$product->setCleanURL(\XLite\Core\Database::getRepo('\XLite\Model\Product')
 ->
generateCleanURL());
    \
XLite\Core\Database::getEM()->flush();
}

Of course, make a backup of your DB before running it.

2) There is no way of importing SEO-friendly urls, but you can put the history of them directly to the xc_clean_urls table. The value with highest ID is used as actual SEO-friendly url. The record with the same product_id, but lesser ID will be assumed as a history url.

Hopefully, it will help.

Tony

Hi tony, the support xcart migrated my store to xcart hosting server
and upgrade from 5.1.11 to 5.2.3 versiСn
after the update the clean urls doesnt Works properly the xcart support help me to solve this but not all the categories and products Works fine, so my programmer updated the products in the database again like he did in the 5.1.11 versiСn
but the clean url doesn╢t Works

If I go to the admin store I can see the clean url, but don╢t works
so, I changed manualy this clean url and then Works fine, then I export the products to see the difference and I notice in the export file

the product that i modified has .html at the end of the clean urlt
the others not, what do you think could be the problem ? and how can I solve this

every time the programmer update the products the clean url is changed and not Works, is the same url just without .HTML at the end
__________________
Xcart 5.1.13
Reply With Quote
  #5  
Old 04-11-2015, 04:32 PM
 
omargerardo1 omargerardo1 is offline
 

Member
  
Join Date: Jan 2015
Posts: 11
 

Default Re: Clean URLs after upgrade

I tried to run the scrip and got

ERROR: "0" (code N/A)

Undefined method 'generateCleanURL'. The method name must start with either findBy or findOneBy!
__________________
Xcart 5.1.13
Reply With Quote
  #6  
Old 04-11-2015, 04:38 PM
 
omargerardo1 omargerardo1 is offline
 

Member
  
Join Date: Jan 2015
Posts: 11
 

Default Re: Clean URLs after upgrade

Hi Tony, the support xcart migrated my store to xcart hosting server
and upgrade from 5.1.11 to 5.2.3 versiСn
after the update the clean urls doesnt Works properly, my programmer insert the products in the database again like do in the 5.1.11 versiСn
but the clean url doesn╢t Works

If I go to the admin store I can see the clean url, but don╢t works
so, I changed manualy this clean url and works fine, then I export the products for to see the difference and I notice that in the export file
the product that I modified has .html at the end of the clean url
the others not, what do you think could be the problem ? and how can I solve this
should I import the clean URL with .html at the end ? or is config problem ?
__________________
Xcart 5.1.13
Reply With Quote
  #7  
Old 04-15-2015, 04:52 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Clean URLs after upgrade

Hello @omargerardo1,

As I see, you are in active communication with members our team and they are settling problems with your store for you. Please submit all requests to them and we will help you with any problem.

Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #8  
Old 04-22-2015, 11:16 AM
 
ou812 ou812 is offline
 

Newbie
  
Join Date: Oct 2014
Posts: 4
 

Default Re: Clean URLs after upgrade

since upgrading, non of my clean urls work, i enabled them, tried to manually config nothing works... always page not found

please help!
Reply With Quote
  #9  
Old 04-23-2015, 09:41 PM
 
christiemerrill christiemerrill is offline
 

Newbie
  
Join Date: Apr 2015
Posts: 2
 

Default Re: Clean URLs after upgrade

I am having the same issue; just updated and now no clean urls work.
__________________
Christie Merrill
Reply With Quote
  #10  
Old 04-24-2015, 06:49 AM
 
ant99 ant99 is offline
 

Advanced Member
  
Join Date: Mar 2015
Posts: 39
 

Default Re: Clean URLs after upgrade

Hi Tony, thanks for the help.

1.) The script for the clean urls didn't seem to work. It didn't report a specific error, but I didn't spend much time debugging. Would still like a feature to "Auto-generate clean URLs for all content"

2.) For the clean URL history it seems like that is not going to work out either. When we export from XC4 then import to XC5, the entire category tree is recreated from scratch. Also, it looks like the product IDs are not matching from XC4 to XC5. Since none of the IDs match, the URLs will be off. Correct? For now, it looks like we're going to be matching 301 redirects manually.
__________________
Ant

XC v5.3.1.8
Horizontal Flyout Categories Menu Module
CloudSearch / CloudFilters

XC v4.7.6
CloudSearch
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:56 PM.

   

 
X-Cart forums © 2001-2020