Gift Cert-- 2 issues


  • Default avatar
    lumir g    
     13 years ago
    0

    1. The currency (CAD) is apparently fetched from the VM, but I need to override it somewhere to print on the gift card as "$ 100.00". I did modify it for preview, but where I can change it for the card sent to the buyer?

    2. There are columns: Gift Certificate | Value | Value Used | Balance | ...
    Which is what I need. Just I am not sure where I enter Value Used to get a new balance. I poked around, and just don't find any entry or a way to invoke it for the GC.

    Thanks a bunch!
  • Default avatar
    lumir g    
     13 years ago
    0

    Figured #1 out, it is in /administrator/components/com_awocoupon/assets/virtuemart/ps_awo_giftcert.php

    Line 110
    <?php
                            
    if($profile['message_type'] == 'html') {
                            
    //    $r_file = ps_awo_giftcert::writeToImage($row['code'],number_format($row['price'],2).' '.$row['currency'],$row['expirationraw'],'email',$profile);
                            
    $price "$".number_format($row['price'],0);
                            
    $row['currency'] = "";
                                
    $r_file ps_awo_giftcert::writeToImage($row['code'],$price.' '.$row['currency'],$row['expirationraw'],'email',$profile);
    ?>

    So that is solved, including unnecessary 2 decimal places. Yea, it's a hack, it would be nice if one could pick a format, but it will do.

    #2. I still need help with it. Thanks!
  • Your avatar
    seyi    
     13 years ago
    0

    hi, for #2, its based on the aggregate sum of entries in #__awocoupon_user_uses
  • Default avatar
    lumir g    
     13 years ago
    0

    Thanks, but that does not tell me where to enter the gift cert use. Say the gift cert is for $50, and the service in the brick & mortar venue costs $30. Where I enter that $30, so I end up with a balance $20? I haven't found any way to record the transaction.

    Thanks!
  • Your avatar
    seyi    
     13 years ago
    0

    Oh, I think I understand now. There is no interface to enter the usage of a gift certificate in the backend. The assumption is that gift certificates would be used through your virtuemart store, and at that time it is recorded.
  • Default avatar
    lumir g    
     13 years ago
    0

    Seyi, thanks. Not that I am happy about the answer, but at least that clears things up. I need to write the interface then.

    In your opinion, what would be the best place to start? How would you go about it? A road map would help me a lot. I understand basics of MVC.

    Thanks!
  • Default avatar
    lumir g    
     13 years ago
    0

    More specifically... what fields store the values for uses and is the balance a field or just a calculation? I don't want to modify the tables too much if possible to prevents upgrades from working.
  • Your avatar
    seyi    
     13 years ago
    0

    Hi, I will send you a pm in the next 24 hours with more info on this. I will probably end up adding it to the pro version as it is relatively basic.
  • Default avatar
    lumir g    
     13 years ago
    0

    Seyi, for you, understandably so, you designed it. I could do it too but would have to map everything to get my bearings. Tried sort of a shortcut method, but hosed it.

    My idea was that the main menu would have "Redeem Gift Certificate" (it's a brick and mortar, so they need to have it accessible from top, rather than go through 2 or more steps), then a code entry, and the account data then displayed with entry for value to redeem and submit. The result screen would display the aggregated used value and balance.

    Lumir
  • Default avatar
    alyssa    
     13 years ago
    0

    I've searched through the forum and went through just about every post on the topic and this one was as close as it gets - is there another (or proper) way to disable the display of the 'currency' (e.g. xx USD, or xx CAD) and if so, in which file(s) should we look?

    I'm currently using Awo Coupon Pro v 1.4.1 (latest as of checking yesterday).

    BTW, Seyi, you have top notch products at unbelievable prices!

    [EDIT]

    Disregards my post above. I stumbled upon the "fix" and it's 100% to my liking now! Great work Seyi!!
  • Default avatar
    webdesco    
     13 years ago
    0

    Hi, I've just created a new gift certificate profile but when I click on preview it shows 25 USD even though the currency in Virtuemart is set to GBP

    On a side note, Is there any way to display the currency symbol £ before the certificate value?
  • Your avatar
    seyi    
     13 years ago
    0

    the currency is pulled from the order item, so if you look in table jos_vm_order_items at order_item_currency, this is what it is using.

    for the side note, the second post by lumir g in this topic should answer that.
  • Default avatar
    webdesco    
     13 years ago
    0

    Thanks for the reply, I've taken a look at jos_vm_order_items and the order_item_currency for all orders is set to GBP, I've trawled through the VM configuration and can't find USD anywhere
  • Your avatar
    seyi    
     13 years ago
    0

    are you looking at the preview in the backend? That is hardcoded to USD. the gift certificate image generated after purchase should have the correct currency.
  • Default avatar
    webdesco    
     13 years ago
    0

    Ah Ha!
    that explains it!
    would you mind letting me know which file the preview is hard coded in please so as I can chage it to £xx.xx

    Cheers,
    Philip
  • Your avatar
    seyi    
     13 years ago
    0

    since there are 2 previews, there are 2 places of change

    - www/administrator/components/com_awocoupon/views/giftcertprofile/view.html.php
    - www/administrator/components/com_awocoupon/views/giftcertprofiles/view.html.php

    search for "25.00 USD"

  • Default avatar
    webdesco    
     13 years ago
    0

    I've done mine a little different, instead of hardcoding the symbol, I'm pulling it from the vm_vendor table (the currency for the store is set on virtuemart->store->edit store)
    so i've edited

    /administrator/components/com_awocoupon/assets/virtuemart/ps_awo_giftcert.php

    to be as follows, I know I should have set up a query in the models, but this is a hack so I'm not too concerned.
    <?php
    if($row['profile']['message_type'] == 'html') {
       
    $sql 'SELECT vendor_currency_display_style FROM #__vm_vendor';
       
    $database->setQuery$sql );
       
    $currencyArray explode('|',$database->loadResult());
       
    $r_file ps_awo_giftcert::writeToImage($row['code'],
          
    html_entity_decode($currencyArray[1]).' '.number_format($row['price'],2),
          
    $row['expirationraw'],
          
    'email',
          
    $row['profile']
          );
    ?>
  • Default avatar
    eldred    
     12 years ago
    0

    I am not sure whether the answer is here or not. I would like to remove the AUD after my gift certificate value and make it display $100 or what ever the value is.

    Is this an easy fix or am I being silly?
  • Your avatar
    seyi    
     12 years ago
    0

    post 8 or 9 in this topic should work