Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Sep 2005
    Posts
    72
    Plugin Contributions
    0

    Default Gift Certificat function adding to total..

    Hello

    I have a customized script of zencart... and my script does the following

    $customized_product_total = $currencies->display_price($orders_products->fields['final_price'], 0);


    Now my question is ... In my customized product total it does not include gift certificate redemtion amount.. now i want to say
    if gift certifcate amount >0 then
    $customized_product_total = myprice - gift certificate amoutnt
    else
    give cerfifcate = 0
    $customized_product_total = myprice - gift certificate amoutnt
    end if


    Thank you for your support..
    DNG

  2. #2
    Join Date
    Sep 2005
    Posts
    72
    Plugin Contributions
    0

    Default Re: Gift Certificat function adding to total..

    Quote Originally Posted by dng View Post
    Hello

    I have a customized script of zencart... and my script does the following

    $customized_product_total = $currencies->display_price($orders_products->fields['final_price'], 0);


    Now my question is ... In my customized product total it does not include gift certificate redemtion amount.. now i want to say
    if gift certifcate amount >0 then
    $customized_product_total = myprice - gift certificate amoutnt
    else
    give cerfifcate = 0
    $customized_product_total = myprice - gift certificate amoutnt
    end if


    Thank you for your support..
    DNG
    Did this post get lost... any help will be appricate it!

    Thanks

  3. #3
    Join Date
    Sep 2005
    Posts
    72
    Plugin Contributions
    0

    Default Re: Gift Certificat function adding to total..

    Any help... I guess message do get lost in the forum now a days.... can any 1 take a look at this....

    Thanks
    DNG

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Gift Certificat function adding to total..

    I think your problem is that you have not posed a question that can be answered.

    Are you just looking for the right PHP statement to account for the gift certificate? You need to give some more context to allow coders to give useful answers.
    Good luck.

  5. #5
    Join Date
    Sep 2005
    Posts
    72
    Plugin Contributions
    0

    Default Re: Gift Certificat function adding to total..

    Quote Originally Posted by gjh42 View Post
    I think your problem is that you have not posed a question that can be answered.

    Are you just looking for the right PHP statement to account for the gift certificate? You need to give some more context to allow coders to give useful answers.
    Good luck.
    Sorry if its not understanding... Yes, cause currently it gives me the total but does not give me gift certificate taken out... So if I want my code to take out the gift certificate.. So Yes I'm looking for the right PHP statement to account for the gift certificate.

    Thanks
    DNG

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Gift Certificat function adding to total..

    The statements you have given are not correct PHP syntax, but we would need to know your exact variable names to give a corrected version.
    You would say something like
    PHP Code:
    if ($gift_certificate_amount 0) {
      
    $customized_product_total $myprice $gift_certificate_amount;

    No "else" is required because if the amount is zero you don't need to do anything.

    You could also simply say
    PHP Code:
    $customized_product_total $myprice $gift_certificate_amount
    and if the GC is zero, it will leave the total as is. Very simple.

    Substitute your actual variable names if they are different, and double check spellings. You had several typos in your posted version - they would be fatal to your code.
    Good luck.

  7. #7
    Join Date
    Sep 2005
    Posts
    72
    Plugin Contributions
    0

    Default Re: Gift Certificat function adding to total..

    Quote Originally Posted by gjh42 View Post
    The statements you have given are not correct PHP syntax, but we would need to know your exact variable names to give a corrected version.
    You would say something like
    PHP Code:
    if ($gift_certificate_amount 0) {
      
    $customized_product_total $myprice $gift_certificate_amount;

    No "else" is required because if the amount is zero you don't need to do anything.

    You could also simply say
    PHP Code:
    $customized_product_total $myprice $gift_certificate_amount
    and if the GC is zero, it will leave the total as is. Very simple.

    Substitute your actual variable names if they are different, and double check spellings. You had several typos in your posted version - they would be fatal to your code.
    Good luck.
    Thank You Appricate that.
    Ed

  8. #8
    Join Date
    Sep 2005
    Posts
    72
    Plugin Contributions
    0

    Default Re: Gift Certificat function adding to total..

    Quote Originally Posted by gjh42 View Post
    The statements you have given are not correct PHP syntax, but we would need to know your exact variable names to give a corrected version.
    You would say something like
    PHP Code:
    if ($gift_certificate_amount 0) {
      
    $customized_product_total $myprice $gift_certificate_amount;

    No "else" is required because if the amount is zero you don't need to do anything.

    You could also simply say
    PHP Code:
    $customized_product_total $myprice $gift_certificate_amount
    and if the GC is zero, it will leave the total as is. Very simple.

    Substitute your actual variable names if they are different, and double check spellings. You had several typos in your posted version - they would be fatal to your code.
    Good luck.

    Here is my edited code

    -CODE
    $product_total = $currencies->display_price($orders_products->fields['final_price'], 0);
    $custom = $product_total - $gift_certificate_amount
    $extra_delivery_info . ' ' . ($product_details !='' ? ' Price includes add-on(s) ' : '') . $product_info . $upgrade_info . $product_details . ' Total Order Amount: ' . $custom . "\n";

    Here is what it is now

    -CODE
    $product_total = $currencies->display_price($orders_products->fields['final_price'], 0);
    $extra_delivery_info . ' ' . ($product_details !='' ? ' Price includes add-on(s) ' : '') . $product_info . $upgrade_info . $product_details . ' Total Order Amount: ' . $product_total . "\n";


    I did go ahead and test it out, it processed okay but the problem it did not show up as my gift certificate. The balance stayed the same... whats the problem?

    Thanks
    DNG
    Last edited by dng; 29 Nov 2006 at 06:58 PM.

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Gift Certificat function adding to total..

    you are missing the semicolon in the GC line:
    PHP Code:
    $custom $product_total $gift_certificate_amount 
    should be
    PHP Code:
    $custom $product_total $gift_certificate_amount
    Try that and see what happens.

  10. #10
    Join Date
    Sep 2005
    Posts
    72
    Plugin Contributions
    0

    Default Re: Gift Certificat function adding to total..

    Quote Originally Posted by gjh42 View Post
    you are missing the semicolon in the GC line:
    PHP Code:
    $custom $product_total $gift_certificate_amount 
    should be
    PHP Code:
    $custom $product_total $gift_certificate_amount
    Try that and see what happens.
    Nope, what is does is it gets the product total.. but does not minus the $gift_certificate_amount from the total... Could it be its a different function name? Also whats the coupon function name?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 22 Feb 2010, 05:48 PM
  2. Limit payment methods as function of the total buying price
    By sanji in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 13 Sep 2008, 06:36 AM
  3. function to get the total weight?
    By bangsters in forum General Questions
    Replies: 2
    Last Post: 8 Nov 2007, 02:12 PM
  4. certificat expired?
    By zerocrew in forum General Questions
    Replies: 4
    Last Post: 5 Nov 2007, 03:13 AM

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