Plugin-Unterstützung für WooCommerce-Abonnements

Um das WooCommerce-Abonnement-Plugin zu unterstützen, müssen Sie die folgende Datei in Ihrem Kind-Thema > wp-content/themes/child-theme/woocommerce/ single-product/add-to-card/variable-subscription erstellen.php

<?php/** * Variables Abonnement-Produkt in den Warenkorb legen * * @author Prospress * @Paket WooCommerce-Abonnements/Vorlagen * @Version 2.2.20 */wenn ( ! definiert ( 'ABSPATH' ) ) {Ausgang;}globales $Produkt;$attribute_Schlüssel=array_keys( $attribute );$user_id=get_current_user_id();do_action( 'woocommerce_before_add_to_cart_form' ); ?><form class="variations_form cart" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $Produkt->get_id() ); ?>" data-product_variations="<?php echo htmlspecialchars( wcs_json_encode( $available_variations ) ) ?>"><?php do_action( 'woocommerce_before_variations_form' ); ?><?php wenn ( empty( $available_variations ) && false !== $verfügbare_Variationen ) : ?><p class="stock out-of-stock"><?php esc_html_e( 'Dieses Produkt ist derzeit nicht auf Lager und nicht verfügbar.', 'Woocommerce-Abonnements' ); ?></p><?php sonst : ?><?php wenn ( ! $product->is_purchasable() && 0 != $user_id && 'nein' != wcs_get_product_limitation( $product ) && wcs_is_product_limited_for_user( $product, $user_id ) ) : ?><?php $resubscribe_link=wcs_get_users_resubscribe_link_for_product( $product->get_id() ); ?><?php wenn ( ! empty( $resubscribe_link ) && 'any' == wcs_get_product_limitation( $product ) && wcs_user_has_subscription( $user_id, $product->get_id(), wcs_get_product_limitation( $product ) ) && ! wcs_user_has_subscription( $user_id, $product->get_id(), 'aktiv' ) && ! wcs_user_has_subscription( $user_id, $product->get_id(), 'on-hold' ) ) : // Kunde hat ein inaktives Abonnement, eventuell den Erneuerungsknopf anbieten ?><a href="<?php echo esc_url( $resubscribe_link ); ?>" class="Schaltfläche Produkt-Abonnement-Link"><?php esc_html_e( 'Resubscribe', 'Woocommerce-Abonnements' ); ?></a><?php sonst : ?><p class="Mitteilung über ein begrenztes Abonnement"><?php esc_html_d( 'Sie haben bereits ein aktives Abonnement für dieses Produkt.', 'Woocommerce-Abonnements' ); ?></p><?php endif; ?><?php sonst : ?><Tabelle class="variations" cellspacing="0"><tbody><?php foreach ( $attribute als $attribut_name => $options ) : ?><tr><td class="label"><label for="<?php echo esc_attr( sanitize_title( $attribut_name ) ); ?>"><?php echo esc_html( wc_attribute_label( $attribut_name ) ); ?></label></td><td class="Wert"><?php$ausgewählt=isset( $_REQUEST ) ? wc_clean( $_REQUEST ) : $product->get_variation_default_attribute( $attribut_name );$Bilds=array();foreach ($Optionen als $Option) {$term=get_term_by('Schnecke', $option, $attribut_name);$Bild=apply_filters('woocommerce_attribute_value_image', esc_html( $term->name ), $term->term_id, true);if(!leer($Bild)) {$Bilds[]='<a href="#" class="woocommerce-attribute-images-variable-option" data-attribute-value="'' . $term->Schnecke . '" Daten-Attribut-Name="'' . $attribut_name . ''>'' . $Bild . '</a>';}}if(!empty($Bilds) && count($Bilds) == count($options)) {echo '<div class="woocommerce-attribute-images-variable-options">';echo implode(' ', $Bilds);echo '<div class="clear"></div></div>';echo '<div style="Anzeige: keine;">';}wc_dropdown_variation_attribute_options( array( 'options' => $options, 'attribute' => $attribut_name, 'product' => $product, 'selected' => $selected ) );if(!empty($Bilds) && count($Bilds) == count($options)) {echo '</div>';}// wc_dropdown_variation_attribute_options( array( 'options' => $options, 'attribute' => $attribut_name, 'product' => $product, 'selected' => $selected ) );// echo wp_kses( end( $attribute_keys ) === $attribut_name ? apply_filters( 'woocommerce_reset_variations_link', '<a class="reset_variations" href="#">' . __( 'Löschen', 'Woocommerce-Abonnements' ) . '</a>' ) : '', array( 'a' => array( 'class' => array(), 'href' => array() ) );?></td></tr><?php endforeach;?></Körper></Tabelle><?php/** * Post WC 3.4 der woocommerce_before_add_to_cart_button-Hook wird durch den Callback @see woocommerce_single_variation_add_to_cart_button() ausgelöst, der auf woocommerce_single_variation_hooked ist. */wenn ( WC_Subscriptions::is_woocommerce_pre( '3.4' ) ) {do_action( 'woocommerce_before_add_to_cart_button' );}?><div class="Einzel_Variation_Wrap"><?php/** * woocommerce_before_single_variation Haken. */do_action( 'woocommerce_before_single_variation' );/** * woocommerce_single_variation hook. Wird zur Ausgabe der Schaltfläche für den Warenkorb und des Platzhalters für Variationsdaten verwendet. * @seit 2.4.0 * @hooked woocommerce_single_variation - 10 Leere div für Variationsdaten. * @hooked woocommerce_single_variation_add_to_cart_button - 20 Mengen- und Warenkorb-Button. */do_action( 'woocommerce_single_variation' );/** * woocommerce_after_single_variation Haken. */do_action( 'woocommerce_after_single_variation' );?></div><?php do_action( 'woocommerce_after_add_to_cart_button' ); ?><?php endif; ?><?php endif; ?><?php do_action( 'woocommerce_after_variations_form' ); ?></form><?phpdo_action( 'woocommerce_after_add_to_cart_form' );

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert