Skip to content

Instantly share code, notes, and snippets.

@maximzasorin
Created November 6, 2015 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximzasorin/723d29f54d7a853b3308 to your computer and use it in GitHub Desktop.
Save maximzasorin/723d29f54d7a853b3308 to your computer and use it in GitHub Desktop.
Выбор первой области по умолчанию при оформлении заказа (HostCMS)
<?php
$oShopCountry = Core_Entity::factory('shop_country', $oShop->shop_country_id);
if ($oShopCountry)
{
$aoShopCountryLocations = $oShopCountry
->Shop_Country_Locations
->findAll();
$oShopCountryLocation = $aoShopCountryLocations[0];
if ($oShopCountryLocation)
{
$aoShopCountryLocationCities = $oShopCountryLocation
->Shop_Country_Location_Cities
->findAll();
$Shop_Address_Controller_Show
->addEntities($aoShopCountryLocations)
->addEntity(
Core::factory('Core_Xml_Entity')
->name('current_shop_country_location_id')
->value($oShopCountryLocation->id)
)
->addEntities($aoShopCountryLocationCities);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment