Welcome! Log In Create A New Profile

Advanced

My cart has crashed...

Posted by A.Jarvis 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
My cart has crashed...
October 31, 2010 10:45PM
Hi Mac,

I have a problem with my cart (site 04)... it works okay in some circumstances but in others it breaks and prevents the rest of the page loading too. (A fatal flaw for an ecommerce site...!)

My shop sells physical products for conventional delivery and digital products for immediate download. If you only add physical products (in my case this is posters and calendars) to the cart, it adds them and carries on as it should. However, if you add digital products (images for download where the images have different size options), it breaks. This is the case for Firefox, Chrome and IE. I don't know if the issue is the digital download, or the product attributes...

When it breaks it doesn't get past the "$products = $cart->get_products();" line 82 in catalog\shopping_cart.php. I haven't been able to work out exactly why this is where the problem is. I have spent a lot of time going through all the files and systematically replaced more or less every file I have edited with a clean copy but to no avail. I have also searched extensively on the oscommerce forum and other sites but have not found anything of relevance.

Could you please take a look and see if you could point me in the right direction?

I realise our deadline is tomorrow (Monday) so if necessary you will have to mark my site as it is. I would still like to be able to fix it though.

Thanks, Alice
avatar
Mac
Re: My cart has crashed...
November 01, 2010 07:06AM
Hi Alice

Did you change some code in files? I had to recopy the create_account_success.php file to get it to work which leads me to believe that it is a typo somewere?
I notice that some products, when added to the cart, is inserted in the cart database side, others not, so something is going on as you point out - but the problem could be in more than one file - that is why I ask if you have changed code?
Re: My cart has crashed...
November 01, 2010 08:20AM
Hi Mac,

Thanks for your reply.

I don't see any difference: still when you add a digital product the cart listing on the top right disappears and the rest of the page doesn't load but with a physical product it is okay.

Yes, I was working on some of the code... have added in some of the add-ons on the oscommerce site. I've obviously messed something up somewhere but it's like untangling spaghetti trying to work out what and where. As I said, I tried replacing most of the files (not the create_account_success.php one though, I must admit!).

Any other thoughts or advice?

Thanks, Alice
avatar
Mac
Re: My cart has crashed...
November 01, 2010 11:08AM
The version we use is an older version so add-ons may not work (or mess up like it has done now....).

I cannot for the life of me see how different products could cause such an error ! It can only then be related to the category, or maybe you have installed a module inbetween creating the products.

Let it be - I will look at your cart as it is and take this into consideration (I look at the back-end configuration which tells its own story without having to see the front-end).
I suspect the quickest route will be to overwrite all the files (some addons may have changed the db as well - not sure what you have installed) rather than trying to fix the problem.
I will try and see if I can resolve it, but I cannot spend too much time on it today....sad smiley
avatar
Mac
Re: My cart has crashed...
November 01, 2010 11:16AM
Here is one clue: did you try to change code to distinguish between physical and digital products?

tep_adjust_price() in .....catalog/includes/classes/shopping_cart.php on line 287

Where did this come from? There is no function tep_adjust_price, hence the error - did you write this?

I have restore shopping.cart.php, seems to be working - except it may not do what you intended.
Re: My cart has crashed...
November 01, 2010 11:37AM
Okay, thanks a lot.

Alice
Re: My cart has crashed...
November 01, 2010 02:19PM
Hi again,

For info: the tep_adjust_price thing came from an add on "Actual Attribute Price V1.0" (http://www.oscommerce.com/community/contributions,1716) which displays the actual price rather than the price plus whatever each attribute adds. Works nicely in the product listings... (but obviously not fully compatible with the cart aspects). It also now seems to mess the cart up so that the prices are negatives. I'll take it off again.

Where can we actually see the software version that is installed? I guess I assumed it would be the most up-to-date version and that add-ins designed for it would work!

Alice
avatar
Mac
Re: My cart has crashed...
November 02, 2010 07:06AM
Add-ons are not always guaranteed to work, even if it is the latest version of oscom... just have a look here for the add-on you installed : http://forums.oscommerce.com/tracker/project-1-oscommerce-online-merchant-core/?s=0750b968857c54e1b7c7c6828d11175f
It seems support is also a little bit on the short side for this add-on. One must therefore be very careful what you install or do not install.
Installing the latest version depends on many factors, e.g.
- is the current release stable, i.e. no bugs? If your cart is stable, leave it as it is until a tested stable version is available (it requires you to visit the support forums to get an idea) but always take note of security updates.
- is the server software up to date? We're getting a new server next year, which means we can run the latest versions of PHP and MySQL, allowing us an update.
- we have security concerns about our current server, which is why we require a log in to access the cart. These concerns also mean that we cannot allow you to do what you may want to do. Hence our focus is solely on getting to understand how you populate the and stuff like that. What you want to do is advanced stuuf. It is good that you are keen to go that far, but unfortunately not within this course or this server...!
- your PHP skills

If you want to go further, I suggest you download XAMPP, which will install a complete server (and the latest versions of PHP, MySQL and Apache) on your PC with a few clicks and no configuration (except if you run Skype). You can then install the latest version of oscommerce and test these add-ons.
Re: My cart has crashed...
November 02, 2010 08:56AM
Hi,

Good points, thanks.

I am running XAMPP (I did your PHP course a couple of years back) but even if something seems to be running well on localhost it doesn't always translate smoothly to the server (and vice versa). I am running a few PHP/MySQL sites (see e.g. www.nnf.org.na/EIS) and generally am fine with PHP but have found it a bit frustrating with oscommerce - trying to jump into an established set-up and understand other people's code without messing it up isn't easy! It's been a good learning process but seeing the limitations (like the strange pricing system if you have several attributes for one product) does make the add-ons tempting! Obviously in a live environment one would test everything thoroughly before launching.

One more question - what is the easiest way to make a copy of our PHP files rather than downloading one-by-one? Getting the database is easy - is there an equivalent way to dump the PHP files?

Thanks again for all your assistance.

Alice
avatar
Mac
Re: My cart has crashed...
November 02, 2010 10:50AM
Yes, even if you understand PHP understanding their code is sometimes difficult - it comes with experience.

We will have to zip and email it to you - but remember you should upgrade to the latest cart if you really want to use it. I'd rather start all over again.
Sorry, only registered users may post in this forum.

Click here to login