Eshop Product option Price as Gift certificate Price/amount


  • Default avatar
    khalil    
     4 years ago
    0

    Hi Team,

    I've created a product in eshop to be used as a gift certificate  with custom option that change the price of the product when user select some option. So each time user change the options, the price is updated, the cart total and even the payment is the correct price.
    But when user receive the gift certificate by email, it always shows the Default Price of the Gift Product, even the amount of the gift in the awocupon list is the default price of the product.
    The coupon used as template has 0 as amount.
    The gift certificate is set to use base price in the "Price Calculation Type" field.
    So whenever a user change the amount option, the amount of the gift card should be updated right?
    Is there some more setting I should do to allow the gift amount to be generated depending on the product price?



    Product page Front
    Whe user select an option, the price of the product change.

  • Your avatar
    seyi    
     4 years ago
    0

    Hello,

    Yes, I can produce the problem.  To fix, you will need to make a change in one of the files.  In the file:

    www/administrator/components/com_awocoupon/helper/estore/eshop/class-awocoupon-helper-estore-eshop-giftcert.php, around line 255 is this function:

    <?php
        
    protected function get_product_price_in_default_currency$amount$row ) {
            if ( empty( $amount ) ) {
                return 0;
            }
            if ( empty( $row->currency_id ) ) {
                return 0;
            }
            return AC()->storecurrency->convert_to_default$amount$row->currency_id );
        }
    ?>

    Please change it to this
    <?php
        
    protected function get_product_price_in_default_currency$amount$row ) {
            if ( empty( $amount ) ) {
                return 0;
            }
            if ( empty( $row->currency_code ) ) {
                return 0;
            }
            return AC()->storecurrency->convert_to_default$amount$row->currency_code );
        }
    ?>

    That will fix the problem.