Hi All
Does anyone have an idea how to change the destination URL of the "continue shopping" button. I would like it to return to the album page rather than the individual photo page if selected from there.
I downloaded the lasest [checkout] code a few days ago.
Cheers,
hazzy
Posts: 4338
Hmm... well you could do it by modifying the php code... how much effort are you prepared to put in to make it work?
Posts: 55
Ok Alec, I will have a look at that approach. Ta. hazzy
Posts: 4338
I didn't describe an approach yet...
Posts: 55
Hi Alec,
Ah, I thought you were leaving me to my own devices!
I started to look at this problem and found CheckoutHelper.class.
I though if I could write some code in the function storeReturnURL() in that file to
a) See if the item in question is a photo
b) if it is, find the parent album URL (not sure how)
c) change the ReturnURL to that
I would be in with a chance.
Is this the right approach or is there a better one?
hazzy
Posts: 4338
Yes, you could do it like that - although I think you'll run into big problems trying reliably to parse the return url (which, since you've moved on to a different page by that point is all you have to go on) to see if it refers to an item or not - and which item - particularly if you're using url rewrite.
An alternative would be to look at the GalleryUrlGenerator class (GalleryUrlGenerator.class line 624) and do the test there; it would be easier to check if what is at that time still the current page is a photo item and build the return url for the item's parent album's page there if the rest of the url is for checkout. You had better hope that the UrlGenerator is re-entrant, I don't see why it shouldn't be.
So you have the choice of a nasty hack in the checkout code, or a slightly less nasty hack in one of the core classes.