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

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.

Related

Google Merchant Center - Inaccurate availability (due to inconsistent availability between the landing page and checkout pages on your website)

I've gotten a message that my site may be knocked off of Google Merchant Center due to "Inaccurate availability (due to inconsistent availability between the landing page and checkout pages on your website)".
This affects only a small amount of products (only around 0.3% of my 40,000-ish products), so I know it's not an engine issue. After asking Google to recheck the results, they came back with the same error, but with a completely different list of products with no overlap, so I know it's not a problem on the individual product level.
There's no geo-locking on these products, and Google says that the problem exists on US IPs.
Nearly all of the errors look like this:
Value on the landing page - v:out_of_stock
Value in the data feed - v:in_stock
Performing an audit on the products in question shows that none of them have been out of stock for weeks, so the data feed is correct.
None of Google's suggested common issues (geolocking, buy button not working, product can't be shipped to an address, products not available country-wide) seem to apply. The country Google checked this on was a US-based IP.
I'm running out of ideas here, does anyone have any other suggestions?
The answer turned out to be something silly for my site, but I'm posting the answer here just in case this helps someone else.
Google's crawler was setting their country to be Andorra and attempting to check out using the US site. This is obviously not a good representation of the US experience. Google advised us that this was a mistake on their crawler's part, and that we would pass the next audit without any modifications. So if you're here looking for a solution, the absolute best advice I can give you is to find a phone number for Google Merchant Center and give them a call because the error may not be on your end at all.
Update: We passed the audit with no changes made on our part.

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.

Solution for listening to file once/download

I have energyshop.se which is a small webshop im doing for a customer. She sells various stuff but she has meditations on .mp3 and on discs. The customers can choose to buy:
a disc which is then sent to their home address.
one listening to one part of a meditation or one listening to all parts in a meditation
some items are also available for download for another price.
So question is how do I solve this? We use PayPal at her site to make the payments and I know that after a payment I can redirect the users to a "thankyouforthepurhase"-page if I want to. That leads me to think that one option is to take the users to that page where they can download/listen, but I dont know how to "connect" the shopped item with the isplayed files to be downloaded and/or listene once too and how to limit this. I mean if the page is energyshop.se/thanks someone that have made the purchase can just copy that address and go straight there.
There is also a idea about codes in some way. If they make a purchase they get a code sent to them for download or listening, but how do I generate this code which has to be unique everytime and the password ha to change everytime someone has entered it so someone dont save the code as well.
Well im kinda out of ideas and not sure how to do this. I just wanna wrap this project up but I think I hve to solve this for her.
I guess the solution depends on how much control (or security) she feels is required. If all you need is a reasonable confidence that a user has paid, then you can be much more relaxed about the whole thing.
The 'thanks' page could easily provide the content in concert with the transaction id paypal will return - you can use this to control what is shown. If you're not too worried about a 'listen-once' item being replayed, or 'download' being downloaded a bunch of times then you can avoid a bunch of edge-case stuff (where download fails or listen-once feed dies halfway, etc) and simply serve links to content based on the transaction.
If its abused then you can put effort into locking down content, serving mp3 streams from one-time links, tracking downloads in a database etc, but that will cost significantly more (in both time and server resources) so if you can, try simple first :)

How to decide whether to split up a VB.Net application and, if so, how to split it up?

I have 2 1/2 years experience of VB.Net, mostly self taught, so please bear with me if I seem rather noobish still and do not know some of the basics. I would recommend you grab a cup of tea before starting on this, as it appears to have got quite long...
I currently have a rather large application (VB.Net website) of over 15000 lines of code at the last count. It does not do retail or anything particularly complex like that - it is literally just a wholesale viewing website with admin frontend, catalogue / catalogue management system and pageview system.
I don't really know much about how .Net applications work in the background - whether they are all loaded on the same thread or if each has its own thread... I just know how to code them, or at least like to think I do... :-)
Basically my application is set up as follows:
There are two different areas - the customer area and the administration frontend.
The main part of the customer frontend is the Catalogue. The MasterPage will load a list of products but that's all, and this is common to all the customer frontend pages.
I tend to work on only one or several parts of the application at a time before uploading the changes. So, for example, I may alter the hierarchy of the Catalogue and change the Catalogue page to match the hierarchy change whilst leaving everything else alone.
The pageview database is getting really quite large and so it is getting rather slow when the application is first requested due to the way it works.
The application timeout is set to 5 minutes - don't know how to change it, I have even tried asking this question on here and seem to remember the solution was quite complex and I was recommended not to change it, but if a customer requests the application 5 minutes after the last page view then it will reload the application from scratch. This means there is a very slow page load whenever it exceeds 5 minutes of inactivity.
I am not sure if this needs consideration to determine how best to split the application up, if at all, but each part of the catalogue system is set up as follows:
A Manager class at the top level, which is used by the admin frontend to add, edit and remove items of the specified type and the customer frontend to retrieve a list of items of the specified type. For example the "RangeManager" will contain a list of product "Ranges" and will be used to interact with these from the customer frontend.
An Item class, for example Range, which contains a list of Attributes. For example Name, Description, Visible, Created, CreatedBy and so on. The form for adding / editing loops through these to display relevant controls for the administrator. For example a Checkbox for BooleanAttribute.
An Attribute class, which can be of type StringAttribute, BooleanAttribute, IntegerAttribute and so on. There are also custom Attributes (not just datatypes) such as RangeAttribute, UserAttribute and so on. These are given a data field which is used to get a piece of data specific to the item it is contained in when it is first requested. Basically the Item is given a DataRow which is stored and accessed by Attributes only when they are first requested.
When one item is requested from a specific manager is requested, the manager will loop through all the items in the database and create a new instance of the item class. For example when a Range is requested from the RangeManager, the RangeManager will loop through all of the DataRows in the Ranges table and create a new instance of Range for each one. As stated above it simply creates a new instance with the DataRow, rather than loading all the data into it there and then. The Attributes themselves fetch the relevant data from the DataRow as and when they're first requested.
It just seems a tad stupid, in my mind, to recompile and upload the entire application every time I fix a minor bug or a spelling mistake for a word which is in the code behind (for example if I set the text of a Label dynamically). A fix / change to the Catalogue page, the way it is now, may mean a customer trying to view the Contact page, which is in no way related to the Catalogue page apart from by having the same MasterPage, cannot do so because the DLL is being uploaded.
Basically my question is, given my current situation, how would people suggest I change the architecture of the application by way of splitting it into multiple applications? I mean would it be just customer / admin, or customer / admin and pageviews, or some other way? Or not at all? Are there any other alternatives which I have not mentioned here? Could web services come in handy here? Like split the catalogue itself into a different application and just have the masterpage for all the other pages use a web service to get the names of the products to list on the left hand side? Am I just way WAY over-complicating things? Judging by the length of this question I probably am, and it wouldn't be the first time... I have tried to keep it short, but I always fail... :-)
Many thanks in advance, and sorry if I have just totally confused you!
Regards,
Richard
15000 LOC is not really all that big.
It sounds like you are not pre-compiling your site for publishing. You may want to read this: http://msdn.microsoft.com/en-us/library/1y1404zt(v=vs.80).aspx
Recompiling and uploading the application is the best way to do it. If all you are changing is your markup, that can be uploaded individually (e.g. changing some html layout in an aspx page).
I don't know what you mean here by application timeout, but if your app domain recycles every 5 minutes, then that doesn't seem right at all. You should look into this.
Also, if you find yourself working on various different parts of the site (i.e. many different changes), but need to deploy only some items in isolation, then you should look into how you are using your source control tools (you are using one, aren't you?). Look into something like GIT and branching/merging.
Start by reading:
Application Architecture Guide

Some undesired words appeared in Google's snippets, how to get read of it?

I know Google's creation of sites' titles and descriptions (or "snippets") are mainly come from META description. However, when one of my web pages shows up, there are some undesired words like price (which is not good at all). What I want it to show is just the description of the product rather than its price. Actually the price only mentioned twice in the whole page.
How could this happen? And how can I remedy it?
Including the price in the snippet is actually very desirable for most people. If your price is higher than the competition's for the same products they probably don't want to buy from you and check out other results instead.
To make sure the search engines don't see the price (and thus don't display it in the results) you should use JavaScript. I think even Amazon does this to prevent screen scraping in some cases. It should be easy, especially with something like jQuery.
$('#priceForProduct987A').html("$125")
You should be able to control the snippet displayed by google through the use of the meta tags:
http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=79812
However the results displayed by Google in this case might be different if someone is trying to do some searching on a product. Google will then think you're shopping for that product and try to display the price of it. This might be the case for you.