INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to do this

How to do this

(OP)
$newProductData = array(
'name' => 'name of product',
// websites - Array of website ids to which you want to assign a new product
'websites' => array(1), // array(1,2,3,...)
'short_description' => 'short description',
'description' => 'description',
'status' => 1,
'weight' => 0,
'tax_class_id' => 1,
'categories' => array(3), //3 is the category id
'price' => 12.05
);

This is Php Coding..
How to convert the above data into power builder

RE: How to do this

So this looks like you want to set up an array of 'websites' each with a set of attributes?
The easiest way is to create a non visual object and within it declare however many instance variables to correspond to the attributes and their data types (strings, integers, etc.)
You can then declare an array of these objects and populate their attributes as needed.

So you would have an object called 'nvo_product'.
That object has instance variables like the following
string is_short_description
string is_description
integer ii_status
integer ii_weight
integer ii_tax_class_id
integer ii_category_id
decimal{4} idc_price

In code you create an array of 'nvo_product' objects

nvo_product lnv_product[] // unbounded array
// populate the first element of the array
lnv_product[1].is_short_description = 'short'
lnv_product[1].is_description = 'description'
lnv_product[1].ii_status = 1
lnv_product[1].ii_weight = 0
lnv_product[1].ii_tax_class_id = 1
....

Matt

"Nature forges everything on the anvil of time"
www.anvil-of-time.com

RE: How to do this

another suggestion is to define a "structure object" or a structure within your window or within a userobject

Suppose your structure is named "str_struct" with fields "s_name", "s_websites", "s_categories[3]" etc., then you'd declare a variable of that type as follows:

// local variable declaration (first you have to have defined/created the structure of course)
str_struct lstr_product[] // lstr_product[10] would limit your array up to 10 elements



// and you would access as follows
lstr_product[1].s_name = 'productname whatever'
lstr_product[1].s_websites = 'http://whatever.com'
lstr_product[1].s_categories[1] = "cat1"
lstr_product[1].s_categories[2] = "cat2"
lstr_product[1].s_categories[3] = "cat3"
// .... etc.

regards,
Miguel L.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close