http://www.road.media
We use our own city auto-detection by IP. How can I pass it to the OPC?
It is important to use our own technology, since it is very specific.
We tried to transmit the data in this way (through a template index file):
- Code: Select all
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT.'/administrator/components/com_virtuemart/helpers/config.php');
if(!class_exists('VirtueMartCart')) require(JPATH_ROOT.'/components/com_virtuemart/helpers/cart.php');
$geocart = VirtueMartCart::getCart();
$cartaddress["city"]=$found_city_name;
$cartaddress["zip"]=$found_city_post_code;
$geocart->saveAddressInCart($cartaddress, "ST");
$geocart->saveAddressInCart($cartaddress, "BT");
But it works only while the cart is not yet initialized.
If we put any product in the basket, then the code will no longer have any effect on the address.
Can you advise me?
Best regards, Anton