- Posts: 21
- Thank you received: 0
A little more complex checkout
13 years 7 months ago - 13 years 7 months ago #88879
by peteritv
A little more complex checkout was created by peteritv
Hi there!
I searched a long time on this forum and didn't find an answer for my problem, so here it is:
HikaShop Business 2.0.0
My webshop checkout should work as follows:
The customer adds some stuff to buy, goes to checkout to place the order, but not pay yet.
So he gets an e-mail about the created order.
Now the shop owner manually adds shipping costs to the order and sets the order status to "confirmed".
The customer gets a new e-mail about this, and only NOW he is able to pay.
So far I am halfway there using the workflow "login_address_coupon_cart_status_fields_terms_confirm,end", but on the customer control page the customer is still able to pay while the order status is "created" and thus no shipping costs have been added yet.
Is there any way to prevent payments while the order status is not "confirmed" yet?
TIA,
Peter
I searched a long time on this forum and didn't find an answer for my problem, so here it is:
HikaShop Business 2.0.0
My webshop checkout should work as follows:
The customer adds some stuff to buy, goes to checkout to place the order, but not pay yet.
So he gets an e-mail about the created order.
Now the shop owner manually adds shipping costs to the order and sets the order status to "confirmed".
The customer gets a new e-mail about this, and only NOW he is able to pay.
So far I am halfway there using the workflow "login_address_coupon_cart_status_fields_terms_confirm,end", but on the customer control page the customer is still able to pay while the order status is "created" and thus no shipping costs have been added yet.
Is there any way to prevent payments while the order status is not "confirmed" yet?
TIA,
Peter
Last edit: 13 years 7 months ago by peteritv. Reason: Added version info
Please Log in or Create an account to join the conversation.
13 years 7 months ago #88896
by nicolas
Replied by nicolas on topic A little more complex checkout
Hi,
You should turn off the "auto select payment and shipping methods" option of the configuration.
Then, after loging in/out of the frontend, that should do it.
You should turn off the "auto select payment and shipping methods" option of the configuration.
Then, after loging in/out of the frontend, that should do it.
Please Log in or Create an account to join the conversation.
13 years 7 months ago #88942
by peteritv
Replied by peteritv on topic A little more complex checkout
Hi Nicolas,
Thanx for your quick response!
I had already disabled that option, but it doesn't help.
After the customer creates a new order (without paying yet), he can access that order on the customer control page and still pay for it while the order status is "Created" (Dutch: "Aangemaakt").
See:
Now what I want is that the customer can NOT pay until the shop owner processed the order and set its status to "Confirmed". Only after that should the customer see the "Pay now" button (Dutch: "Nu betalen") and complete the transaction.
When the show owner processes the order and sets it status to "Confirmed", the pay button disappears, so apparently the payment system is triggered by the status "Created". In that case I will need an extra order status at the beginning of the workflow (such as "Processed"), which does not trigger the payment system, and then when the shop owner sets it to "Created" things will work as usual...
I guess what I want is a lot like a "Request For Proposal" (RFP) kind of thing, and I read somewhere that version 2.1.0 has this functionality integrated? Would that solve my problem?
Greetz,
Peter
Thanx for your quick response!
I had already disabled that option, but it doesn't help.
After the customer creates a new order (without paying yet), he can access that order on the customer control page and still pay for it while the order status is "Created" (Dutch: "Aangemaakt").
See:
Now what I want is that the customer can NOT pay until the shop owner processed the order and set its status to "Confirmed". Only after that should the customer see the "Pay now" button (Dutch: "Nu betalen") and complete the transaction.
When the show owner processes the order and sets it status to "Confirmed", the pay button disappears, so apparently the payment system is triggered by the status "Created". In that case I will need an extra order status at the beginning of the workflow (such as "Processed"), which does not trigger the payment system, and then when the shop owner sets it to "Created" things will work as usual...
I guess what I want is a lot like a "Request For Proposal" (RFP) kind of thing, and I read somewhere that version 2.1.0 has this functionality integrated? Would that solve my problem?
Greetz,
Peter
Please Log in or Create an account to join the conversation.
13 years 7 months ago - 13 years 7 months ago #88986
by peteritv
Replied by peteritv on topic A little more complex checkout
Rehi,
OK, I am some steps further...
I created a new order status "Requested" at the beginning of the workflow.
Just as a test, I created a new order and manually set the status to "Requested".
When the customer now logs in and browses his orders he sees this:
Which is exactly what I want: The order cannot be paid for yet
Now the shop owner can process the request, and after adding shipping costs (and maybe some bonuses) he can set the status to "Created" which makes the order payable.
So all I want now is to change the initial status of the order from "Created" to "Requested", and everything should work, right? Or can I expect other stuff to not work anymore (like the automatic emptying of the cart) because of this new initial status?
I am no PHP-wizz (yet), but can someone give an example of how the plugin code for this would look like?
Beneath trial does not work because the status still remains "Created"...
TIA,
Peter
OK, I am some steps further...
I created a new order status "Requested" at the beginning of the workflow.
Just as a test, I created a new order and manually set the status to "Requested".
When the customer now logs in and browses his orders he sees this:
Which is exactly what I want: The order cannot be paid for yet
Now the shop owner can process the request, and after adding shipping costs (and maybe some bonuses) he can set the status to "Created" which makes the order payable.
So all I want now is to change the initial status of the order from "Created" to "Requested", and everything should work, right? Or can I expect other stuff to not work anymore (like the automatic emptying of the cart) because of this new initial status?
I am no PHP-wizz (yet), but can someone give an example of how the plugin code for this would look like?
Beneath trial does not work because the status still remains "Created"...
Code:
class plgHikasshopRFP extends JPlugin {
function plgHikasshopRFP(&$subject, $config){
parent::__construct($subject, $config);
}
// Change the initial order status
function onBeforeOrderCreate(&$order,&$send_email){
$order->order_status = "requested";
return $this->onBeforeOrderCreate($order,$send_email);
}
}
TIA,
Peter
Last edit: 13 years 7 months ago by peteritv. Reason: Added why the code does not work
Please Log in or Create an account to join the conversation.
13 years 7 months ago #89109
by nicolas
Replied by nicolas on topic A little more complex checkout
Hi,
There is no need to change any code for that.
In the configuration of HikaShop, you will find several options related to the order statuses in order to define the default order status, the order status for paid orders, the order status for payable orders (with the pay now button of the orders listing).
The best is to keep the "created" status as the first status of the order, change the payable order statuses to "processed" instead of "created" and keep the confirmed order status as the paid order status.
That way, the orders first have the created status, then you add the additional info to the order and change it to processed, the user pays for it, and the order becomes confirmed.
There is no need to change any code for that.
In the configuration of HikaShop, you will find several options related to the order statuses in order to define the default order status, the order status for paid orders, the order status for payable orders (with the pay now button of the orders listing).
The best is to keep the "created" status as the first status of the order, change the payable order statuses to "processed" instead of "created" and keep the confirmed order status as the paid order status.
That way, the orders first have the created status, then you add the additional info to the order and change it to processed, the user pays for it, and the order becomes confirmed.
Please Log in or Create an account to join the conversation.
13 years 7 months ago #89179
by peteritv
Replied by peteritv on topic A little more complex checkout
Please Log in or Create an account to join the conversation.
13 years 7 months ago - 13 years 7 months ago #89189
by peteritv
Replied by peteritv on topic A little more complex checkout
Hi Nicolas,
The status value in the payment system is what the status will be after execution. Not what the status must be before payment can take place. So I am missing the option to set which statuses are payable?
I experimented some more and also added status "requested" as the new initial status. From that moment on only that status is payable. All the other statuses are no longer payable, including "created", even though the "payed" status remains set to "confirmed".
So am I missing something, or can there be only 1 payable status --> the initial one?
Greetz,
Peter
The status value in the payment system is what the status will be after execution. Not what the status must be before payment can take place. So I am missing the option to set which statuses are payable?
I experimented some more and also added status "requested" as the new initial status. From that moment on only that status is payable. All the other statuses are no longer payable, including "created", even though the "payed" status remains set to "confirmed".
So am I missing something, or can there be only 1 payable status --> the initial one?
Greetz,
Peter
Last edit: 13 years 7 months ago by peteritv.
Please Log in or Create an account to join the conversation.
13 years 7 months ago #89356
by nicolas
Replied by nicolas on topic A little more complex checkout
Hi,
Yes, by default, the payable status is indeed the default one.
So if you want to change that, you can change the line:
to:
in the file "listing" of the view "order" of the frontend via the menu Display->Views.
Yes, by default, the payable status is indeed the default one.
So if you want to change that, you can change the line:
Code:
<?php if(!empty($row->show_payment_button) && bccomp($row->order_full_price,0,5)>0){ ?>
to:
Code:
<?php if($row->order_status=='proposed' && bccomp($row->order_full_price,0,5)>0){ ?>
in the file "listing" of the view "order" of the frontend via the menu Display->Views.
The following user(s) said Thank You: peteritv
Please Log in or Create an account to join the conversation.
13 years 7 months ago #89439
by peteritv
Replied by peteritv on topic A little more complex checkout
Thanks!!!
That gets the job done
That gets the job done
Please Log in or Create an account to join the conversation.
Time to create page: 0.237 seconds