News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

specielt plugin help needed.

Started by jshoeks, February 27, 2013, 15:13:04 PM

Previous topic - Next topic

jshoeks

hey,

I'm developing a plugin for a client that we wanna do some general info to be added, depending on the choices made in the dropdown possibilities.

I have the calculation working for a single item.

When changing options in the dropdown, i want to add some HTML info at the shopping carts and pricings.

I haven't found any easy ways of doing this... anyone have any idea, on how I can add a little list with 4 prices based on the current config, with a "add to shopping cart" buttons

something like what i have drawn on this screenshot.

if you could help me, please post how, if possible or some sort of simple work around.

its for VirtueMart 2.0.18a

[attachment cleanup by admin]

PRO


jshoeks

They want to add easy selections for alternative configurations from the dropdown, instead of having to choose the value in the dropdown.

PRO

Quote from: jswebpilots on February 27, 2013, 15:19:58 PM
They want to add easy selections for alternative configurations from the dropdown, instead of having to choose the value in the dropdown.

if you want a dropdown to change "other" elements on the page.
I think you are going to have to use Jquery

jshoeks

yes i proberly do... but i still need a way to feed it from the plugin to the javascript that loads it into another location on the page.

PRO

Quote from: jswebpilots on February 27, 2013, 19:30:26 PM
yes i proberly do... but i still need a way to feed it from the plugin to the javascript that loads it into another location on the page.


its either that, or use absolute positioning

jshoeks

yes but i still have no idea, how i can get a plugin on priceupdate to do a javascript update of another element on the page.

PRO

what you are going to have to do is load the JS for all the selects into  into the head of the page.
also add what happens when they select

THEN: add a class/id to each select.

http://api.jquery.com/selected-selector/



jshoeks

that i have already done... what i need is the way to ask the plugin to do the calculation of the prices for the output...
like i can do this for adding item to carts
index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&customPlugin[13][xxx][F2]=1&customPlugin[13][xxx][F5]=1&customPlugin[13][xxx][F6]=1&customPlugin[13][xxx][F7]=1&customPlugin[13][xxx][F8]=1&customPrice[0][8]=13&quantity[]=1000&virtuemart_product_id[]=1&_=1362054655615

but is there a string like that i can execute with a $.getJSON(url) and get an answer back from the plugin ?

PRO

I dont understand.

are you trying to modify the price?

or to show the price that you have already modified?

have you looked in other custom field plugins to see how they do it?

jshoeks

i can calculate the modified price per item fine...

but i wanna show 4 buttons that  give easy access to add other quantities of items than the once put into the box...

the showed product could be socks or something like that, where you can set how many item you want or click one of the 4 buttoms to get 10/20/30/40 items.
it seems i can't make a javascript ask a vm plugin to return some custom html, that i can post on the page from that...

or is there a way i haven't found to do this ?

PRO

you dont have js ask the plugin


You make the plugin create the JS

jshoeks

well yes, but that means that the price calculation method has to be put into the javascript where i would prefer it not to be...

PRO

what have you done?

what is your code? and how are you doing it?

download this plugin I made
http://www.kaizenmediaworks.com/virtuemart-2-0-custom-field-dropbox-plugin

and look at where it changes the price.

how are you calculating the price now?