Problem with hack and vers 1.5


  • Default avatar
    sengeissen    
     11 years ago
    0

    Hi, I've udated with version 1.5 and the hack doesn't work. Everyting was ok before. Typically my parent coupon start différents coupons with progressive levels.
    Before the update the only problem I had was to obtain the reel level, amount, price for the start of the new coupon. I had to search approximatively with stranges effects sometimes. Do you know this problem. In fact AWO pro seem to applie the first coupon, let say up to 100€ >10%, and at the next level, let say 200€ >20%, I have to search the percent. If I uderstand right, the first coupon is calculated and if I really want 20% I have to find the good percentage who's applied on the total price. From 101 to 200€ its really 20% and from 1 to 199€ who have 10% applyed before it add the différence between 10 and 20%. By this way it works not really corectly for me because I have to find the good percentage each time and for each level and idem for the price, the level where the second discount apply have to be found by the hand because if I say apply the second percentage at 200€ the result is that the coupon start at another price, another level.
    Please let me know if there a way to say: 0 > 100 = 0% 101 >200 = 10% 201>300= 20% This for the percentages how to avoid to have to do really complex calculations for finding the good percent.
    And for the level how to make it work normally, if i want another coupon at 300€ after having applied one before, how to say just apply 20% on the total price and not to have to search by hand the level.
    Maybe its a bug or maybe I have to change anything in the code.
    But for now the most important for me is to make start automatically my parent coupon as it was before the 1.5 Version.
    Thank's in advance.
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    As I understand, you are having a problem with the hack to automatically use a coupon code posted here:
    https://awodev.com/forum/awocoupon/help-section/progressive-coupons-not-automatically#comment-2496

    And it seems you are having other problems, but not exactly sure.

    Can you give the details of how you set up your coupon code that you are using for automatic discounts?
  • Default avatar
    sengeissen    
     11 years ago
    0

    Hi, thak you for your answer. In fact I have 3 problems, but the major is that since I update to 1.5 nothing works. I've injected by hand some code as mentionned in the doc, but still nothing.
    Others problems are, whis the passed version that levels for activating a coupon are falses and percentages of the coupons are really approximatives. Than I have to search by hand the level and the good percentage. It' don't work correctly and as if I accept this problem it's a enormous work to do. The system doesn't work as it is describe in the doc. The hack is just a facilitie, it don't affect the levels or percents.
  • Default avatar
    sengeissen    
     11 years ago
    0

    No matter about the hack, if I erase the code from the basket and don't use it I still have no coupon system active.
  • Your avatar
    seyi    
     11 years ago
    0

    So no coupons are working even if you enter it manually? Have you looked at awocoupon->installation check to verify at least the required items are installed?
  • Default avatar
    sengeissen    
     11 years ago
    0

    I don't have any coupon system active on the website since the update. I did'nt do anything more. The coupons system was operationnal with the fews problems I've mentionned, but now it's the coupon system who's down. The check is ok.
  • Your avatar
    seyi    
     11 years ago
    0

    Ok, if the installation check is ok, the only other thing I can advice without seeing it myself is to create a very simple coupon code, example, 5% off everything. Then go into awocoupon->configuration->error messages and change the errors to something more identifiable. Then use the coupon in the front end and see where it is failing.
  • Your avatar
    seyi    
     11 years ago
    0

    If you would like me to look at it, please send temporary admin/ftp access by private message and I can take a look.
  • Default avatar
    sengeissen    
     11 years ago
    0

    Do you have a link for downloading the old version 1.48 ? I can try to reinstall it
  • Your avatar
    seyi    
     11 years ago
    0

    Ok, found the problem. The latest version pulls the information a little different, causing the hack not to work. I have fixed this problem, and also updated the hack here:
    https://awodev.com/forum/awocoupon/help-section/progressive-coupons-not-automatically#comment-2496

    All I did in html/basket.php was change
    <?php
            $_REQUEST
    ['coupon_code'] = $tmp_vars['coupon_code'] = 'mycouponcode';
    ?>


    to
    <?php
            $_POST
    ['coupon_code'] = $_REQUEST['coupon_code'] = $tmp_vars['coupon_code'] = 'mycouponcode';
    ?>


    So you should be back to normal.

    Now if you can explain your second problem or coupon code, now that I can view it should be able to get it easily resolved.
  • Default avatar
    sengeissen    
     11 years ago
    0

    Great support ! bravo ! If you take a look at the website you will understand my problem, first I have a parent who's function is to start my progressives coupons. Then I create a first one on product "standard" let say 10% at 100€ another 20% at 200€ and another 30% at 300€ The result is not 20% when I buy 201€ or 30% when I buy 300€ But it give a different result and the only way I've found is to search the second and tehe third % by try and try again. It's the same for the level I must test and test again to find the good level who start the coupon "around" the price level needed. My problem is the number of products to adapt like this and to test, and maybe the most important is that the resul is really approximative. Do you know what can I do ? The 3 coupons on the website are wrongs like tis, idem if the first is 10%, the secon too, etc...
  • Default avatar
    sengeissen    
     11 years ago
    0

    Ok I think I understand, if I use "first that applies" it work but only on one product, in fact if you look at my parent product I try to start all my progressives coupons with this parent and then it just work for one product. Is there a way to start differents coupons with the progressive effect since one parent (the one whose started by the hack) ? It works if I use "Everything who can applie" but with the approximations I told you before.
  • Your avatar
    seyi    
     11 years ago
    0

    Ok, so you want to apply multiple parent coupons. I think what you should do is separate them out:

    ParenCouponA
    - child coupon 30% 300euros productA
    - child coupon 20% 200euros productA
    - child coupon 10% 100euros productA

    ParentCouponB
    - child coupon 30% 300euros productB
    - child coupon 20% 200euros productB
    - child coupon 10% 100euros productB

    etc.

    All with first that applies. Then within the hack, use the multiple coupn syntax:
    <?php
            $_POST
    ['coupon_code'] = $_REQUEST['coupon_code'] = $tmp_vars['coupon_code'] = 'ParenCouponA,ParenCouponB';
    ?>


    Then just make sure in awocoupon->configuration you have multiple coupons enabled (disabled by default). I think that will give you what you are after.
  • Default avatar
    sengeissen    
     11 years ago
    0

    Hi Seyi, thank's for your help. What you show me is exactly what I'm looking for, but for now it don't work. The hack is ok with only one parent coupon but when I try to include another one with a , as separator nothing happen and the coupon system don't work.
  • Default avatar
    sengeissen    
     11 years ago
    0

    OK I think it's the syntax, the separator between the names of the coupons parents. If I rename a parent coupon as ParentCouponA,ParentCouponB in one word, than this coupon work. I've try someting like ('ParentCouponA', 'ParentCouponB') but it's not a correct syntax just the idea.
  • Your avatar
    seyi    
     11 years ago
    0

    Hmm I gave you the wrong code, sorry. The coupon codes should be separated by a semi-colon, so something like this:

    <?php
            $_POST
    ['coupon_code'] = $_REQUEST['coupon_code'] = $tmp_vars['coupon_code'] = 'ParenCouponA;ParenCouponB';
    ?>
  • Default avatar
    sengeissen    
     11 years ago
    0

    Yes it's better like this but by this way I can apply a coupon on one product only and my goal is to apply coupons to all the products in the basket who are depending of parents started by the hack and cumulating the coupons. For now it's the first who's applied in the basket who's working and it's ignoring the second product coupon.
  • Default avatar
    sengeissen    
     11 years ago
    0

    Do you think that the coupons trigger you have created for virtuemart 2.x can do this ?
  • Your avatar
    seyi    
     11 years ago
    0

    I do not understand. Can you give an example? Using the semi colon allows you to apply multiple parent coupons if the customer is eligible.
  • Default avatar
    sengeissen    
     11 years ago
    0

    Hi, I would like it like this but in fact if you look closer the hack start effectively multi coupons but only one coupon is applied even if you put differents products in the basket who are dependings of differents parents coupons. What I'm looking for is the possibilitie to cumulate coupons. Take a look on the website your acces is still open. Try with those two products : "standard-500g" and "super-resistante-900g" they are in the "support souples" and "baches banderoles" categorie and sub categorie. Only one product can have a coupon even if they are started by the hack and, after being applied, suppose you go back with your quantities and buy under the level of the first coupon for the product A, then, the second product still have not a coupon applied automatically.
  • Your avatar
    seyi    
     11 years ago
    0

    Ok, I see now.

    There were 2 reasons why it was not working. The first is since one coupon code was accepted, the multiple coupon code logic was not being called any more, so had to change the code in html/basket.php to
    <?php
        
    if ( (empty($_POST["do_coupon"])  && empty($_SESSION['coupon_redeemed']))
        || (!empty(
    $_SESSION['coupon_redeemed']) && in_arraystrtolower($func), array( 'cartadd''cartupdate''cartdelete' )))) {
            require_once( 
    CLASSPATH "ps_coupon.php" );
            
    $tmp_vars $vars;
            
    $_POST['coupon_code'] = $_REQUEST['coupon_code'] = $tmp_vars['coupon_code'] = 'ParentCouponA;ParentCouponB';
            
    ps_coupon::process_coupon_code$tmp_vars );
        }
    ?>


    This allows it to be called again, when there is an update/delete in the cart.

    The second problem is basically due to syntax. In ps_coupon.php, the hack that awocoupon uses a a require_once, which means the code is called once and never again during that run execution. Since the code is called before the auto discount is called on an update, that means the above code is not rerun.

    So changed
    <?php
        
    function process_coupon_code$d ) {
            return require_once (
    JPATH_ADMINISTRATOR.DS."components".DS."com_awocoupon".DS."assets".DS."virtuemart".DS."ps_coupon_process.php");
        }
    ?>

    to
    <?php
        
    function process_coupon_code$d ) {
            return require (
    JPATH_ADMINISTRATOR.DS."components".DS."com_awocoupon".DS."assets".DS."virtuemart".DS."ps_coupon_process.php");
        }
    ?>


    Seems to be working fine now.
  • Your avatar
    seyi    
     11 years ago
    0

    no you cant do this with auto discounts in vm2. It will only take the first automatic discount and not all discounts available.
  • Default avatar
    sengeissen    
     11 years ago
    0

    Great ! Well done, it seem to be perfect now, many many thank's for your support, we can consider the problem as resolve. I hope it will help other user in the same need. Thank you again.