You are here

function mailchimp_ecommerce_update_store in Mailchimp E-Commerce 7

Update a store name or currency code.

Parameters

string $store_id: The ID of the store.

string $name: The name of the store.

string $currency_code: The three-letter ISO 4217 code.

string $platform: The eCommerce platform being used to create this store. This module's submodules use 'Drupal Ubercart' and 'Drupal Commerce'.

1 call to mailchimp_ecommerce_update_store()
mailchimp_ecommerce_admin_settings_submit in includes/mailchimp_ecommerce.admin.inc
Submit handler for the Mailchimp eCommerce form.

File

./mailchimp_ecommerce.module, line 263
Mailchimp eCommerce core functionality.

Code

function mailchimp_ecommerce_update_store($store_id, $name, $currency_code, $platform) {
  try {

    /* @var \Mailchimp\MailchimpEcommerce $mc_ecommerce */
    $mc_ecommerce = mailchimp_get_api_object('MailchimpEcommerce');
    $parameters = [
      'platform' => $platform,
    ];
    $mc_ecommerce
      ->updateStore($store_id, $name, $currency_code, $parameters);
  } catch (Exception $e) {
    mailchimp_ecommerce_log_error_message('Unable to update a store: ' . $e
      ->getMessage());
    mailchimp_ecommerce_show_error($e
      ->getMessage());
  }
}