{"id":437,"date":"2018-09-11T17:54:33","date_gmt":"2018-09-11T17:54:33","guid":{"rendered":"https:\/\/demos.welaunch.io\/woocommerce-attribute-images\/?post_type=faq&#038;p=437"},"modified":"2020-08-06T11:19:32","modified_gmt":"2020-08-06T09:19:32","slug":"woocommerce-abonnements-unterstuetzung","status":"publish","type":"faq","link":"https:\/\/www.welaunch.io\/de\/wissensdatenbank\/faq\/woocommerce-abonnements-unterstuetzung\/","title":{"rendered":"Plugin-Unterst\u00fctzung f\u00fcr WooCommerce-Abonnements"},"content":{"rendered":"<p>Um das WooCommerce-Abonnement-Plugin zu unterst\u00fctzen, m\u00fcssen Sie die folgende Datei in Ihrem Kind-Thema &gt; wp-content\/themes\/child-theme\/woocommerce\/ single-product\/add-to-card\/variable-subscription erstellen.php<\/p>\n<pre>&lt;?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\u00fcssel=array_keys( $attribute );$user_id=get_current_user_id();do_action( 'woocommerce_before_add_to_cart_form' ); ?&gt;&lt;form class=\"variations_form cart\" method=\"post\" enctype='multipart\/form-data' data-product_id=\"&lt;?php echo absint( $Produkt-&gt;get_id() ); ?&gt;\" data-product_variations=\"&lt;?php echo htmlspecialchars( wcs_json_encode( $available_variations ) ) ?&gt;\"&gt;&lt;?php do_action( 'woocommerce_before_variations_form' ); ?&gt;&lt;?php wenn ( empty( $available_variations ) &amp;&amp; false !== $verf\u00fcgbare_Variationen ) : ?&gt;&lt;p class=\"stock out-of-stock\"&gt;&lt;?php esc_html_e( 'Dieses Produkt ist derzeit nicht auf Lager und nicht verf\u00fcgbar.', 'Woocommerce-Abonnements' ); ?&gt;&lt;\/p&gt;&lt;?php sonst : ?&gt;&lt;?php wenn ( ! $product-&gt;is_purchasable() &amp;&amp; 0 != $user_id &amp;&amp; 'nein' != wcs_get_product_limitation( $product ) &amp;&amp; wcs_is_product_limited_for_user( $product, $user_id ) ) : ?&gt;&lt;?php $resubscribe_link=wcs_get_users_resubscribe_link_for_product( $product-&gt;get_id() ); ?&gt;&lt;?php wenn ( ! empty( $resubscribe_link ) &amp;&amp; 'any' == wcs_get_product_limitation( $product ) &amp;&amp; wcs_user_has_subscription( $user_id, $product-&gt;get_id(), wcs_get_product_limitation( $product ) ) &amp;&amp; ! wcs_user_has_subscription( $user_id, $product-&gt;get_id(), 'aktiv' ) &amp;&amp; ! wcs_user_has_subscription( $user_id, $product-&gt;get_id(), 'on-hold' ) ) : \/\/ Kunde hat ein inaktives Abonnement, eventuell den Erneuerungsknopf anbieten ?&gt;&lt;a href=\"&lt;?php echo esc_url( $resubscribe_link ); ?&gt;\" class=\"Schaltfl\u00e4che Produkt-Abonnement-Link\"&gt;&lt;?php esc_html_e( 'Resubscribe', 'Woocommerce-Abonnements' ); ?&gt;&lt;\/a&gt;&lt;?php sonst : ?&gt;&lt;p class=\"Mitteilung \u00fcber ein begrenztes Abonnement\"&gt;&lt;?php esc_html_d( 'Sie haben bereits ein aktives Abonnement f\u00fcr dieses Produkt.', 'Woocommerce-Abonnements' ); ?&gt;&lt;\/p&gt;&lt;?php endif; ?&gt;&lt;?php sonst : ?&gt;&lt;Tabelle class=\"variations\" cellspacing=\"0\"&gt;&lt;tbody&gt;&lt;?php foreach ( $attribute als $attribut_name =&gt; $options ) : ?&gt;&lt;tr&gt;&lt;td class=\"label\"&gt;&lt;label for=\"&lt;?php echo esc_attr( sanitize_title( $attribut_name ) ); ?&gt;\"&gt;&lt;?php echo esc_html( wc_attribute_label( $attribut_name ) ); ?&gt;&lt;\/label&gt;&lt;\/td&gt;&lt;td class=\"Wert\"&gt;&lt;?php$ausgew\u00e4hlt=isset( $_REQUEST ) ? wc_clean( $_REQUEST ) : $product-&gt;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-&gt;name ), $term-&gt;term_id, true);if(!leer($Bild)) {$Bilds[]='&lt;a href=\"#\" class=\"woocommerce-attribute-images-variable-option\" data-attribute-value=\"'' . $term-&gt;Schnecke . '\" Daten-Attribut-Name=\"'' . $attribut_name . ''&gt;'' . $Bild . '&lt;\/a&gt;';}}if(!empty($Bilds) &amp;&amp; count($Bilds) == count($options)) {echo '&lt;div class=\"woocommerce-attribute-images-variable-options\"&gt;';echo implode(' ', $Bilds);echo '&lt;div class=\"clear\"&gt;&lt;\/div&gt;&lt;\/div&gt;';echo '&lt;div style=\"Anzeige: keine;\"&gt;';}wc_dropdown_variation_attribute_options( array( 'options' =&gt; $options, 'attribute' =&gt; $attribut_name, 'product' =&gt; $product, 'selected' =&gt; $selected ) );if(!empty($Bilds) &amp;&amp; count($Bilds) == count($options)) {echo '&lt;\/div&gt;';}\/\/ wc_dropdown_variation_attribute_options( array( 'options' =&gt; $options, 'attribute' =&gt; $attribut_name, 'product' =&gt; $product, 'selected' =&gt; $selected ) );\/\/ echo wp_kses( end( $attribute_keys ) === $attribut_name ? apply_filters( 'woocommerce_reset_variations_link', '&lt;a class=\"reset_variations\" href=\"#\"&gt;' . __( 'L\u00f6schen', 'Woocommerce-Abonnements' ) . '&lt;\/a&gt;' ) : '', array( 'a' =&gt; array( 'class' =&gt; array(), 'href' =&gt; array() ) );?&gt;&lt;\/td&gt;&lt;\/tr&gt;&lt;?php endforeach;?&gt;&lt;\/K\u00f6rper&gt;&lt;\/Tabelle&gt;&lt;?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\u00f6st, der auf woocommerce_single_variation_hooked ist. *\/wenn ( WC_Subscriptions::is_woocommerce_pre( '3.4' ) ) {do_action( 'woocommerce_before_add_to_cart_button' );}?&gt;&lt;div class=\"Einzel_Variation_Wrap\"&gt;&lt;?php\/** * woocommerce_before_single_variation Haken. *\/do_action( 'woocommerce_before_single_variation' );\/** * woocommerce_single_variation hook. Wird zur Ausgabe der Schaltfl\u00e4che f\u00fcr den Warenkorb und des Platzhalters f\u00fcr Variationsdaten verwendet. * @seit 2.4.0 * @hooked woocommerce_single_variation - 10 Leere div f\u00fcr 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' );?&gt;&lt;\/div&gt;&lt;?php do_action( 'woocommerce_after_add_to_cart_button' ); ?&gt;&lt;?php endif; ?&gt;&lt;?php endif; ?&gt;&lt;?php do_action( 'woocommerce_after_variations_form' ); ?&gt;&lt;\/form&gt;&lt;?phpdo_action( 'woocommerce_after_add_to_cart_form' );<\/pre>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","product_cat":[],"class_list":["post-437","faq","type-faq","status-publish","hentry","faq_topics-attribut-images-filter-hooks"],"_links":{"self":[{"href":"https:\/\/www.welaunch.io\/de\/wp-json\/wp\/v2\/faq\/437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.welaunch.io\/de\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/www.welaunch.io\/de\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/de\/wp-json\/wp\/v2\/comments?post=437"}],"version-history":[{"count":0,"href":"https:\/\/www.welaunch.io\/de\/wp-json\/wp\/v2\/faq\/437\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.welaunch.io\/de\/wp-json\/wp\/v2\/media?parent=437"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.welaunch.io\/de\/wp-json\/wp\/v2\/product_cat?post=437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}