Post by salmoon » Thu Nov 13, 2008 7:57 am

I have a shop currently using 0.7.6 and need advise on how to upgrade it to 0.7.current.. while keeping all the current database data intact.

an initial attempt of using the 0.7.6 database with 0.7.8 resulted in a few 'undefined index' errors in the admin.. and i expect more i haven't found yet.

i remember reading a few posts about there being databass structure changes with the later versions of opencart? or something.

any help / instructions would be very much appreciated.

thanks a lot.

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by Qphoria » Thu Nov 13, 2008 8:26 am

1. Backup your shop and database
2. Upload all the files from 0.7.current, overwriting the existing files
3. Run yoursite.com/install/upgrade.php
4. Hope for the best :) At least you have a backup if it doesnt work.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by hm2k » Thu Nov 13, 2008 8:31 am

1. Follow the upgrade instructions in the install.txt ;)

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by salmoon » Thu Nov 13, 2008 8:48 am

thanks, will give it a go.

for the record, i downloaded 0.7.8 which doesn't have any upgrade text in the install.txt file  ;)

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by Qphoria » Thu Nov 13, 2008 9:10 am

dont do it :) 079RC3 ftw

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by salmoon » Thu Nov 13, 2008 7:57 pm

i've followed the instructions but i'm getting a few errors.

when i looked at past orders in the admin, i got 3 undefined index errors about discounts or something. Then when i checked the catalogue, i tried adding a product to the cart and it gave me this error:

Code: Select all

Error: Table 'catrin_cart079.product_discount' doesn't exist
Error No: 1146
select * from product_discount where product_id = '6' and quantity <= '1' order by quantity desc limit 1
and since then that error comes up no matter where i navigate to on the site through the url. even going to the homepage brings that up.

is this to do with the database restructuring i mentioned above?

Thanks for any help.
Last edited by salmoon on Thu Nov 13, 2008 8:43 pm, edited 1 time in total.

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by hm2k » Thu Nov 13, 2008 9:01 pm

I guess daniel didn't include any SQL upgrading considerations between versions...

You need to create the table by using the following SQL:

Code: Select all

CREATE TABLE `product_discount` (
  `product_discount_id` int(11) NOT NULL auto_increment,
  `product_id` int(11) NOT NULL,
  `quantity` int(4) NOT NULL,
  `discount` decimal(15,4) NOT NULL,
  PRIMARY KEY  (`product_discount_id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by salmoon » Thu Nov 13, 2008 9:39 pm

excellent that worked. thankyou.

now it seems the only other problem im having with the upgrading is the error i get when looking at previous orders
shown at the top of the page.

Code: Select all


Notice: Undefined index: discount in /home/catrin/public_html/079/admin/controller/order.php on line 426


any ideas?

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by Qphoria » Thu Nov 13, 2008 11:02 pm

also need to run this sql:

Code: Select all

ALTER TABLE `order_product` ADD `discount2` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0.0000' AFTER `price` ;
Last edited by Qphoria on Thu Nov 13, 2008 11:04 pm, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by salmoon » Thu Nov 13, 2008 11:04 pm

genius. thanks a bunch!!!

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by hm2k » Thu Nov 13, 2008 11:14 pm

Now that's what I call team work ;)

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by Qphoria » Thu Nov 13, 2008 11:19 pm


Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by salmoon » Fri Nov 14, 2008 12:17 am

ha ha. thanks guys.

so now i've successfully upgraded to 0.7.9RC3.

however, i'm still having problems with the Paypal IPN bug.

I've just installed the "paypal improved"  module but it doesn't appear to have made any difference... orders are still not getting processed until the user returns to the shop after paypal.

I'm using the sandbox to test this.

Have i missed something?

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by Qphoria » Fri Nov 14, 2008 12:28 am

I see the same thing.
I'm debugging it now to see what it really thinks its doing.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by salmoon » Fri Nov 14, 2008 12:33 am

ah cool.. so your orders aren't processed til you return to the store either?

Daniel said this was fixed with 0.7.9RC3.. was the only reason i was upgrading as had no problems with 0.7.6!

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by salmoon » Fri Nov 14, 2008 12:54 am

I've just spoke with my host, they say i need to find out what port the IPN needs to connect to so my host can open it up.

Can't seem to find any reliable info on this... is it just 80?

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by salmoon » Fri Nov 14, 2008 2:21 am

After rummaging through the forums i found this suggestion:
(http://forum.opencart.com/index.php/top ... ml#msg8841)

In paypal improved - paypal.php Replace:

Code: Select all

$sql = "select `order_status_id` from `order_status` where `name` = '?' and `language_id` = '?'";
                $parsed = $this->database->parse($sql, $this->language->get('order_status_pending'), $this->language->getId()); 
                $results = $this->database->getRow($parsed);
                if ($results)
                {
                    $pendingStatus = $results['order_status_id'];
                }


with:

Code: Select all

//
                //  Perhaps the IPN from paypal has arrived before the user has returned from
                //  the paypal web site OR the user has not returned at all. 
                //  In response to either case, we should load and process the order.
                //             
		$reference = $this->request->get('invoice', 'post');
                if ($this->order->load($reference))
                {
                    //  IPN is winner or customer never returned and IPN arrived.
                    //  default status should be Pending so the update below will have no
                    //  effect if we process the order here but the end result is still correct.
                    $this->order->process(); 
                }


So i did this, placed a test order without returning to the shop after paying.. and the order actually got processed with a status of "Processing"!! 

i don't know if this is the IPN calling back now? or why it's now working after replacing that bit of code?

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by salmoon » Fri Nov 14, 2008 2:24 am

only thing is now if the user doesn't return to the store, the cart doesn't get cleared..

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm
Who is online

Users browsing this forum: No registered users and 1 guest