439
edits
(→Refresh the price instantly: Add javascript instant refresh code + more infos about commercial proposals) |
(→Refresh the price instantly: add an if statement) |
||
| Line 518: | Line 518: | ||
// Force refreshing total price | // Force refreshing total price | ||
$object->update_price(0, 'auto'); | $object->update_price(0, 'auto'); | ||
// Force refresh the page to update prices that were printed before the custom field aftersave was triggered | // Force refresh the page to update prices that were printed before the custom field aftersave was triggered (and only if not creating the object because then there's no need to refresh) | ||
print('<script type="text/javascript">window.location.href = window.location.pathname + window.location.search;</script>'); | if ($action !== 'add') print('<script type="text/javascript">window.location.href = window.location.pathname + window.location.search;</script>'); | ||
} | } | ||
</source> | </source> | ||
| Line 532: | Line 532: | ||
// Force refreshing total price | // Force refreshing total price | ||
$object->update_price(0, 'auto'); | $object->update_price(0, 'auto'); | ||
// Force refresh the page to update prices that were printed before the custom field aftersave was triggered | // Force refresh the page to update prices that were printed before the custom field aftersave was triggered (and only if not creating the object because then there's no need to refresh) | ||
print('<script type="text/javascript">window.location.href = window.location.pathname + window.location.search;</script>'); | if ($action !== 'add') print('<script type="text/javascript">window.location.href = window.location.pathname + window.location.search;</script>'); | ||
} | } | ||
| Line 540: | Line 540: | ||
// Force refreshing total price | // Force refreshing total price | ||
$object->update_price(0, 'auto'); | $object->update_price(0, 'auto'); | ||
// Force refresh the page to update prices that were printed before the custom field aftersave was triggered | // Force refresh the page to update prices that were printed before the custom field aftersave was triggered (and only if not creating the object because then there's no need to refresh) | ||
print('<script type="text/javascript">window.location.href = window.location.pathname + window.location.search;</script>'); | if ($action !== 'add') print('<script type="text/javascript">window.location.href = window.location.pathname + window.location.search;</script>'); | ||
} | } | ||
</source> | </source> | ||
edits