Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 General help me questions
 Amending cdateadded
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bengreen1980
Starting Member

27 Posts

Posted - August 16 2011 :  04:04:20  Show Profile  Reply with Quote
Hi all,

How do I enable updates to be made to cdateadded when in advanced edit on products? We need the ability to amend this date, but currently when you click update the amendment is not applied...

Thanks.

Edited by - bengreen1980 on August 16 2011 04:04:53

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - August 16 2011 :  06:13:35  Show Profile  Reply with Quote
Hi,

you should see the amended date when you view the Bulk Product Update screen in Advanced Edit. By default the cdateadded field is not displayed in the edit product record screen.

Regards,

Carrol
www.deanston-electrical.co.uk
Go to Top of Page

bengreen1980
Starting Member

27 Posts

Posted - August 16 2011 :  06:15:16  Show Profile  Reply with Quote
Hi Carrol,
Yes thats correct, thats what I am saying.

But when we amend the date and click update, the record udpdates but the date does not change. Its like its ignoring our input...
Go to Top of Page

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - August 16 2011 :  06:36:17  Show Profile  Reply with Quote
I've just tested this on our site and it updated the changes.
Are you using exactly the same date format for the changes? If you're using a SQL database this can be a problem.

Regards,

Carrol
www.deanston-electrical.co.uk
Go to Top of Page

bengreen1980
Starting Member

27 Posts

Posted - August 16 2011 :  06:37:57  Show Profile  Reply with Quote
Yep, current date is 04/08/2011
Changed to 04/06/2011 (Which drops it out of our new products)

Clicked update, said updated, but date added stays as 04/08/2011

We are using MySQL...

Help! lol
Go to Top of Page

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - August 16 2011 :  07:02:40  Show Profile  Reply with Quote
I'm sure it is a problem with TIMESTAMP and DATETIME data types of the date fields. Unfortunately I am not up to speed with mySQL databases so cannot offer a solution but I'm sure some of the other forum users or support guys could help.

Regards,

Carrol
www.deanston-electrical.co.uk
Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - August 16 2011 :  08:11:24  Show Profile  Visit devshb's Homepage  Reply with Quote
cdateadded never gets changed when you update a product through edit-product; it gets set on the first time you create the product but then never gets changed.

cdateupdated is the one that gets changed

having said that, if you're in advanced-edit mode then you should be able to see/change cdateadded or cdateupdated manually

You can't edit those dates in shopa_addproduct.asp, but you can in advanced-edit mode (although on the version I've got, doing so will delete the time element and just leave you with a date instead of date+time, because the generic advanced-edit stuff seems to strip out times, but I don't see that as a major problem for those fields)

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
www.BigYellowKey.com
Follow us on Twitter: http://twitter.com/bigyellowzone
Web Design, Online Marketing and VPASP addons

Edited by - devshb on August 16 2011 08:17:24
Go to Top of Page

bengreen1980
Starting Member

27 Posts

Posted - August 16 2011 :  08:14:51  Show Profile  Reply with Quote
Yes of course, makes perfect sense. In normal circumstances you wouldnt need to anyway.

In this instance the client is adding old products, and hence we need to amend the dateadded in order to keeep the 'new products' and other scripts on the site populating correctly. At the moment I am having to manuially go in to MySQL and edit the dates everytime. I was hoping through advanced edit they could. Looking at Carrol's response above, they should be able to?
Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - August 16 2011 :  08:22:59  Show Profile  Visit devshb's Homepage  Reply with Quote
I've just tried it on v7, and I can update cdateadded manually in advanced-edit mode with no problem (but I'm not using mysql; maybe there's some kind of issue with mysql as per carrol's note; so it might indeed be an issue with mysql and how it processes dates, but I can't see a problem in the code on that front)

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
www.BigYellowKey.com
Follow us on Twitter: http://twitter.com/bigyellowzone
Web Design, Online Marketing and VPASP addons
Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - August 16 2011 :  08:26:39  Show Profile  Visit devshb's Homepage  Reply with Quote
here's a possibility; maybe the update statement is failing with a fatal sql error (eg invalid date format), and it's getting masked/hidden by the on error resume next line.

Might be worth taking out the on error resume next lines on that asp file and see if there's a vbscript error going on that you're not aware of

when you see:
on error resume next
what it'll do is ignore any fatal vbscipt/sql error and just carry on regardless, so it masks/hides problems.

Sometimes there's a legitimate reason for doing this (eg when sending out emails; if the email fails when orders are being flagged as paid then you still want the order to be set to paid and for the rest of the "thanks" stuff to continue).

Another use for on error resume next is when you want to close the database connection but if it's already closed then you don't want the whole script to fail.

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
www.BigYellowKey.com
Follow us on Twitter: http://twitter.com/bigyellowzone
Web Design, Online Marketing and VPASP addons

Edited by - devshb on August 16 2011 08:31:39
Go to Top of Page

bengreen1980
Starting Member

27 Posts

Posted - August 16 2011 :  10:03:39  Show Profile  Reply with Quote
Good idea.
I have commented out both instances of 'on error resume next' in shopa_editrecord.asp but this made no difference.
Interface reported product updated, date did not change to the new inputted date :(
Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - August 16 2011 :  13:11:43  Show Profile  Visit devshb's Homepage  Reply with Quote
if you're using mysql, then it'll be a different place, it'll be in shopmysqlsubs.asp (in the main folder), look for this function:

sub MYSQLEditRecord

it'll be inside that one

but you'd want to add it back again once you've seen the error

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
www.BigYellowKey.com
Follow us on Twitter: http://twitter.com/bigyellowzone
Web Design, Online Marketing and VPASP addons
Go to Top of Page

bengreen1980
Starting Member

27 Posts

Posted - August 18 2011 :  02:25:37  Show Profile  Reply with Quote
Hi Simon,

That didnt help, as it was not an error!

However, thanks for pointing me in the right direction.

If you look at MYSQLEUpdateField in that file, you will see this exit clause:

if lcase(fieldname) = "cdateadded" then
exit sub
end if

I just commented it out!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00