Post by thefurnitureguys » Thu Mar 01, 2018 5:29 am

Hey guys,

I'm super stumped here so I'm turning to the forum to see if someone is willing point me in the right direction.

From the admin 'Add new Order' form (order_form.twig), is there any possible way to have a dialog popup at the top of...
$('#button-shipping-method').on('click', function() {

... and pass a variable to the function ...
function getQuote($address) {

...when it's called with...
$.ajax({
url: '{{ catalog }}index.php?route=api/shipping/method&api_token={{ api_token }}&store_id=' + $('select[name=\'store_id\'] option:selected').val(),

...?

We design and manufacture furniture. The desks for example, could have a bunch of parts in it that could also be in any number of other types of desks, so I can't even map the sub parts to a main product cause they could be in anything that is designed.
The way they do it now is look at the AutoCAD drawing they designed, and manually specify a shipping price.
ie. "Okay, I designed a U shaped workstation, so I'll charge this money money for shipping in the invoice.."

There's no way that I can see to calculate the price of shipping automatically so I thought I would have a model popup when they click the "Apply" button on the totals tab page of the admin create order page (order_form.twig). After they calculate the price in the model popup, the could click an "OK" button in it, the model dialog would close, and pass the shipping price to function getQuote($address) { in the shipping module I created.
ie.
function getQuote($address, $shipping_price) {
...
$quote_data['calc'] = array(
'code' => 'tfg.calc',
'title' => $this->language->get('text_description'),
'cost' => $shipping_price,
'tax_class_id' => 0,
'text' => ''
);

Is there any way to do this? I could use vqmod to add the model dialog code to order_form.twig but I can't figure out how I could pass the shipping price to the getQuote function.

I'm so out of ideas and could really really really use some help with this ASAP.

If anyone could help me out here, I would be very thankful.

Thanks in advance,
-Andrew

Attachments

the shipping module I created, trying to pass shipping price to...



Posts

Joined
Sat Feb 24, 2018 12:28 am

Post by straightlight » Tue Mar 13, 2018 4:53 am

What hasn't been mentioned on the above is where does the shipping price itself needs to be generated from during the event. Would it be possible to provide more information on that?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 373 guests