WebSite X5Help Center

 
C. M.
C. M.
User

Add to cart references an old html file  en

Auteur : C. M.
Visité 1263, Followers 1, Partagé 0  

I am in the final stages of developing a web site using Website X5 12 professional version.

The website has a shopping cart, completed. The shopping cart section was developed in a fashion similar to the Tee Store recommendations in https://helpcenter.websitex5.com/post/30607 (utilising x5engine.imCart.addToCart() calls), it was fully tested and functional.

Then I developed the access management features of the website, including functionality for displaying the logged in user and hiding the login prompts, as recommended by Incomedia in https://helpcenter.websitex5.com/post/123665

This step involved changing file extensions for all pages in the web site from .html to .php. This was done by going to wsx5 Step 2 Map Creation->'Properties'->'Expert' tab -> 'File Name Format' . Users can now login, logout, and the web site functions as expected.

The problem I am facing:  After making the above change to add the access management functionality, the add to cart functionality which was tested and working prior to that, has now a problem: The x5engine.imCart.addToCart() call is referencing the old wsx5 cart web page (in my case websitex5/cart/index.html#step1) and not the new one (websitex5/cart/index.php#step1). If I manually change the link in the address bar of the browser to .php, everything works as expected, therefore it is clear that the proper files are uploaded to the server.

I tried everything (pressing <control> while building the preview of the website in wsx5 prior to uploading to server, deleting all server files and re-uploading), but still the problem persists.

It appears that the wsx5 engine is persistently storing certain links, which are not being updated when changes are made in the web site. I am welcoming any recommendations. From the nature of the problem I am sure that somebody else has faced it in the past.

Regards

Posté le
3 RéPONSES - 1 CORRECT
Paul M.
Paul M.
Moderator

Hello C.M.,

The variable for the shopping cart index page is stored in x5cart.js located in the 'cart' subfolder on the server.

You could of course edit this manually, but WebSite X5 might overwrite the file again at some point.

A much better solution is to go to Step 2 Map Creation, highlight the 'Shopping Cart' in the sitemap (under 'Special Pages') then click on the 'Properties' button at the right-hand side of the screen.  In the new screen which opens go to the 'Expert' tab and set the 'File Name Format' to 'php'

This will set the value of your shopping cart index page to cart/index.php (as opposed to cart/index.html)

Reupload your project to the server and test, etc.

Kind regards,

Paul

Lire plus
Posté le de Paul M.
C. M.
C. M.
User
Auteur

Thanks Paul. This one slipped my attention. Testing and reverting back with my findings.

Lire plus
Posté le de C. M.
C. M.
C. M.
User
Auteur

Paul, the first part of your reply hinted me on the solution. I am heavily manipulating the x5cart.js file with PHP server scripts, to incorporate custom products designed by the users of the site. Design of products on client side is with a combination of wsx5 and JS scripts, PHP and MySQL on the server side.

The fact that the address of the cart webpage was stored in this file slipped my attention, and as a result, my PHP script was overwriting the correct address with the old one.

Thanks for your prompt reply.

Lire plus
Posté le de C. M.