Page 288 of 296 FirstFirst ... 188238278286287288289290 ... LastLast
Results 2,871 to 2,880 of 2956
  1. #2871
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,349
    Plugin Contributions
    94

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by gothstone View Post
    Lol, NM, I should have just trusted in lat9! 2.5.2 DOES in fact fix that prob! Thank you Cindy!!!!
    Most excellent!

  2. #2872
    Join Date
    Jun 2012
    Posts
    452
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    Cindy,
    I've been trying out OPC with guest checkout and it works great. But I'd like to apply the group discount to certain guests. I've set up an observer to check if a guest customer should get a discount when the guest enters their name and address. If so, I set the group_pricing field in the customers table for the special "do not remove" guest customers_id, expecting that during checkout, the group pricing order total module will calculate the discount and apply the discount. And although the table has been modified, the group pricing module is never called during guest checkout. The discount is applied to normal logged in customers in the group. Thoughts?
    Thanks!
    Dave
    Last edited by Dave224; 10 Jul 2024 at 04:10 PM.

  3. #2873
    Join Date
    Jun 2012
    Posts
    452
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by Dave224 View Post
    Cindy,
    I've been trying out OPC with guest checkout and it works great. But I'd like to apply the group discount to certain guests. I've set up an observer to check if a guest customer should get a discount when the guest enters their name and address. If so, I set the group_pricing field in the customers table for the special "do not remove" guest customers_id, expecting that during checkout, the group pricing order total module will calculate the discount and apply the discount. And although the table has been modified, the group pricing module is never called during guest checkout. The discount is applied to normal logged in customers in the group. Thoughts?
    Thanks!
    Dave
    Ok, I see. ot_group_pricing excludes guests.
    Code:
            if ($order->info['total'] == 0 || !zen_is_logged_in() || zen_in_guest_checkout()) {
                return;
            }
    Dave

  4. #2874
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,349
    Plugin Contributions
    94

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by Dave224 View Post
    Cindy,
    I've been trying out OPC with guest checkout and it works great. But I'd like to apply the group discount to certain guests. I've set up an observer to check if a guest customer should get a discount when the guest enters their name and address. If so, I set the group_pricing field in the customers table for the special "do not remove" guest customers_id, expecting that during checkout, the group pricing order total module will calculate the discount and apply the discount. And although the table has been modified, the group pricing module is never called during guest checkout. The discount is applied to normal logged in customers in the group. Thoughts?
    Thanks!
    Dave
    What notification is the observer watching? I'll note that doing that on-customer update to the guest customer's database record could wind up giving the discount to the "wrong" person.

    You might be better off adding a notification to ot_group_pricing's calculate_deductions method (in the check for guest-checkout, towards the top) and simply override the returned array there.

  5. #2875
    Join Date
    Jun 2012
    Posts
    452
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by lat9 View Post
    What notification is the observer watching? I'll note that doing that on-customer update to the guest customer's database record could wind up giving the discount to the "wrong" person.

    You might be better off adding a notification to ot_group_pricing's calculate_deductions method (in the check for guest-checkout, towards the top) and simply override the returned array there.
    The notifier I'm using is NOTIFIER_CART_GET_PRODUCTS_START with checks on presence of $_SESSION['opc'], $_SESSION['opc']->isGuestCheckout() === true, and $_SESSION['opc']->getAddressLabelFields for the guest billing address. All this to get the first notifier occurrence after the guest's name and address is entered. This is followed by checks on the name and address against a separate table of customers who get discounts. Then the guest customer entry in table customers is updated with the guests pricing group. Finally, there's some code to set a $_SESSION variable to check to prevent repeating the processing for subsequent notifications because I couldn't get the detach notifier method to work. If the guest does not get a discount, the guest entry in table customers is returned to it's default. Not the easiest notifier, but it's the only one I could find to work with.

    I think I see what you're suggesting. Basically, set the guest entry in the customer table to any pricing group so that ot_group_pricing calculates the discount, followed by checks there to see if the discount is valid for the current customer or guest and override if not valid. I would still have to eliminate the check on zen_in_guest_checkout() in method process in ot_group_pricing. Am I correct in understanding your suggestion?

    Dave

  6. #2876
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,349
    Plugin Contributions
    94

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by Dave224 View Post
    The notifier I'm using is NOTIFIER_CART_GET_PRODUCTS_START with checks on presence of $_SESSION['opc'], $_SESSION['opc']->isGuestCheckout() === true, and $_SESSION['opc']->getAddressLabelFields for the guest billing address. All this to get the first notifier occurrence after the guest's name and address is entered. This is followed by checks on the name and address against a separate table of customers who get discounts. Then the guest customer entry in table customers is updated with the guests pricing group. Finally, there's some code to set a $_SESSION variable to check to prevent repeating the processing for subsequent notifications because I couldn't get the detach notifier method to work. If the guest does not get a discount, the guest entry in table customers is returned to it's default. Not the easiest notifier, but it's the only one I could find to work with.

    I think I see what you're suggesting. Basically, set the guest entry in the customer table to any pricing group so that ot_group_pricing calculates the discount, followed by checks there to see if the discount is valid for the current customer or guest and override if not valid. I would still have to eliminate the check on zen_in_guest_checkout() in method process in ot_group_pricing. Am I correct in understanding your suggestion?

    Dave
    What I'm suggesting is to add a notification in /includes/modules/order_total/ot_group_pricing.php's calculate_deductions method:
    Code:
        if ($order_total == 0 || !zen_is_logged_in() || zen_in_guest_checkout()) {
            global $zco_notifier;
            $zco_notifier->notify('NOTIFY_OT_GROUP_PRICING_DEDUCTION_OVERRIDE', ['order_total' => $order_total], $od_amount);
            return $od_amount;
        }
    Your observer would watch for that notification and, if the 'order_total' isn't 0 and zen_in_guest_checkout() returns (bool)true, would check for the guest customer that you're looking to provide the deduction for and 'fill in' the $od_amount array with the discount information.

  7. #2877
    Join Date
    Jun 2012
    Posts
    452
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    Got it. Thanks Cindy!
    Dave

  8. #2878
    Join Date
    Apr 2019
    Posts
    292
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    php 8.1. zc 1.58a

    I received the following intermittent warning over the weekend. It is my first time to receive this warning.

    PHP Code:
    [21-Jul-2024 22:04:59 America/New_YorkRequest URI: /ajax.php?act=ajaxOnePageCheckout&method=updatePaymentMethodIP addressxxxxLanguage id 1
    #0 /includes/classes/ajax/zcAjaxOnePageCheckout.php(435): zen_debug_error_handler()
    #1 /includes/classes/ajax/zcAjaxOnePageCheckout.php(370): zcAjaxOnePageCheckout->createOrderTotalHtml()
    #2 /ajax.php(85): zcAjaxOnePageCheckout->updatePaymentMethod()
    --> PHP WarningUndefined array key "shipping" in /includes/classes/ajax/zcAjaxOnePageCheckout.php on line 434. 
    The lines near line 434 is the following:

    PHP Code:
    $checkout_one->debug_message(
                
    "Returning:\n" .
                
    json_encode($order->infoJSON_PRETTY_PRINT) . "\n" .
                
    json_encode($_SESSION['shipping']) . "\n" .
                (
    $_SESSION['payment'] ?? '[not set]'),
                
    false,
                
    'zcAjaxOnePageCheckout::createOrderTotalHtml'
            
    ); 

  9. #2879
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,349
    Plugin Contributions
    94

    Default Re: One-Page Checkout [Support Thread]

    Thanks for the report; GitHub issue created: https://github.com/lat9/one_page_checkout/issues/418

  10. #2880
    Join Date
    Apr 2019
    Posts
    292
    Plugin Contributions
    0

    Default Re: One-Page Checkout [Support Thread]

    Quote Originally Posted by lat9 View Post
    Thanks for the report; GitHub issue created: https://github.com/lat9/one_page_checkout/issues/418
    Thanks for your fast fix.

 

 

Similar Threads

  1. Set number of products displayed per page (support thread)
    By yellow1912 in forum All Other Contributions/Addons
    Replies: 146
    Last Post: 2 Nov 2023, 12:50 AM
  2. v151 Banners In Main Page - Support Thread
    By stevesh in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Sep 2021, 03:36 PM
  3. v151 Site Map/Page Not Found: Combined [Support Thread]
    By lat9 in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 4 Jan 2016, 02:19 PM
  4. v151 PayPal Express Checkout Using NVP 84.0 [Support Thread]
    By lat9 in forum Addon Payment Modules
    Replies: 32
    Last Post: 28 Dec 2015, 04:54 PM
  5. Checkout Amazon Style -- Support Thread
    By CJPinder in forum All Other Contributions/Addons
    Replies: 72
    Last Post: 13 Apr 2011, 08:18 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