Plugin Directory

Changeset 3353795


Ignore:
Timestamp:
09/01/2025 10:13:26 AM (7 months ago)
Author:
Surbma
Message:

Update to version 2025.1.8 from GitHub

Location:
surbma-magyar-woocommerce
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • surbma-magyar-woocommerce/tags/2025.1.8/modules/product-settings.php

    r3251880 r3353795  
    88defined( 'ABSPATH' ) || exit;
    99
    10 // Get the module's settings
    11 $productsettings_productsubtitleValue = $hc_gems_options['productsubtitle'] ?? 0;
    12 $productsettings_removeimagezoomValue = $hc_gems_options['productsettings-removeimagezoom'] ?? false;
    13 $productsettings_addtocartonarchiveValue = $hc_gems_options['addtocartonarchive'] ?? false;
    14 $productsettings_norelatedproductsValue = $hc_gems_options['norelatedproducts'] ?? false;
    15 
    16 /*
    17  ** Metabox for Products
    18  */
    19 
    20 if ( $productsettings_productsubtitleValue ) :
    21 
    22     // Registering Metabox for Products
    23     add_action( 'add_meta_boxes', function() {
    24         add_meta_box(
    25             'surbma_hc_product_metabox',
    26             'HuCommerce ' . __( 'Product Settings', 'surbma-magyar-woocommerce' ),
    27             'surbma_hc_product_metabox',
    28             'product',
    29             'normal',
    30             'high'
    31         );
    32     } );
    33 
    34     // Metabox on the Product edit page
    35     function surbma_hc_product_metabox() {
    36         global $post;
    37 
    38         // Nonce field to validate form request came from current site
    39         wp_nonce_field( basename( __FILE__ ), 'surbma_hc_product_settings_nonce' );
    40 
    41         // Get the field data if it's already been entered
    42         $productsubtitle = get_post_meta( $post->ID, 'surbma_hc_product_subtitle', true );
    43         // $productcustom = get_post_meta( $post->ID, 'surbma_hc_product_custom', true );
    44 
    45         // Output the fields
    46         echo '<p>';
    47         echo '<label for="surbma_hc_product_subtitle">' . esc_html__( 'Product Subtitle', 'surbma-magyar-woocommerce' ) . '</label>';
    48         echo '<input id="surbma_hc_product_subtitle" name="surbma_hc_product_subtitle" type="text" value="' . esc_textarea( $productsubtitle ) . '" class="widefat">';
    49         echo '</p>';
    50 
    51         /*
    52         echo '<p>';
    53         echo '<label for="surbma_hc_product_custom">Product Custom</label>';
    54         echo '<input id="surbma_hc_product_custom" name="surbma_hc_product_custom" type="text" value="' . esc_textarea( $productcustom )  . '" class="widefat">';
    55         echo '</p>';
    56         */
    57 
    58         echo '<hr><p style="text-align: center;font-size: smaller;">' . esc_html__( 'These settings are added by the HuCommerce plugin.', 'surbma-magyar-woocommerce' ) . '</p>';
    59     }
    60 
    61     // Saving the fields in the Metabox
    62     add_action( 'save_post', function( $post_id, $post ) {
    63 
    64         // Return if the user doesn't have edit permissions
    65         if ( ! current_user_can( 'edit_post', $post_id ) ) {
    66             return $post_id;
    67         }
    68 
    69         // Don't store meta data, if this is a revision
    70         if ( wp_is_post_revision( $post_id ) ) {
    71             return;
    72         }
    73 
    74         // Verify this came from our screen and with proper authorization, because save_post can be triggered at other times
    75         if ( ! isset( $_POST['surbma_hc_product_subtitle'] ) /*|| ! isset( $_POST['surbma_hc_product_custom'] ) */|| ( ! isset( $_POST['surbma_hc_product_settings_nonce'] ) && wp_verify_nonce( sanitize_key( $_POST['surbma_hc_product_settings_nonce'] ), basename(__FILE__) ) ) ) {
    76             return $post_id;
    77         }
    78 
    79         // This sanitizes the data from the field and saves it into an array $products_meta.
    80         $products_meta['surbma_hc_product_subtitle'] = sanitize_text_field( wp_unslash( $_POST['surbma_hc_product_subtitle'] ) );
    81         // $products_meta['surbma_hc_product_custom'] = sanitize_text_field( wp_unslash( $_POST['surbma_hc_product_custom'] ) );
    82 
    83         // Cycle through the $products_meta array
    84         foreach ( $products_meta as $key => $value ) :
    85 
    86             if ( $value ) {
    87                 // Update or add meta data to the post
    88                 update_post_meta( $post_id, $key, $value );
    89             } else {
    90                 // Delete the meta key if there's no value
    91                 delete_post_meta( $post_id, $key );
    92             }
    93 
    94         endforeach;
    95 
    96     }, 1, 2 );
    97 
    98 endif;
    99 
    100 /*
    101  ** Product Subtitle
    102  */
    103 
    104 if ( $productsettings_productsubtitleValue ) :
    105 
    106     // The Title filter
    107     add_filter( 'the_title', function( $title, $id ) {
    108         $productsubtitle = get_post_meta( $id, 'surbma_hc_product_subtitle', true );
    109 
    110         if ( 'product' == get_post_type( $id ) && in_the_loop() && $productsubtitle ) {
    111             $title = $title . ' <span class="product_subtitle" itemprop="description">' . $productsubtitle . '</span>';
    112         }
    113 
    114         return $title;
    115     }, 10, 2 );
    116 
    117     // Custom style for the Subtitle
    118     add_action( 'wp_head', function() {
    119         echo '<style>.product .product_subtitle {display: block;font-size: smaller;opacity: .75;}</style>';
    120     } );
    121 
    122 endif;
    123 
    124 /*
    125  ** Remove Image Zoom
    126  */
    127 
    128 if ( $productsettings_removeimagezoomValue ) :
    129 
    130     add_action( 'wp', function() {
     10// Get the module's settings - moved to a function for better performance
     11function surbma_hc_get_product_settings() {
     12    static $settings = null;
     13    if ( $settings === null ) {
     14        global $hc_gems_options;
     15        $settings = [
     16            'productsubtitle' => $hc_gems_options['productsubtitle'] ?? 0,
     17            'removeimagezoom' => $hc_gems_options['productsettings-removeimagezoom'] ?? false,
     18            'addtocartonarchive' => $hc_gems_options['addtocartonarchive'] ?? false,
     19            'norelatedproducts' => $hc_gems_options['norelatedproducts'] ?? false,
     20        ];
     21    }
     22    return $settings;
     23}
     24
     25/*
     26 ** Metabox for Products - Admin only
     27 */
     28
     29// Admin functionality - use admin_init for proper admin context
     30add_action( 'admin_init', function() {
     31    $settings = surbma_hc_get_product_settings();
     32    if ( $settings['productsubtitle'] ) {
     33        // Registering Metabox for Products
     34        add_action( 'add_meta_boxes', 'surbma_hc_register_product_metabox' );
     35        add_action( 'save_post', 'surbma_hc_save_product_metabox', 1, 2 );
     36    }
     37} );
     38
     39function surbma_hc_register_product_metabox() {
     40    add_meta_box(
     41        'surbma_hc_product_metabox',
     42        'HuCommerce ' . __( 'Product Settings', 'surbma-magyar-woocommerce' ),
     43        'surbma_hc_product_metabox',
     44        'product',
     45        'normal',
     46        'high'
     47    );
     48}
     49
     50// Metabox on the Product edit page
     51function surbma_hc_product_metabox() {
     52    global $post;
     53
     54    // Nonce field to validate form request came from current site
     55    wp_nonce_field( basename( __FILE__ ), 'surbma_hc_product_settings_nonce' );
     56
     57    // Get the field data if it's already been entered
     58    $productsubtitle = get_post_meta( $post->ID, 'surbma_hc_product_subtitle', true );
     59
     60    // Output the fields
     61    echo '<p>';
     62    echo '<label for="surbma_hc_product_subtitle">' . esc_html__( 'Product Subtitle', 'surbma-magyar-woocommerce' ) . '</label>';
     63    echo '<input id="surbma_hc_product_subtitle" name="surbma_hc_product_subtitle" type="text" value="' . esc_textarea( $productsubtitle ) . '" class="widefat">';
     64    echo '</p>';
     65
     66    echo '<hr><p style="text-align: center;font-size: smaller;">' . esc_html__( 'These settings are added by the HuCommerce plugin.', 'surbma-magyar-woocommerce' ) . '</p>';
     67}
     68
     69// Saving the fields in the Metabox
     70function surbma_hc_save_product_metabox( $post_id, $post ) {
     71    // Return if the user doesn't have edit permissions
     72    if ( ! current_user_can( 'edit_post', $post_id ) ) {
     73        return $post_id;
     74    }
     75
     76    // Don't store meta data, if this is a revision
     77    if ( wp_is_post_revision( $post_id ) ) {
     78        return;
     79    }
     80
     81    // Verify this came from our screen and with proper authorization
     82    if ( ! isset( $_POST['surbma_hc_product_subtitle'] ) || ! isset( $_POST['surbma_hc_product_settings_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['surbma_hc_product_settings_nonce'] ), basename(__FILE__) ) ) {
     83        return $post_id;
     84    }
     85
     86    // Sanitize and save the data
     87    $productsubtitle = sanitize_text_field( wp_unslash( $_POST['surbma_hc_product_subtitle'] ) );
     88   
     89    if ( $productsubtitle ) {
     90        update_post_meta( $post_id, 'surbma_hc_product_subtitle', $productsubtitle );
     91    } else {
     92        delete_post_meta( $post_id, 'surbma_hc_product_subtitle' );
     93    }
     94}
     95
     96/*
     97 ** Product Subtitle - Frontend only
     98 */
     99
     100// Frontend functionality - use template_redirect for proper frontend context
     101add_action( 'template_redirect', function() {
     102    $settings = surbma_hc_get_product_settings();
     103    if ( $settings['productsubtitle'] ) {
     104        // The Title filter
     105        add_filter( 'the_title', 'surbma_hc_add_product_subtitle', 10, 2 );
     106        // Custom style for the Subtitle
     107        add_action( 'wp_head', 'surbma_hc_product_subtitle_styles' );
     108    }
     109} );
     110
     111function surbma_hc_add_product_subtitle( $title, $id ) {
     112    $productsubtitle = get_post_meta( $id, 'surbma_hc_product_subtitle', true );
     113
     114    if ( 'product' == get_post_type( $id ) && in_the_loop() && $productsubtitle ) {
     115        $title = $title . ' <span class="product_subtitle" itemprop="description">' . $productsubtitle . '</span>';
     116    }
     117
     118    return $title;
     119}
     120
     121function surbma_hc_product_subtitle_styles() {
     122    echo '<style>.product .product_subtitle {display: block;font-size: smaller;opacity: .75;}</style>';
     123}
     124
     125/*
     126 ** Other Product Settings - Frontend only
     127 */
     128
     129// Frontend product settings - use template_redirect for proper frontend context
     130add_action( 'template_redirect', function() {
     131    $settings = surbma_hc_get_product_settings();
     132   
     133    // Remove Image Zoom
     134    if ( $settings['removeimagezoom'] ) {
    131135        remove_theme_support( 'wc-product-gallery-zoom' );
    132     }, 100 );
    133 
    134 endif;
    135 
    136 /*
    137  ** Add to cart button on archive pages
    138  */
    139 
    140 if ( $productsettings_addtocartonarchiveValue ) :
    141 
    142     add_action( 'after_setup_theme', function() {
     136    }
     137   
     138    // Add to cart button on archive pages
     139    if ( $settings['addtocartonarchive'] ) {
    143140        add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 10 );
    144     } );
    145 
    146 endif;
    147 
    148 /*
    149  ** Remove related products output
    150  */
    151 
    152 if ( $productsettings_norelatedproductsValue ) :
    153 
    154     add_action( 'woocommerce_after_single_product_summary', function() {
    155         remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
    156     }, 0 );
    157 
    158 endif;
     141    }
     142   
     143    // Remove related products output
     144    if ( $settings['norelatedproducts'] ) {
     145        add_action( 'woocommerce_after_single_product_summary', function() {
     146            remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
     147        }, 0 );
     148    }
     149} );
    159150
    160151/*
  • surbma-magyar-woocommerce/tags/2025.1.8/readme.txt

    r3352322 r3353795  
    33Tags: woocommerce, magyar, magyarország, webáruház, hungarian
    44Requires at least: 5.3
    5 Tested up to: 6.7
    6 Stable tag: 2025.1.7
     5Tested up to: 6.8
     6Stable tag: 2025.1.8
    77Requires PHP: 7.4
    88License: GPL-3.0-or-later
     
    297297== Changelog ==
    298298
     299#### 2025.1.8
     300
     301*Kiadás dátuma: 2025-09-01*
     302
     303**JAVÍTÁS**
     304
     305- Termék módosítások modul javítása és optimalizálása.
     306
     307**EGYÉB**
     308
     309- Kompatibilitás ellenőrzése a WordPress 6.8 verzióval.
     310- Kompatibilitás ellenőrzése a WooCommerce 10.1 verzióval.
     311
    299312#### 2025.1.7
    300313
  • surbma-magyar-woocommerce/tags/2025.1.8/surbma-magyar-woocommerce.php

    r3352322 r3353795  
    77Description: Hasznos javítások és kiegészítések a magyar nyelvű WooCommerce webáruházakhoz.
    88
    9 Version: 2025.1.7
     9Version: 2025.1.8
    1010
    1111Author: HuCommerce.hu
     
    1818
    1919WC requires at least: 4.6
    20 WC tested up to: 9.7
     20WC tested up to: 10.1
    2121
    2222License: GPL-3.0-or-later
  • surbma-magyar-woocommerce/trunk/modules/product-settings.php

    r3251880 r3353795  
    88defined( 'ABSPATH' ) || exit;
    99
    10 // Get the module's settings
    11 $productsettings_productsubtitleValue = $hc_gems_options['productsubtitle'] ?? 0;
    12 $productsettings_removeimagezoomValue = $hc_gems_options['productsettings-removeimagezoom'] ?? false;
    13 $productsettings_addtocartonarchiveValue = $hc_gems_options['addtocartonarchive'] ?? false;
    14 $productsettings_norelatedproductsValue = $hc_gems_options['norelatedproducts'] ?? false;
    15 
    16 /*
    17  ** Metabox for Products
    18  */
    19 
    20 if ( $productsettings_productsubtitleValue ) :
    21 
    22     // Registering Metabox for Products
    23     add_action( 'add_meta_boxes', function() {
    24         add_meta_box(
    25             'surbma_hc_product_metabox',
    26             'HuCommerce ' . __( 'Product Settings', 'surbma-magyar-woocommerce' ),
    27             'surbma_hc_product_metabox',
    28             'product',
    29             'normal',
    30             'high'
    31         );
    32     } );
    33 
    34     // Metabox on the Product edit page
    35     function surbma_hc_product_metabox() {
    36         global $post;
    37 
    38         // Nonce field to validate form request came from current site
    39         wp_nonce_field( basename( __FILE__ ), 'surbma_hc_product_settings_nonce' );
    40 
    41         // Get the field data if it's already been entered
    42         $productsubtitle = get_post_meta( $post->ID, 'surbma_hc_product_subtitle', true );
    43         // $productcustom = get_post_meta( $post->ID, 'surbma_hc_product_custom', true );
    44 
    45         // Output the fields
    46         echo '<p>';
    47         echo '<label for="surbma_hc_product_subtitle">' . esc_html__( 'Product Subtitle', 'surbma-magyar-woocommerce' ) . '</label>';
    48         echo '<input id="surbma_hc_product_subtitle" name="surbma_hc_product_subtitle" type="text" value="' . esc_textarea( $productsubtitle ) . '" class="widefat">';
    49         echo '</p>';
    50 
    51         /*
    52         echo '<p>';
    53         echo '<label for="surbma_hc_product_custom">Product Custom</label>';
    54         echo '<input id="surbma_hc_product_custom" name="surbma_hc_product_custom" type="text" value="' . esc_textarea( $productcustom )  . '" class="widefat">';
    55         echo '</p>';
    56         */
    57 
    58         echo '<hr><p style="text-align: center;font-size: smaller;">' . esc_html__( 'These settings are added by the HuCommerce plugin.', 'surbma-magyar-woocommerce' ) . '</p>';
    59     }
    60 
    61     // Saving the fields in the Metabox
    62     add_action( 'save_post', function( $post_id, $post ) {
    63 
    64         // Return if the user doesn't have edit permissions
    65         if ( ! current_user_can( 'edit_post', $post_id ) ) {
    66             return $post_id;
    67         }
    68 
    69         // Don't store meta data, if this is a revision
    70         if ( wp_is_post_revision( $post_id ) ) {
    71             return;
    72         }
    73 
    74         // Verify this came from our screen and with proper authorization, because save_post can be triggered at other times
    75         if ( ! isset( $_POST['surbma_hc_product_subtitle'] ) /*|| ! isset( $_POST['surbma_hc_product_custom'] ) */|| ( ! isset( $_POST['surbma_hc_product_settings_nonce'] ) && wp_verify_nonce( sanitize_key( $_POST['surbma_hc_product_settings_nonce'] ), basename(__FILE__) ) ) ) {
    76             return $post_id;
    77         }
    78 
    79         // This sanitizes the data from the field and saves it into an array $products_meta.
    80         $products_meta['surbma_hc_product_subtitle'] = sanitize_text_field( wp_unslash( $_POST['surbma_hc_product_subtitle'] ) );
    81         // $products_meta['surbma_hc_product_custom'] = sanitize_text_field( wp_unslash( $_POST['surbma_hc_product_custom'] ) );
    82 
    83         // Cycle through the $products_meta array
    84         foreach ( $products_meta as $key => $value ) :
    85 
    86             if ( $value ) {
    87                 // Update or add meta data to the post
    88                 update_post_meta( $post_id, $key, $value );
    89             } else {
    90                 // Delete the meta key if there's no value
    91                 delete_post_meta( $post_id, $key );
    92             }
    93 
    94         endforeach;
    95 
    96     }, 1, 2 );
    97 
    98 endif;
    99 
    100 /*
    101  ** Product Subtitle
    102  */
    103 
    104 if ( $productsettings_productsubtitleValue ) :
    105 
    106     // The Title filter
    107     add_filter( 'the_title', function( $title, $id ) {
    108         $productsubtitle = get_post_meta( $id, 'surbma_hc_product_subtitle', true );
    109 
    110         if ( 'product' == get_post_type( $id ) && in_the_loop() && $productsubtitle ) {
    111             $title = $title . ' <span class="product_subtitle" itemprop="description">' . $productsubtitle . '</span>';
    112         }
    113 
    114         return $title;
    115     }, 10, 2 );
    116 
    117     // Custom style for the Subtitle
    118     add_action( 'wp_head', function() {
    119         echo '<style>.product .product_subtitle {display: block;font-size: smaller;opacity: .75;}</style>';
    120     } );
    121 
    122 endif;
    123 
    124 /*
    125  ** Remove Image Zoom
    126  */
    127 
    128 if ( $productsettings_removeimagezoomValue ) :
    129 
    130     add_action( 'wp', function() {
     10// Get the module's settings - moved to a function for better performance
     11function surbma_hc_get_product_settings() {
     12    static $settings = null;
     13    if ( $settings === null ) {
     14        global $hc_gems_options;
     15        $settings = [
     16            'productsubtitle' => $hc_gems_options['productsubtitle'] ?? 0,
     17            'removeimagezoom' => $hc_gems_options['productsettings-removeimagezoom'] ?? false,
     18            'addtocartonarchive' => $hc_gems_options['addtocartonarchive'] ?? false,
     19            'norelatedproducts' => $hc_gems_options['norelatedproducts'] ?? false,
     20        ];
     21    }
     22    return $settings;
     23}
     24
     25/*
     26 ** Metabox for Products - Admin only
     27 */
     28
     29// Admin functionality - use admin_init for proper admin context
     30add_action( 'admin_init', function() {
     31    $settings = surbma_hc_get_product_settings();
     32    if ( $settings['productsubtitle'] ) {
     33        // Registering Metabox for Products
     34        add_action( 'add_meta_boxes', 'surbma_hc_register_product_metabox' );
     35        add_action( 'save_post', 'surbma_hc_save_product_metabox', 1, 2 );
     36    }
     37} );
     38
     39function surbma_hc_register_product_metabox() {
     40    add_meta_box(
     41        'surbma_hc_product_metabox',
     42        'HuCommerce ' . __( 'Product Settings', 'surbma-magyar-woocommerce' ),
     43        'surbma_hc_product_metabox',
     44        'product',
     45        'normal',
     46        'high'
     47    );
     48}
     49
     50// Metabox on the Product edit page
     51function surbma_hc_product_metabox() {
     52    global $post;
     53
     54    // Nonce field to validate form request came from current site
     55    wp_nonce_field( basename( __FILE__ ), 'surbma_hc_product_settings_nonce' );
     56
     57    // Get the field data if it's already been entered
     58    $productsubtitle = get_post_meta( $post->ID, 'surbma_hc_product_subtitle', true );
     59
     60    // Output the fields
     61    echo '<p>';
     62    echo '<label for="surbma_hc_product_subtitle">' . esc_html__( 'Product Subtitle', 'surbma-magyar-woocommerce' ) . '</label>';
     63    echo '<input id="surbma_hc_product_subtitle" name="surbma_hc_product_subtitle" type="text" value="' . esc_textarea( $productsubtitle ) . '" class="widefat">';
     64    echo '</p>';
     65
     66    echo '<hr><p style="text-align: center;font-size: smaller;">' . esc_html__( 'These settings are added by the HuCommerce plugin.', 'surbma-magyar-woocommerce' ) . '</p>';
     67}
     68
     69// Saving the fields in the Metabox
     70function surbma_hc_save_product_metabox( $post_id, $post ) {
     71    // Return if the user doesn't have edit permissions
     72    if ( ! current_user_can( 'edit_post', $post_id ) ) {
     73        return $post_id;
     74    }
     75
     76    // Don't store meta data, if this is a revision
     77    if ( wp_is_post_revision( $post_id ) ) {
     78        return;
     79    }
     80
     81    // Verify this came from our screen and with proper authorization
     82    if ( ! isset( $_POST['surbma_hc_product_subtitle'] ) || ! isset( $_POST['surbma_hc_product_settings_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['surbma_hc_product_settings_nonce'] ), basename(__FILE__) ) ) {
     83        return $post_id;
     84    }
     85
     86    // Sanitize and save the data
     87    $productsubtitle = sanitize_text_field( wp_unslash( $_POST['surbma_hc_product_subtitle'] ) );
     88   
     89    if ( $productsubtitle ) {
     90        update_post_meta( $post_id, 'surbma_hc_product_subtitle', $productsubtitle );
     91    } else {
     92        delete_post_meta( $post_id, 'surbma_hc_product_subtitle' );
     93    }
     94}
     95
     96/*
     97 ** Product Subtitle - Frontend only
     98 */
     99
     100// Frontend functionality - use template_redirect for proper frontend context
     101add_action( 'template_redirect', function() {
     102    $settings = surbma_hc_get_product_settings();
     103    if ( $settings['productsubtitle'] ) {
     104        // The Title filter
     105        add_filter( 'the_title', 'surbma_hc_add_product_subtitle', 10, 2 );
     106        // Custom style for the Subtitle
     107        add_action( 'wp_head', 'surbma_hc_product_subtitle_styles' );
     108    }
     109} );
     110
     111function surbma_hc_add_product_subtitle( $title, $id ) {
     112    $productsubtitle = get_post_meta( $id, 'surbma_hc_product_subtitle', true );
     113
     114    if ( 'product' == get_post_type( $id ) && in_the_loop() && $productsubtitle ) {
     115        $title = $title . ' <span class="product_subtitle" itemprop="description">' . $productsubtitle . '</span>';
     116    }
     117
     118    return $title;
     119}
     120
     121function surbma_hc_product_subtitle_styles() {
     122    echo '<style>.product .product_subtitle {display: block;font-size: smaller;opacity: .75;}</style>';
     123}
     124
     125/*
     126 ** Other Product Settings - Frontend only
     127 */
     128
     129// Frontend product settings - use template_redirect for proper frontend context
     130add_action( 'template_redirect', function() {
     131    $settings = surbma_hc_get_product_settings();
     132   
     133    // Remove Image Zoom
     134    if ( $settings['removeimagezoom'] ) {
    131135        remove_theme_support( 'wc-product-gallery-zoom' );
    132     }, 100 );
    133 
    134 endif;
    135 
    136 /*
    137  ** Add to cart button on archive pages
    138  */
    139 
    140 if ( $productsettings_addtocartonarchiveValue ) :
    141 
    142     add_action( 'after_setup_theme', function() {
     136    }
     137   
     138    // Add to cart button on archive pages
     139    if ( $settings['addtocartonarchive'] ) {
    143140        add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 10 );
    144     } );
    145 
    146 endif;
    147 
    148 /*
    149  ** Remove related products output
    150  */
    151 
    152 if ( $productsettings_norelatedproductsValue ) :
    153 
    154     add_action( 'woocommerce_after_single_product_summary', function() {
    155         remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
    156     }, 0 );
    157 
    158 endif;
     141    }
     142   
     143    // Remove related products output
     144    if ( $settings['norelatedproducts'] ) {
     145        add_action( 'woocommerce_after_single_product_summary', function() {
     146            remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
     147        }, 0 );
     148    }
     149} );
    159150
    160151/*
  • surbma-magyar-woocommerce/trunk/readme.txt

    r3352322 r3353795  
    33Tags: woocommerce, magyar, magyarország, webáruház, hungarian
    44Requires at least: 5.3
    5 Tested up to: 6.7
    6 Stable tag: 2025.1.7
     5Tested up to: 6.8
     6Stable tag: 2025.1.8
    77Requires PHP: 7.4
    88License: GPL-3.0-or-later
     
    297297== Changelog ==
    298298
     299#### 2025.1.8
     300
     301*Kiadás dátuma: 2025-09-01*
     302
     303**JAVÍTÁS**
     304
     305- Termék módosítások modul javítása és optimalizálása.
     306
     307**EGYÉB**
     308
     309- Kompatibilitás ellenőrzése a WordPress 6.8 verzióval.
     310- Kompatibilitás ellenőrzése a WooCommerce 10.1 verzióval.
     311
    299312#### 2025.1.7
    300313
  • surbma-magyar-woocommerce/trunk/surbma-magyar-woocommerce.php

    r3352322 r3353795  
    77Description: Hasznos javítások és kiegészítések a magyar nyelvű WooCommerce webáruházakhoz.
    88
    9 Version: 2025.1.7
     9Version: 2025.1.8
    1010
    1111Author: HuCommerce.hu
     
    1818
    1919WC requires at least: 4.6
    20 WC tested up to: 9.7
     20WC tested up to: 10.1
    2121
    2222License: GPL-3.0-or-later
Note: See TracChangeset for help on using the changeset viewer.