Error while installing


  • Default avatar
    psppharmacy    
     3 months ago  last edited 3 months ago
    0

    Hello

    Today we purchased joomla-awocoupon-3.6.0.1 but  I am not able to install it properly.

    Joomla 1.5

    Virtuemart 1.1.6

    We get the error during installation:

    PHP Parse error:  syntax error, unexpected '[' in /home/Website/domains/Website/public_html/administrator/components/com_awocoupon/awocoupon/library/class-awocoupon-library-helper.php on line 710, referer: https://Website/administrator/index.php?option=com_plugins


    any help?

  • Your avatar
    seyi    
     3 months ago
    0

    Hello,

    If you are using Virtuemart 1.1.x then you are probably using a much older version of php which does not support [] syntax of defining an array.  In that file:
    /home/Website/domains/Website/public_html/administrator/components/com_awocoupon/awocoupon/library/class-awocoupon-library-helper.php on line 710

    You will need to update
    <?php
                                    $subs
    $sub_key ] = [];
    ?>

    To this:
    <?php
                                    $subs
    $sub_key ] = array();
    ?>

    And that should fix the problem.
  • Default avatar
    psppharmacy    
     3 months ago
    0

    It did work! thank you <3
  • Default avatar
    psppharmacy    
     3 months ago
    0

    All functions work great! but i still got 1 error during installation: It supposed to be an Automatic Discounts 

    Please check the status code!


    Add automatic coupon functionality

    Add automatic coupon functionality: Array
    Display correct shipping in basket: Array
    Show shipping discount in coupon field 1: Array
    Persistent coupon field: Array

    A match was not found

    any solution? 
    Thank you again!



  • Your avatar
    seyi    
     3 months ago
    0

    Ok, so it is installed but received that error?  If you go to awocoupon > installation check page, is everything installed?  If you try to create an automatic coupon, does it process?
  • Default avatar
    psppharmacy    
     3 months ago
    0

    No, it does not work!

    On installation check page I get only 1 error which i mentioned above.


    Everything is green except Add automatic coupon functionality

    It says it not installed and  error message I get is: A match was not found

    If i click on manual install it still can not process and I get this error message:

    Add automatic coupon functionality: Array
    Display correct shipping in basket: Array
    Show shipping discount in coupon field 1: Array
    Persistent coupon field: Array



  • Your avatar
    seyi    
     3 months ago
    0

    It cannot find the position, the code would have to be added manually.

    In the basket.php file, it is looking for this line:
    <?php
        
    if (!empty($_POST["do_coupon"]) || (in_arraystrtolower($func), array( 'cartadd''cartupdate''cartdelete' )) && !empty($_SESSION['coupon_redeemed'])) ) {
    ?>

    And trying to add this right before that:
    <?php
        
    # awocoupon_code START ===============================================================
        JPluginHelper::importPlugin('virtuemart');
        $dispatcher JDispatcher::getInstance();
        $dispatcher->trigger('onCouponProcessAuto', array($vars));
        # awocoupon_code END =================================================================
    ?>

    If you need help with this, please send me a private message with access.
  • Default avatar
    psppharmacy    
     3 months ago
    0

    It does work perfectly! 

    Thank you again for the fastest and the best support!