Want to use Buy X Get Y coupon based on shopper's shipping address


  • Default avatar
    axiom    
     a year ago
    0

    Hello,

    I have a Buy X Get Y coupon that I've set up with an automatic discount to automatically add a free product to the cart if the shopper is from the state of Colorado. This works as expected if the shopper does not have separate billing and shipping addresses. However, if the shopper does have separate billing and shipping addresses, we want this coupon to execute if the *shipping* address is in Colorado. Currently the coupon only triggers based on billing address.

    Is there a way to get the coupon to look at the shipping address if it differs from the billing address?  If not, can someone point me to the best place in the PHP code where I could implement this myself?

    Thanks.

  • Your avatar
    seyi    
     a year ago
    0

    The code works on the billing address. 

    Can modify the code, kinda depends on your shopping cart.  If virtuemart, then in the file:
    \administrator\components\com_awocoupon\helper\estore\virtuemart\class-awocoupon-helper-estore-virtuemart-discount.php
    function get_customeraddress


  • Default avatar
    axiom    
     a year ago
    0

    Thanks, I was able to implement what I need by modifying one line of code, so that worked well for me. (And yes, we're using VirtueMart.)

    Having the option for this to work with the shipping address would be a new feature I would recommend.