1. RobertoDS
  2. RO CSVI
  3. Sunday, 18 June 2017
  4.  Subscribe via email
Im trying to create a plugin to export and calculate some field but it seemstome that i'm not able to call customfield...
i'm using this function to get the value:
$Var1= $fields->getField($settings->var1Xml)->value;
Icreated a plugin where i can write the names of the custom field and i set it up on the xml
Accepted Answer Pending Moderation
The customfield name are UPPERCASE (ex. COM_VIRTUEMART_APA_P_LISTINO) ... if this can be the issue
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hello,
Are you writing a custom rule plugin for VirtueMart export? If yes, please have a look at Writing a rule plugin document to know on it. Check if all the variables are set according to the document so to get the value.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
I've chekced multipletimes but i can't find what's wrong:

I have a custom field called COM_VIRTUEMART_APA_P_NETTO (in the language file translated as: PREZZO NETTO)

in the plugin xml file:
<field name="listprice"
label="COM_CSVI_PLUGINFORM_PRICE_LIST_LABEL"
type="text"
required="true"
class="input-normal" />
in the plugin php file I left only:
$value = $fields->getField($settings->listprice)->value;
I tried also $value = $fields->getField($settings->listprice);

Still no result
If I pass a manual value to $value it works.. but not as I showed before

Ideas?
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hello,
Try to put only $settings->listprice instead of $fields->getField($settings->listprice); in your php file and see if you get the value from the XML form.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
done already and it wotks.. it shows COM_VIRTUEMART_APA_P_NETTO
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
It still doesn't give me the value though
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello,
Since you said that it is a language string you need to user JText to get the translated value like JText::_('COM_VIRTUEMART_APA_P_NETTO').
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
don't understand
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
the custom field name is COM_VIRTUEMART_APA_P_NETTO
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hello,
I have a custom field called COM_VIRTUEMART_APA_P_NETTO (in the language file translated as: PREZZO NETTO)

Probably i understood wrong. I thought you wanted the translated value of custom field COM_VIRTUEMART_APA_P_NETTO which is in language file. To do that you need to use JText as explained in my previous post.

The $settings->listprice will get you the value you have in text field in your XML form. I don't understand what else value you are looking for.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
the content value of the custom field:
COM_VIRTUEMART_APA_P_NETTO is a custom field charged for every product so in the plugin form i pass the name of the custom field that I have to get in the plugin php... but i dont know how to get it....
lets say that in the custom field i have the value 100 for theproduct X
... how can I get the value 100?
  1. more than a month ago
  2. RO CSVI
  3. # 11
Accepted Answer Pending Moderation
Hello,
You need to write SQL query to get the value of the custom field from virtuemart_product_customfields table. To do that write query to get the virtuemart_custom_id of COM_VIRTUEMART_APA_P_NETTO from virtuemart_customs table and then using this virtuemart_custom_id and virtuemart_product_id you can get the value from virtuemart_product_customfields table. Since this is your custom code it is out of CSVI scope to help more on this.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
ok
  1. more than a month ago
  2. RO CSVI
  3. # 13
Accepted Answer Pending Moderation
I solved creating an exported suspended field fields... then I used the given name of the field inside my plugin
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
Glad to know that you solved it.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 15
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!