Prestashop links to the wrong category - prestashop

I recently created new category of products.
The ID and name are base of every link in my shop like in example below.
www.example.com/ID-CATEGORY_NAME
Newest category with ID 12 somehow links to one of the old categories.
So instead of redirecting to www.example.com/12-categorynew it links to www.example.com/5-categoryold which is valid link but for another category of products. Any idea what may caused that? I'm running 1.7.5.2 version. No change in code was made yet.

You probably already found a solution; however, I would start with the following:
Try to clear the cache.
Try regenerating the category tree.
The reason I answer is different though: If you have not updated your Prestashop yet, then do so quickly. For versions < 1.7.8.7, a security issue was found back in July of 2022. You should have been notified by Prestashop about this.

Related

Why is PrestaShop redirrecting to a random product when selecting variations from front-end?

I have an online shop in development, all went well until I decided to do SEO on the shop. After this, if I chose a product variation from front-end it just redirects me to a random product.
This picture describes the first state. The default product load.
This picture describes what is happening after you select a variation. As you can see the product name stays the same, but the link indicates that a totally different product is displayed.
If I have the debug mode enabled when selecting a variation it throws "An error occurred while processing your request" and in the request file I can see that besides some errors (Deprecated: array_key_exists(): Using array_key_exists()) it shows the request for a different product.
I can't understand why this is happening, so I am in dying need of your help.
That's the way Prestashop 1.7 works :
First time a customer lands in a multi-variation page, the default attribute will be loaded,
URL will show only the ID product.
Once you choose an attribute , an AJAX call will refresh the page
with the current attribute and URL will change with id_product-id_product_attribute value.
Not sure what you mean by "random product" as in both of your examples I see an attribute
being selected.
Anyway there are several (paid) modules to change this behaviour in a better SEO perspective,
this is definitely one of the most famous :
https://addons.prestashop.com/en/url-redirects/16633-pretty-urls-seo-friendly-url-remove-ids-numbers.html
EDIT: Just noticed that the ID product is different in the two screenshot, this could be related to some DB issues with attribute too, you should check if you have some not coherent values between id_product and id_product_attribute(s)
I found a fix for this. Apparently or appeared because I was using the duplicate function for uploading products. I don't know why but on some products it makes this behavior.
I've spent over 12 hours to find a explanation for this and I was unable to find one. The PrestaShop forum straight up banned me for posting this topic.
My advice is to NOT USE PRESTASHOP it's and old sistem and full of bugs, the support is expensive and I get the impression that even they don't understand their system.
If you find yourself in this situation, know this. Don't duplicate and upload products using "add new" function.
And I can't state this enough, do yourself a favour and don't use Presta, with all the expenses the time to invest and what the product looks like at the end of the road, is just a waste of time. Even after you finish is guaranteed to break in 1-2 years, any updates will break your store and you will need to invest even more more to fix it. It's an old, slow and buggy CMS. It's days are numbered.
Thanks a lot for help.
Best regards, Daniel.

Prestashop : Country cannot be loaded with address->id_country

When my customers wants to register on my prestashop, they get this message :
1. Country cannot be loaded with address->id_country
2. Invalid country
Prestashop version is 1.6.0.11, PHP version was 7 but I downgraded to 5.6 as I hoped it would resolve the issue, but it didn't...
Here is what I tried so far :
Changing Country:name to country:name in countries
Enabling "Restrict country selections in Front Office to those covered by active carriers" (disabled it back after)
Changing PHP version
Changing theme
Changing the registration process type to standard (with this option, I got a 500 error after submitting the form)
Generally speaking, the issues mentionned here didn't work for me :
https://www.prestashop.com/forums/topic/256624-error-country-cannot-be-loaded-with-address-id_country/
Somme github issues provided files to replace, but that was for the previous versions and the changes were already included in mine. I really don't know what to do...
Can somebody please help ?
As I look up your problem, it's seems not the server configuration problem, it is simply might be the country customer register with is not in your prestashop country list active?
you might find which countries is active in your store by this step:
1 go to your store database table
2.go to this table: prstshp_country
3.execute this query: SELECT * FROM prstshp_country WHERE active = 1
you could find in your shop which countries are active:
if user register country is not in the list you need to add the country in your shop dashboard, click active
once you had active but problem issue still occur then you might consider about configuration problem
hope this help
I was having a problem only with Spain,country.
I changed ''need_identification_number'' to ''0'' and problem was gone .

How to add new field tab in prestashop product backoffice?

I want to add new field in prestashop product backoffice . This tab is same description tab.Please find attached screenshot what I need .
Thanks
Prestashop overrides their core (all their code files) every time you use the one-click-update in order to prevent developers to mess with their core.
Any modification on this page will be overridden on your next update unless you are willing to update the files manually with FTP and the database via PHPMyAdmin (or with MySQL workbench via remote connection) without overriding anything related to this interface.
I strongly advise you against this as you'll most certainly face incompatibility between your version and Prestashop core pretty quickly.
If you think your request is good for the whole community, you might try to pull a suggestion here: http://forge.prestashop.com/secure/Dashboard.jspa
Do not put to much hope on this as Prestashop team is quite busy.
If it's something specific to your shop, you'll need to hire a freelancer to as suggested by Raghubendra Singh in his comment. I'll add to his comment that it will need to be in a custom module. You might try to pull a proposal on this website: https://www.upwork.com/
If you do so, make sure that the developer you hire have a good experience both with PHP/MySQL and Prestashop itself (as it is a complex system). Even if you hire a developer from Filipino or India, you'll probably need to invest at least a thousand US dollars in order to have something sharp.
Also, please note that you'll need to hire the developer once more at least for every major update (by example 1.7.X => 1.8.X) to fix the incompatibility with Prestashop core.
the simplest way is to use an addon. For instance, this one.
It allows adding an unlimited number of tabs, some of them have a predefined structure (contact form or attachments). Others are changeable. So it's possible to add any content you need: additional pictures, video, text, etc.

Stencil Products Per Category Page Suddenly Ignored by Backend

I have a Stencil theme in production that suddenly stopped working. Any given category page shows one product versus the 12 requested.
theme_settings.categorypage_products_per_page is sent to server and 1 product is returned. The rest are paginated. Strangly, I have confirmed this issue with a fresh clone of the BigCommerce repository and stock Stencil code. Has anyone else seen this issue or know of a work around? Is it something hardset on our backend?
This was a temporary issue on BigCommerce's end. It has sense been resolved as mentioned in the comments of the question.

Prestashop specific price not displaying on product page

I updated the specific price for a product correctly in Admin, but when going to the front shop product page, it still shows the original price. When i add product to cart, then it shows the correct specific price. I am using prestashop 1.6.0.14. Is there someone else who has this issue or knows how to solve it?
You need a fresh version of the files product.tpl and/or product.js. I just solved this by trial and error :). It wasn't an upgrade, I moved a ps site from one server to another, specific price on product page wasn't displaying (was actually there, but hidden, I saw that by mistake on Edge). So, I replaced those two files and it works. Good luck!