Jump to content

Urgent - Add to basket shrinks page and pastes


adam256

Recommended Posts

Hi I am a new user of cubecart running it on my local host for testing and edit. I am  making a skin for the default cubecart skin. I know how to code in html and css. 

I have come across a problem. When ever I click the "add to basket" button it dont add the item to the basket instead what it does is it pastes a smaller size of the same page above the original page. This is only happening in google chrome. when i tested it in firefox everything worked fine.

At first i thought it may have been caused by the css I added in so I disabled the css and retested but got the same results. I have not changed any of the original code on the cubecart main.php i have only just added to it. 

the screenshots below show the edit i have made.

http://prntscr.com/fhh61f

http://prntscr.com/fhh68h

below is what happens after clicking add to basket

http://prntscr.com/fhh6ts

http://prntscr.com/fhh7jc

i zoomed out on the browser to capture it all on one page but im sure you understand what i mean. I have also attached mu main.php file that i have been editing if someone wants to take a look. Only thing i did to the original code was add a margin of 10em to the top. which i removed and still get same results. 

main.php

 

and on the console.log on chrome i get the following warning only after clicking the add to basket once the script runs: 

http://prntscr.com/fhhb8z

Edited by adam256
Link to comment
Share on other sites

Mostly for CC5/6, when the Add to Basket is clicked, some javascript is invoked. The javascript cancels the form submission and makes an AJAX call with the relevant info.

CubeCart has code that, if the info is according to a specific syntax, will generate a new chunk of HTML that is ONLY of the shopping basket box. The AJAX call receives this code and replaces the existing chunk of shopping basket HTML code.

What can go wrong? If the info is not correct, then either nothing will happen, or CubeCart will decide to send the entire storefront page. The AJAX call will take whatever it gets and paste it in place of the current shopping basket box. This results in either a new shopping basket box or a complete page within a complete page.

Also, overly agressive URL Rewrite in the .htaccess file may be interfering.

We would need to see what exactly the browser is sending to CubeCart, and then, determine how CubeCart is responding to that info.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...