I want to customize the "Add to Cart" button of the "Online" store products

On my site, I have several types of store.

I want to customize the “Add to Cart” button of the “Online” store products.

I created a custom module for Drupal 8.6 and Drupal Commerce 2.11

Currently there are errors in my code. All products in any type of store are personalized.

How to limit the code only to the current store of type “online” ?

https://docs.drupalcommerce.org/commerce2/developer-guide/stores/create-…

<?php
 
/**
* @file
* Hook implementations of commerce_marketplace_premium_merchant module.
*/
 
use Drupalcommerce_storeEntityStoreType;
use Drupalcommerce_productEntityProductType;
use Drupalcommerce_productEntityProductVariationType;
use DrupalCoreEntityDisplayEntityViewDisplayInterface;
use DrupalCoreEntityEntityInterface;
use DrupalCoreUrl;
 
/**
* Store online.
*/
function commerce_marketplace_premium_merchant_form_commerce_order_item_add_to_cart_form_alter(&$form, DrupalCoreFormFormStateInterface $form_state, $form_id) {
$current_store = Drupal::service('commerce_store.current_store');
$store_type = $current_store->Drupalcommerce_storeEntityStoreType::load('online');
if ($store_type) {
if (isset($form["#attributes"]["class"]) && in_array("commerce-order-item-add-to-cart-form", $form["#attributes"]["class"])) {
$selectedVariationId = $form_state->get('selected_variation');
$selectedVariation = Drupalcommerce_productEntityProductVariation::load($selectedVariationId);
$form['actions']['submit']['#value'] = t('Subscribe');
}
}
}

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed