Call External XML For Pricing
Hi,
Sorry if this sounds 'noob'. PHP, JS experience: high. Drupal experience: medium. But Drupal Commerce experience: low. (I've worked with other Drupal shopping carts, though.)
I've been asked to help the admin (who set up the store but has limited PHP/js experience.) with one very specific task so I apologise up front if this is an RTFM question.
When the user clicks the 'Add' button to select a product and quantity and add line item to cart I need that form submit to trigger sending a URL string to an external database which then returns an XML file with the proper pricing.
I was hoping there was a simple way to hook into the form submit, send an AJAX request and update the form vars with the returned object.
My hope is to implement this cleanly... ie. without messing with the core ( it seems that this is handled in the line_item_controller inc.) so I guess I'm asking for a pointer to the appropriate docs or tuts.
TIA,
---JC
Comments
Hit the Submit button too quick...
I was wondering if there wasn't a way to call a wrapper function to SimpleXML(myXMLFile) and update the line item fields before the actual -save- to the db.