adam256 Posted June 8, 2017 Share Posted June 8, 2017 (edited) 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 June 8, 2017 by adam256 Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 8, 2017 Share Posted June 8, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.