• Hi. I have been using this plugin and adding many discounts by role (more than 200). The website has become very slow loading the shop (7-9 sec.).

    When I deactivate the plugin the website loads faster (3 sec).

    With the plugin activated I have disabled (not remove) almost every discount (only 10 enabled). But the speed keeps being very slow (7-9 sec.).

    I think there must be something in the way the discounts are being iterate that is slowing down the website.

    I hope you can find the way to speed up the plugin.

    Thank you

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter covalenciawebs

    (@cowalenciawebs)

    I think the function elex_rp_get_adjustment_amount( $price, $prdct_id, $temp_data, $adjustment_value ) could be the origin.

    $common_price_adjustment_table = ! empty( get_option( 'eh_pricing_discount_price_adjustment_options' ) ) ? array_values( get_option( 'eh_pricing_discount_price_adjustment_options', array() ) ) : array();
    ...
    foreach ( $common_price_adjustment_table as $key => $value ) {
    ...
    }

    Here all discounts are being iterated. With something like this:

    $common_price_adjustment_table = array_filter( $common_price_adjustment_table, function( $rule ) {
    return isset( $rule['role_price'] ) && $rule['role_price'] === 'on';
    });

    we clean the discounts array before, and makes it speed up the loading.

    Hope this can help.

    Plugin Support Akash

    (@akashelex)

    Hi @cowalenciawebs

    Thank you for reaching out.

    We are reviewing your suggestion to optimize the code changes for resolving the performance issue and will share an update with you shortly.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Slow loading speed with multiple discounts’ is closed to new replies.