Hi 2.0.4 ? beta :
I could not get this to work either
http://forum.virtuemart.net/index.php?topic=100911.0
I could just copy and paste a URL once. Am I doing something wrong ?
Hello all,
I am going to integrate new features in virtuemart 2.0.2 in joomla 1.7
I need help in that.
What i am doing is follow..
1 > From admin when i add new product or update existing product's image at that time i am selecting one color from list box, and when i save it.
2> color code will save in to database.
3> When i change the color it will display images related to that color.
4> The color list comes from the custom fields list which i have created as color.
5> I have also created on field in database table "__virtuemart_medias"
6> Please see attached file to get more idea what i mean.
7> I can change all image by ajax using list box onchange event. but when i delete or remove any image it will delete two image or add '0' value in database file_image_thumb field. I call ajax without color comparing.
I need to know is...
I have completed fetching colors that i have created in custom field.
My question is
1 > How can i save the color in database when i click on "save" or "save & close"?
2 > How can i call ajax on list box change event?
3 > How can i delete only the selected image on that i have clicked ? using ajax.
4> Sometimes ajax call give error as "you can not allow direct access or restricted area"
5> I want to change product image like this page
http://www.forever21.com/Product/Product.aspx?BR=f21&Category=dress_little_black_dress&ProductID=2000020408&VariantID=
Please give me suggestion.
Thanks
[attachment cleanup by admin]
HI,
To use databse in your plugin,
see
\plugins\vmcustom\specification\specification.phpfor a sample code
you must declare in the constructor the table and fields
see $this->tableFields
the function
protected function plgVmOnStoreInstallPluginTable($psType) {
helps you to automatic install the table in DB
to use ajax call we provide a controller to execute
YOu must set a joomla type url, basic working so
$url = JURI::root().'index.php?option=com_virtuemart&view=plugin&name=MUPLUGINNAME&value1='$myvalue1';.....
YOu can add format=json to render it with ajax
the function is in controller/plugin (back end and front end.) depending your needs.
You must in your plugin add a function that is automatic called if it's find by the trigger
Quotefunction plgVmOnSelfCallFE($type, $name, &$render) {
if ($name != $this->_name || $type != 'vmcustom') return false;
// your code here
$render="i want render this";
//or in json
$render=$myarrayorObject;
}
if you don't use jexit() at end the controller give you back the render(response) you have set in the $render value.
Just linking this post with another :
hopefully resolved ?
http://forum.virtuemart.net/index.php?topic=100911.0