Update:
New link: https://ruizbazan.com/tienda
The problem may be in ‘Rewrites Settings’, with the automatic capture of ‘Products Slug’
There’s no problem with the database, we tried another installation and it gave the same error.
Just a longshot but it is very often a translated slug – a problem that can be solved like so: http://msls.co/developer-docs/hook-reference.html#msls-options-get-permalink
Hi, thanks for your response.
I added the following code and it works perfect for switching from English to Spanish:
———————–
function my_msls_options_get_permalink( $url, $language ) {
if ( ‘es_ES’ == $language ) {
$url = str_replace( ‘/shop/’, ‘/tienda/’, $url );
}
return $url;
}
add_filter( ‘msls_options_get_permalink’, ‘my_msls_options_get_permalink’, 10, 2 );
——————————–
But adding the following, to switch from Spanish to English, it gives me an error.
————————————–
function my_msls_options_get_permalink( $url, $language ) {
if ( ‘en_US’ == $language ) {
$url = str_replace( ‘/tienda/’, ‘/shop/’, $url );
}
return $url;
}
add_filter( ‘msls_options_get_permalink’, ‘my_msls_options_get_permalink’, 10, 2 );
————————————–
I studied and tried various ways, but I don’t know how to add both.
Link to the English version: https://ruizbazan.com/rugs/shop/
Link to the Spanish version: https://ruizbazan.com/tienda/
-
This reply was modified 4 months, 2 weeks ago by
spmakingwp.
You probably get the error “function is already defined” or similar. Try this here (it gets in one function):
function my_msls_options_get_permalink( $url, $language ) {
if ( 'es_ES' == $language ) {
return str_replace( '/shop/', '/tienda/', $url );
}
elseif ( 'en_US' == $language ) {
return str_replace( '/tienda/', '/shop/', $url );
}
return $url;
}
add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );
Perfect, problem solved.
Thank you very much Dennis, excellent support.