Hello all
I need to read setting.key Value, and it looks like:
a:1:{i:0;s:1:"5";}
how can I read it?
I mean, I see "5" and it is value that I need. Will that value always be on same place or it can be (for example)
a:12345:{i:0;s:1:"5";}
or
a:1:{i:0;s:12345:"5";}
Thanks.
I need to read setting.key Value, and it looks like:
a:1:{i:0;s:1:"5";}
how can I read it?
I mean, I see "5" and it is value that I need. Will that value always be on same place or it can be (for example)
a:12345:{i:0;s:1:"5";}
or
a:1:{i:0;s:12345:"5";}
Thanks.
Hello, please help me - is there any documentation regarding key value from setting table?
Thank you.
Thank you.
Do you want to read it for a change?krosoftware wrote:Hello all
I need to read setting.key Value, and it looks like:
a:1:{i:0;s:1:"5";}
how can I read it?
I mean, I see "5" and it is value that I need. Will that value always be on same place or it can be (for example)
a:12345:{i:0;s:1:"5";}
or
a:1:{i:0;s:12345:"5";}
Thanks.
Code: Select all
<?php
$str = 'a:1:{i:0;s:1:"5";}';
$arr = unserialize($str);
print_r($arr);
?>
Hello pm-netti
thank you for your code. Currently I need only to read values.
When I run it, I see
Array ( [0] => 5 )
Not sure how I can figure out that 5 is the number I need?
Now I changed Complete Order Status to hold 2 values (please see image)
in the database, I see a:2:{i:0;s:2:"24";i:1;s:1:"5";
if I run your code, I see this:
Array ( [0] => 24 [1] => 5 )
Additional, is there any way to read those values using JavaScript?
My life was easier when there was only 1 option to define when order is completed .. Any way to use only 1 value (like in 1.5.6.4?
thank you for your code. Currently I need only to read values.
When I run it, I see
Array ( [0] => 5 )
Not sure how I can figure out that 5 is the number I need?
Now I changed Complete Order Status to hold 2 values (please see image)
in the database, I see a:2:{i:0;s:2:"24";i:1;s:1:"5";
if I run your code, I see this:
Array ( [0] => 24 [1] => 5 )
Additional, is there any way to read those values using JavaScript?
My life was easier when there was only 1 option to define when order is completed .. Any way to use only 1 value (like in 1.5.6.4?
Attachments
Capture.PNG (16.2 KiB) Viewed 3201 times
Why you need to read it in the database the "limp" array?krosoftware wrote:Hello pm-netti
thank you for your code. Currently I need only to read values.
When I run it, I see
Array ( [0] => 5 )
Not sure how I can figure out that 5 is the number I need?
Now I changed Complete Order Status to hold 2 values (please see image)
in the database, I see a:2:{i:0;s:2:"24";i:1;s:1:"5";
if I run your code, I see this:
Array ( [0] => 24 [1] => 5 )
Additional, is there any way to read those values using JavaScript?
My life was easier when there was only 1 option to define when order is completed .. Any way to use only 1 value (like in 1.5.6.4?
Is not that graphic information on the event is not sufficient?
You use the config class to get settings values.
http://wiki.opencarthelp.com/doku.php?i ... config_get
Code: Select all
$this->config->get('foo');
-Ryan
Please see attached image. I need to know what status the order must reach before I can allow download of purchased products (for example). I'm using other software which use OC database. In the 1.5.6.4 there was only 1 value and it was easy to read what is the "Completed" value. Now, it is possible to choose unlimited values as "Completed". Problem is - I must read them all. With other words, I need to know what the Admin has been selected. Result is stored in serialized format and I have no idea how to read those values.pm-netti wrote:Why you need to read it in the database the "limp" array?krosoftware wrote:Hello pm-netti
thank you for your code. Currently I need only to read values.
When I run it, I see
Array ( [0] => 5 )
Not sure how I can figure out that 5 is the number I need?
Now I changed Complete Order Status to hold 2 values (please see image)
in the database, I see a:2:{i:0;s:2:"24";i:1;s:1:"5";
if I run your code, I see this:
Array ( [0] => 24 [1] => 5 )
Additional, is there any way to read those values using JavaScript?
My life was easier when there was only 1 option to define when order is completed .. Any way to use only 1 value (like in 1.5.6.4?
Is not that graphic information on the event is not sufficient?
Attachments
os.png (19.03 KiB) Viewed 3184 times
Thank you but I'm not using PHP. I need to somehow "translate" value which can be found under "config_complete_status" key, so I can put that value into "order" table, under order_status_id field.rph wrote:You use the config class to get settings values.http://wiki.opencarthelp.com/doku.php?i ... config_getCode: Select all
$this->config->get('foo');
Question is also how OC can take selected values which are defined as "complete" order and update "order_status_id" filed (which is integer) ?
I hope that someone can help me because I'm lost. In the 1.5.6.4 it was easy - Admin can choose only one value as "Completed" order and that value (integer) was used to update order.order_status_id
Now Admin can chose multiple values (using checkbox) to define "Complete" order and on "order" table still exists only integer value .. I don't understand how that should works.
http://us2.php.net/manual/en/function.s ... .php#66147
a = array
i = integer
s = string
O = object
N = null
b = boolean
A quick search turned up libraries to parse PHP serialized data in Python, Ruby On Rails, and Javascript so I seriously doubt you'd need to write one yourself.
a = array
i = integer
s = string
O = object
N = null
b = boolean
A quick search turned up libraries to parse PHP serialized data in Python, Ruby On Rails, and Javascript so I seriously doubt you'd need to write one yourself.
-Ryan
In this order statuses the values of admin source code:krosoftware wrote: In the 1.5.6.4 there was only 1 value and it was easy to read what is the "Completed" value. Now, it is possible to choose unlimited values as "Completed". Problem is - I must read them all. With other words, I need to know what the Admin has been selected. Result is stored in serialized format and I have no idea how to read those values.
7 = Canceled
9 = Canceled Reversal
13 = Chargeback
5 = Complete
8 = Denied
14 = Expired
10 = Failed
1 = Pending
15 = Processed
2 = Processing
11 = Refunded
12 = Reversed
3 = Shipped
16 = Voided
Ps. These may be divergence. You can check the source code or in the database table order_status.
Hellopm-netti wrote:In this order statuses the values of admin source code:krosoftware wrote: In the 1.5.6.4 there was only 1 value and it was easy to read what is the "Completed" value. Now, it is possible to choose unlimited values as "Completed". Problem is - I must read them all. With other words, I need to know what the Admin has been selected. Result is stored in serialized format and I have no idea how to read those values.
7 = Canceled
9 = Canceled Reversal
13 = Chargeback
5 = Complete
8 = Denied
14 = Expired
10 = Failed
1 = Pending
15 = Processed
2 = Processing
11 = Refunded
12 = Reversed
3 = Shipped
16 = Voided
Ps. These may be divergence. You can check the source code or in the database table order_status.
yes, in the orders_status you have this fields:
order_status_id, language_id, name
Problem is - on database table "setting", and in the filed "value", stored is something like this:
a:2:{i:0;s:2:"24";i:1;s:1:"5";}
before, it was something like 5, which means, 5 = Complete
now I need to somehow find out what I need to write into table order, field order_status_id, because I can write only one value (integer) and Administrator can select many values (using check box)..
I hope I explained well..
There is no sense for me to define more as 1 status as complete, but there is option to do that and I need to find out how to assign 2 or more values into 1 integer value.
Who is online
Users browsing this forum: No registered users and 51 guests