.htaccess cache beállítás
Szükséges plugin-ek Woocommerce (wordpress.org) Mit szeretnénk? Cache beállítás a .htaccess-ben
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#Cache expiration <IfModule mod_expires.c> # Enable expirations ExpiresActive On # Default directive ExpiresDefault "access plus 1 month" # My favicon ExpiresByType image/x-icon "access plus 1 month" # Images ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" # CSS ExpiresByType text/css "access plus 1 month" # Javascript ExpiresByType application/javascript "access plus 1 month" </IfModule> |
Show WooCommerce Tab Product Attributes 4.
1 2 3 4 5 6 |
//show attributes after summary in product single view add_action('woocommerce_single_product_summary', function() { //template for this is in storefront-child/woocommerce/single-product/product-attributes.php global $product; echo $product->list_attributes(); }, 25); |
Show WooCommerce Custom Product Attributes 3.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
function isa_woocommerce_all_pa(){ global $product; $attributes = $product->get_attributes(); if ( ! $attributes ) { return; } $out = '<ul class="custom-attributes">'; foreach ( $attributes as $attribute ) { // skip variations if ( $attribute['is_variation'] ) { continue; } if ( $attribute['is_taxonomy'] ) { $terms = wp_get_post_terms( $product->id, $attribute['name'], 'all' ); // get the taxonomy $tax = $terms[0]->taxonomy; // get the tax object $tax_object = get_taxonomy($tax); // get tax label if ( isset ($tax_object->labels->name) ) { $tax_label = $tax_object->labels->name; } elseif ( isset( $tax_object->label ) ) { $tax_label = $tax_object->label; } foreach ( $terms as $term ) { $out .= '<li class="' . esc_attr( $attribute['name'] ) . ' ' . esc_attr( $term->slug ) . '">'; $out .= '<span class="attribute-label">' . $tax_label . ': </span> '; $out .= '<span class="attribute-value">' . $term->name . '</span></li>'; } } else { $out .= '<li class="' . sanitize_title($attribute['name']) . ' ' . sanitize_title($attribute['value']) . '">'; $out .= '<span class="attribute-label">' . $attribute['name'] . ': </span> '; $out .= '<span class="attribute-value">' . $attribute['value'] . '</span></li>'; } } $out .= '</ul>'; echo $out; } add_action('woocommerce_single_product_summary', 'isa_woocommerce_all_pa', 25); |
Show WooCommerce Custom Product Attributes 2.
Szükséges plugin-ek Woocommerce (wordpress.org) Különböző Plugin-ek Mit szeretnénk? A Woocommerce-ben felmerülő ügyféligényekre megoldást adó plugin-ek, vagy plugin kombinációk Feltételes űrlapmezők logikai összekapcsolással Note that this does NOT affect nor include attributes which are used for Variations. This only includes “regular” custom product attributes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
/** * Show all product attributes on the product page */ function isa_woocommerce_all_pa(){ global $product; $attributes = $product->get_attributes(); if ( ! $attributes ) { return; } $out = ''; foreach ( $attributes as $attribute ) { // skip variations if ( $attribute['is_variation'] ) { continue; } if ( $attribute['is_taxonomy'] ) { $terms = wp_get_post_terms( $product->id, $attribute['name'], 'all' ); // get the taxonomy $tax = $terms[0]->taxonomy; // get the tax object $tax_object = get_taxonomy($tax); // get tax label if ( isset ($tax_object->labels->name) ) { $tax_label = $tax_object->labels->name; } elseif ( isset( $tax_object->label ) ) { $tax_label = $tax_object->label; } foreach ( $terms as $term ) { $out .= $tax_label . ': '; $out .= $term->name . '<br />'; } } else { $out .= $attribute['name'] . ': '; $out .= $attribute['value'] . '<br />'; } } echo $out; } add_action('woocommerce_single_product_summary', 'isa_woocommerce_all_pa', 25); |