使用woocommerce时,将html元素添加到includes / abstracts文件夹中包含的文件中?

时间:2015-04-15 17:53:34

标签: php wordpress woocommerce

无法找到如何覆盖woocommerce / includes / abstracts / abstract-wc-payment-gateway.php文件的正确解决方案。 我只需要在这部分代码中添加一些html元素:

$default_fields = array(
        'card-number-field' => '<p class="form-row form-row-wide">
            <label for="' . esc_attr( $this->id ) . '-card-number">' . __( 'Card Number', 'woocommerce' ) . ' <span class="required">*</span></label>
            <input id="' . esc_attr( $this->id ) . '-card-number" class="input-text wc-credit-card-form-card-number" type="text" maxlength="20" autocomplete="off" placeholder="•••• •••• •••• ••••" name="' . ( $args['fields_have_names'] ? $this->id . '-card-number' : '' ) . '" />
        </p>',
        'card-expiry-field' => '<p class="form-row form-row-first">
            <label for="' . esc_attr( $this->id ) . '-card-expiry">' . __( 'Expiration Date', 'woocommerce' ) . ' <span class="required">*</span></label>
            <input id="' . esc_attr( $this->id ) . '-card-expiry" class="input-text wc-credit-card-form-card-expiry" type="text" autocomplete="off" placeholder="' . __( 'MM / YY', 'woocommerce' ) . '" name="' . ( $args['fields_have_names'] ? $this->id . '-card-expiry' : '' ) . '" />
        </p>',
        'card-cvc-field' => '<p class="form-row form-row-last">
            <label for="' . esc_attr( $this->id ) . '-card-cvc">' . __( 'Security Code', 'woocommerce' ) . ' <span class="required">*</span></label>
            <input id="' . esc_attr( $this->id ) . '-card-cvc" class="input-text wc-credit-card-form-card-cvc" type="text" autocomplete="off" placeholder="' . __( 'CVC', 'woocommerce' ) . '" name="' . ( $args['fields_have_names'] ? $this->id . '-card-cvc' : '' ) . '" />
        </p>'
    );

我尝试过这个帖子Override woocomerce files from includes folder的解决方案,但没有运气。 有人可以帮助解决方案。感谢

0 个答案:

没有答案