- Posts: 575
- Thank you received: 11
Custom save order code can not paid later
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
6 years 2 months ago #321392
by ler@singmuiheng.com
Custom save order code can not paid later was created by ler@singmuiheng.com
-- HikaShop version -- : 4.3
-- Joomla version -- : 3.9.12
-- PHP version -- : 5.6
Hi Dear
We are able to save order into hikashop in another integration, but we turn on "paid later" option, the payment button is not shown in order listing
The normal checkout order can show this button for payment
We suspect because we didn't set payment detail properly in order class
Can you advise what is missing or what is wrong here?
-- Joomla version -- : 3.9.12
-- PHP version -- : 5.6
Hi Dear
We are able to save order into hikashop in another integration, but we turn on "paid later" option, the payment button is not shown in order listing
The normal checkout order can show this button for payment
We suspect because we didn't set payment detail properly in order class
Can you advise what is missing or what is wrong here?
Code:
$order = new stdClass();
$order->order_full_price = $product->product_sort_price;
$order->order_currency_id = 96;
$order->order_user_id = $hika_user_id;
$order->order_status = $status;
//we checked database this two field are still empty, suspect we write the wrong format
$order->cart->order_payment_id = '1';
$order->cart->order_payment_method = 'Online Banking / Credit Card';
$order->cart->products = array($order_product);
$orderClass = hikashop_get('class.order');
$orderClass->save($order);
Please Log in or Create an account to join the conversation.
6 years 2 months ago #321426
by nicolas
Replied by nicolas on topic Custom save order code can not paid later
Hi,
I don't think it comes from that code.
Did you activate the order status you want to have the button for under the "unpaid" column of the System>Order statuses menu ?
I don't think it comes from that code.
Did you activate the order status you want to have the button for under the "unpaid" column of the System>Order statuses menu ?
The following user(s) said Thank You: ler@singmuiheng.com
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
- Posts: 575
- Thank you received: 11
6 years 2 months ago #321481
by ler@singmuiheng.com
Replied by ler@singmuiheng.com on topic Custom save order code can not paid later
The problem indeed related to order status
One more question
we have a variable $addressfield want to write into order as well
but did not manage to get it, any example for us to reference to save address into order?
One more question
we have a variable $addressfield want to write into order as well
but did not manage to get it, any example for us to reference to save address into order?
Please Log in or Create an account to join the conversation.
6 years 2 months ago #321493
by nicolas
Replied by nicolas on topic Custom save order code can not paid later
Hi,
Normally, there are several fields, and you save that in the hikashop_address table and then you just take the address_id and use it in the $order object with the attributes order_shipping_address_id and order_billing_address_id.
Now if you only have one field for the whole address, then either you want to split the address before doing what I just wrote above, or you want to create a custom field of the table "order" and of the type "text area", and save that address text in the custom field.
Normally, there are several fields, and you save that in the hikashop_address table and then you just take the address_id and use it in the $order object with the attributes order_shipping_address_id and order_billing_address_id.
Now if you only have one field for the whole address, then either you want to split the address before doing what I just wrote above, or you want to create a custom field of the table "order" and of the type "text area", and save that address text in the custom field.
Please Log in or Create an account to join the conversation.
Time to create page: 0.149 seconds