• Resolved denism300

    (@denism300)


    I want to customize the HTML code for the subscription checkbox in WooCommerce.
    Now the code looks like this:

    private function getSubscriptionField($inputName, $checked, $labelString) {
        return '<p class="form-row">
          <label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
          <input type="checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" name="' . $this->wp->escAttr($inputName) . '" id="' . $this->wp->escAttr($inputName) . '" ' . ($checked ? 'checked' : '') . ' />
            <span class="woocommerce-terms-and-conditions-checkbox-text">' . $this->wp->escHtml($labelString) . '</label>
        </p>';
      }

    I need it to be that way since I use Bootstrap 4

    private function getSubscriptionField($inputName, $checked, $labelString)
      {
        return '<div class="form-group form-check">
          <input type="checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" name="' . $this->wp->escAttr($inputName) . '" id="' . $this->wp->escAttr($inputName) . '" ' . ($checked ? 'checked' : '') . ' />
          <label for="' . $this->wp->escAttr($inputName) . '" class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
            <span class="woocommerce-terms-and-conditions-checkbox-text">' . $this->wp->escHtml($labelString) . '</label>
        </div>';
      }

    How can I do this without changing the code in the file /plugins/mailpoet/lib/WooCommerce/Subscription.php ?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Custom checkbox in WooCommerce’ is closed to new replies.