Author Topic: How to change success page to other (i.e. download page)  (Read 3187 times)

Offline Gortegavetera

  • Newbie
  • *
  • Posts: 4
  • Karma: +1/-0
    • View Profile
How to change success page to other (i.e. download page)
« on: March 21, 2016, 09:20:25 AM »
Hi everyone, i'm very new to Abantecart and need some advice:

I want to change the success page that appear when a customer click on checkout. We need to change this response so when people confirm an order they jump to the download page.

A little context: We work with chemical waste in a university to prevent/avoid environmental damage, and the download page on each customer account have documents about the substances that he or she discard.

Sorry for my english.

Best regards

Offline Gortegavetera

  • Newbie
  • *
  • Posts: 4
  • Karma: +1/-0
    • View Profile
Re: How to change success page to other (i.e. download page)
« Reply #1 on: April 04, 2016, 09:43:37 AM »
Can anyone advice me in this topic???
Sorry if it's basic, but i'm trying to understand. Maybe there is a documentation on this, but i'm really out of focus.

Best regards

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1286
  • Karma: +322/-2
    • View Profile
Re: How to change success page to other (i.e. download page)
« Reply #2 on: April 04, 2016, 12:30:06 PM »
Perhaps others are like me in not quite understanding the flow you want to happen.

Are you wanting the action like this"
1.  customer selects a service and adds to cart
2.  customer goes to Checkout Page
3   customer likes the order and proceeds to checkout
4.  they must login to an account or submit a guest
5.  they confirm the order
6.  AND now you want them to get a document about  only the substances they have ordered?

IMO seems the document about the substance discard is coming at the wrong place in the process - unless you have that all in the product description.

Perhaps you are only wanting to send them a reminder of what they have chosen to discard?

I am sorry,  but I just don't quite understand your specific needs and where you really want them to show up in the process.





Offline Gortegavetera

  • Newbie
  • *
  • Posts: 4
  • Karma: +1/-0
    • View Profile
Re: How to change success page to other (i.e. download page)
« Reply #3 on: April 05, 2016, 11:18:32 AM »
Hi Ilegrand, thank for your answer

The flow is:

1.  customer selects a waste to discard and adds to cart
2.  customer goes to Checkout Page
3   customer likes the order and proceeds to checkout
4.  they must login to his/her account (we don't want guest users)
5.  they confirm the order
6. They go to the download page of his account instead of success page

The download page will have specific risk labels and data that the user need to paste in the package sent to our system of waste management (this step is required for safety regulations but unfortunately some users "need more help" to do it well, so we need to "push" them to the download page). Other information about the substances will be in description of each product.

Thanks in advance for your support! and sorry if i wasn't clear in my first post!
« Last Edit: April 05, 2016, 11:44:00 AM by Gortegavetera »

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1286
  • Karma: +322/-2
    • View Profile
Re: How to change success page to other (i.e. download page)
« Reply #4 on: April 05, 2016, 03:30:25 PM »
Okay,  here's what you can accomplish with just the default AbanteCart offerings.

1.  In your product page -  add your PDF file for that product only - on the media tab.   You will have to decide what settings you want for your customer to have access - immediately,  on completion of order, etc.  Those are business decisions.

that will give you the file for each product, instructions ,  labels , whatever you need to tell them for that operation.

2.  then on the admin panel  System > Localization > Language Definitions  find the one for the checkout_success block   - contains the wording on that page - 

<p>Your order has been successfully processed!</p><p>You can view your order history by going to the <a href="%s">My Account</a> page and by clicking on <a href="%s">History</a>.</p><p>Please direct any questions you have to the <a href="%s">store owner</a>.</p><p>Thanks for shopping with us online!</p>

you can change it to whatever you need it to say and to direct your customer back to there account for the downloads.

Note there are two of them -   one for accounts,  one for guests if you allow guest checkouts you will need to change both


See if this will get you what you want.  By making them into downloads on their account they can reprint them if necessary.

Best thing I could think of at the moment.  Let us know if it will do it for you,  or if I need to keep thinking. :)

Lee

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1685
  • Karma: +220/-10
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: How to change success page to other (i.e. download page)
« Reply #5 on: April 06, 2016, 06:09:35 AM »
you can create your own extension with hook for success-page and call it. In this hook you can do whatever you want.

for details please see this https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/pages/checkout/success.php#L84
line 84.

Your hook will looks like this:
Code: [Select]

public function onControllerPagesCheckoutSuccess_ProcessData(){

$that = $this->baseObject;
$that->session->data['success'] = $that->data['success_text'];

//do something here

               //redirect to you own controller
$url = $that->html->getSecureURL('my_extension_txt_id/my_extension_success_page');

header('Location: '.$url);
exit();

}

where rt 'my_extension_txt_id/my_extension_success_page' - route to your own controller
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Gortegavetera

  • Newbie
  • *
  • Posts: 4
  • Karma: +1/-0
    • View Profile
Re: How to change success page to other (i.e. download page)
« Reply #6 on: April 06, 2016, 08:14:00 AM »
Thanks for your support  Ilegrand and Abolabo!

In conclusion: I already have the solution proposed by Ilegrand working and will study the Abolabo suggestion to implement it.

Best regards!