Jump to content

immediate download of virtual product


jacograaff

Recommended Posts

The default behavior after successful purchase is 

1. see order confirmation page with link to order history

2. click on order history

3. order history page opens showing list of orders

4. click on detail button

5. ajax opens order detail

6. now you can download the purchased virtual product

 

-------

how can I make the download available on the Order confirmation page - immediately on successful purchase??

 

second question:

can I alternative show the product name in the order-history page as opposed to the ARCHAIC order number

 

the controller accesses the order-list and not the products related to the order-list - thus I do not have access to the actual product name or download link from the history page - 

 

This is to archaic and many steps for end-user

 

Do I have to write my own php-SQL code or module to give the end-user a list of actual purchases and not just a list of order numbers?

 

Thanks

Edited by jacograaff (see edit history)
Link to comment
Share on other sites

I see this part of this question has been asked previously (see actual product in history and not a record of the invoices or order numbers)

 

users remember purchase by what they purchased not the archaic order number - it does not help at all this way

 

https://www.prestashop.com/forums/topic/445610-add-column-products-purchased-on-order-list/?hl=%2Blist+%2Bpurchased+%2Bproducts

Edited by jacograaff (see edit history)
Link to comment
Share on other sites

Ok - so this is what I tried:

I tested whether I can simply override the standard

getCustomerOrders function using ShopV1.6\override\classes\order\Order.php

 

To try and get a list like this:

--order 1
-----product 1
-----product 2
--order 2
-----product 3
--order 3
-----product 4

in 

 

ShopV1.6\override\controllers\front\HistoryController.php

 

I call

if ($orders = Order::getCustomerOrdersAndProducts($this->context->customer->id)) {

then in

ShopV1.6\override\classes\order\Order.php

 

  public static function getCustomerOrdersAndProducts($id_customer, $showHiddenStatus = true, Context $context = null)
  {
    if (!$context)
      $context = Context::getContext();


/* add a custom $res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' with innerjoin on order details*/

the returned result stays the same

 

now forget about the sql statement - the result value does not change

 

so I try to debug remotely by using FirePHP

 

even if I completely delete the sql 

public static function getCustomerOrdersAndProducts($id_customer, $showHiddenStatus = true, Context $context = null)
  {
    if (!$context)
      $context = Context::getContext();

//no sql statement
//this does execute

    require_once(..'/FirePHPCore/fb.php'); //for debugging
    FB::log("this works in FirePHP");


$res = null;


//I try and break this function by not even returning anything

for some reason I still get the original result returned even if the getCustomerOrdersAndProducts is completely empty of any return value

 

I would appreciate any ideas

 

My next step is now try and set up a debug environment to try and step through the php execution to see where the result comes from

 

 

 

 

 

Link to comment
Share on other sites

  • 11 months later...
Hello Jacograaff

 

I'm from seeking a solution to the same problem like yoursAnd I would like to know if you have found a solution. If you have the solution, help me is it you please. Thanks in advance for your reply
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...