-1

i cant find out what does name_get()[0][1]

display_name = product_id.name_get()[0][1]
       if product_id.description_sale:
           display_name += '\n' + product_id.description_sale

1 Answers1

0

Breaking it down backwards: [0][1] indicates an element of a 2d array (an array that has elements which are also arrays), so therefore we can infer that the expectation is that name_get() returns a 2d array - we can't say anything about the type of values inside those arrays though - python is dynamically typed.

product.name_get() indicates that name_get() is a method/function of the product class/file.

As an example - name_get() might return something like

[ ["savings account", "current account"], ["credit card", "store card"] ]

so name_get()[0][1] would evaluate to "current account"

0xadecimal
  • 696
  • 5
  • 18