本文整理汇总了PHP中ShoppingCart::set_country方法的典型用法代码示例。如果您正苦于以下问题:PHP ShoppingCart::set_country方法的具体用法?PHP ShoppingCart::set_country怎么用?PHP ShoppingCart::set_country使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShoppingCart
的用法示例。
在下文中一共展示了ShoppingCart::set_country方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($controller, $name)
{
Requirements::javascript(ECOMMERCE_DIR . '/javascript/OrderFormWithoutShippingAddress.js');
parent::__construct($controller, $name);
//stop people adding different shipping address
$this->unsetActionByName("action_useDifferentShippingAddress");
$this->unsetActionByName("useDifferentShippingAddress");
$member = Member::currentMember();
if (!$member || !$member->ID || $member->Password == '') {
$this->fields->addFieldToTab("", new LiteralField('MemberInfoAlso', '<p class="message good LoginCallToAction">' . self::get_login_invite_alternative_text() . '</p>', $this), "FirstName");
//improve password field TEMPORARY HACK!
//$passwordField = new OptionalConfirmedPasswordField('Password', 'Password', '', null, true);
//$passwordField->minLength = 6;
//$passwordField->showOnClickTitle = "add password now";
//$this->fields->replaceField("Password", $passwordField);
Requirements::javascript(ECOMMERCE_DIR . '/javascript/OptionalConfirmedPasswordField.js');
Requirements::block(SAPPHIRE_DIR . '/javascript/ConfirmedPasswordField.js');
}
$this->fields->removeFieldFromTab("RightOrder", "MemberInfo");
//add extra fields
foreach (self::$extra_fields as $fieldCombo) {
$fieldCombo["FieldObject"]->setForm($this);
$this->fields->addFieldToTab($fieldCombo["TabName"], $fieldCombo["FieldObject"]);
}
//replace field for address
foreach ($this->fields->dataFields() as $i => $child) {
if (is_object($child)) {
$name = $child->Name();
switch ($name) {
case "Membership Details":
$child->setTitle('Retain Personal Details with Password');
break;
case "Address":
$child->setTitle('Street Address');
break;
case "AddressLine2":
$child->setRightTitle('<a href="' . self::$postal_code_url . '" id="OrderFormWithoutShippingAddressPostalCodeLink">' . self::$postal_code_label . '</a>');
$child->setTitle('Postal Code');
break;
case "Country":
if (self::$fixed_country_code) {
$child->setValue(self::$fixed_country_code);
ShoppingCart::set_country(self::$fixed_country_code);
}
break;
default:
break;
}
}
}
$this->fields->addFieldToTab("", new TextareaField('CustomerOrderNote', 'Note / Question', 7, 30, null, $this));
$data = $this->getData();
$this->loadDataFrom($data);
}
示例2: setcountry
/**
* Change country action
* */
function setcountry($request)
{
$countryCode = $request->param('ID');
if ($countryCode && strlen($countryCode) < 4) {
//to do: check if country exists
ShoppingCart::set_country($countryCode);
//return _t("ShoppingCart.COUNTRYUPDATED", "Country updated.");
return self::json_code();
}
return _t("ShoppingCart.COUNTRYCOULDNOTBEUPDATED", "Country not be updated.");
}
示例3: setcountry
/**
* Ajax method to set a country
*/
function setcountry()
{
$country = $this->urlParams['ID'];
if (isset($country)) {
ShoppingCart::set_country($country);
return self::json_code();
}
}
示例4: updateShippingCountry
function updateShippingCountry($data, $form, $request)
{
Session::set($this->FormName(), $data);
ShoppingCart::set_country($data['Country']);
if (Director::is_ajax()) {
return "success";
}
Director::redirectBack();
}