Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,690
    Plugin Contributions
    9

    Default autofill gift certificate value support thread

    once approved, one can download from here:

    https://www.zen-cart.com/downloads.php?do=file&id=2354

    only has 2 files. one file if not using OPC. no ZC core files modified.

    takes any value up to the max of the order value and automatically fills that amount into the gift certificate input field (input[name=cot_gv]).

    enjoy.
    Last edited by swguy; 10 Jul 2022 at 02:24 PM.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  2. #2
    Join Date
    Dec 2010
    Posts
    142
    Plugin Contributions
    0

    Default Re: autofill gift certificate value support thread

    Amazing! Can't wait! THANK YOU @carlwhat!

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,691
    Plugin Contributions
    123

    Default Re: autofill gift certificate value support thread

    A couple of things:

    a) Please resubmit without MIT license.

    b) This doesn't work in my environment with OPC or standard checkout:

    - At a minimum, you need to wrap the script that sets the value in
    jQuery(document).ready(function(){

    - At load time (in this environment), the total value is not what is shown on the screen (shipping tax has not yet been added and there are local taxes).
    This is only an issue if the total is less than the GC amount.

    - You may need to use

    $orderTotalPlugin = round($order->info['total'], 2);
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,690
    Plugin Contributions
    9

    Default Re: autofill gift certificate value support thread

    Quote Originally Posted by swguy View Post
    - At load time (in this environment), the total value is not what is shown on the screen (shipping tax has not yet been added and there are local taxes).
    This is only an issue if the total is less than the GC amount.
    i would prefer to not have pre-release debugging in the forum, but if that's what you want...

    checkout payment, should be done after shipping and local taxes. payments are always done last in any sane shopping cart. why would one pay prior to knowing a total.

    in my testing using test data it works fine. i can not comment on your environment with regards to this issue.

    your other 2 points are duly noted and incorporated into new submission.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,691
    Plugin Contributions
    123

    Default Re: autofill gift certificate value support thread

    Set your GC balance to be greater than the order total, and use an OT module that increases the order total further, and you'll see the issue.
    Also, comments still say Code is licensed under the MIT license.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Dec 2010
    Posts
    142
    Plugin Contributions
    0

    Default Re: autofill gift certificate value support thread

    @carlwhat Please see this potential issue as it relates to OPC: https://www.zen-cart.com/showthread....64#post1389364

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,691
    Plugin Contributions
    123

    Default Re: autofill gift certificate value support thread

    Approved and link in first post updated.

    > checkout payment, should be done after shipping and local taxes. payments are always done last in any sane shopping cart. why would one pay prior to knowing a total.

    The JS you put your code in loads before the page builds the order completely. So this won't work if there are order total modules that modify the bottom line.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  8. #8
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,690
    Plugin Contributions
    9

    Default Re: autofill gift certificate value support thread

    Quote Originally Posted by swguy View Post
    Approved and link in first post updated.

    > checkout payment, should be done after shipping and local taxes. payments are always done last in any sane shopping cart. why would one pay prior to knowing a total.

    The JS you put your code in loads before the page builds the order completely. So this won't work if there are order total modules that modify the bottom line.
    the problem that you are, in theory, presenting is inherent in the structure of zen-cart. and has been something that i have discussed previously on github.

    the idea that there is an order_total module called ot_total that just takes what is in the $order->info['total'] is, to me, one of the many problems inherent in the structure of zen-cart. i am not a fan of this structure, but understand how legacy code works.

    the latest update that i have submitted fixes an issue with OPC, and will be the last update i issue under real store owners decide to use it and report problems.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

 

 

Similar Threads

  1. v150 Database updated incorrectly when Gift Certificate covers order value?
    By boardshorts in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 25 Dec 2013, 03:00 AM
  2. Gift certificate adding value instead of subtracting
    By amyleew in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 17 Nov 2010, 01:48 PM
  3. Gift certificate - undefined value
    By Akasashasha in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 19 Jun 2009, 08:36 AM
  4. Gift Certificate purchases to have different credited value
    By anoop in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 5 Jun 2009, 07:31 AM
  5. customer has double gift certificate value
    By etoile03 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 8 Jan 2008, 09:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR