• Resolved vishal05

    (@vishal05)


    After successful order i need generate xml so Which hook is used after successful order?

    • This topic was modified 7 years, 10 months ago by vishal05.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author ollybach

    (@ollybach)

    Thread Starter vishal05

    (@vishal05)

    require(WPPIZZA_PATH.’classes/wppizza.order.details.inc.php’);
    $orderDetails=new WPPIZZA_ORDER_DETAILS();
    $orderDetails->setOrderId($orderId);
    $order=$orderDetails->getOrder();

    How to get actual price for delivery charges,total and cartitems without currency symbol.

    • This reply was modified 7 years, 10 months ago by vishal05.
    Plugin Author ollybach

    (@ollybach)

    just remove your used currency symbol $order[ordervars]['currency']['value'] from $order['summary']['total']['value']

    same goes for all other values in $order['summary'] where approriate

    Thread Starter vishal05

    (@vishal05)

    require(WPPIZZA_PATH.’classes/wppizza.order.details.inc.php’);
    $orderDetailsInformation=new WPPIZZA_ORDER_DETAILS();
    $orderDetailsInformation->setOrderId($order_id);
    $order=$orderDetailsInformation->getOrder();

    Not working in version Versie: 3.0.beta.170420.1

    Plugin Author ollybach

    (@ollybach)

    because pretty much all hooks have changed in v3.x (deliberately – as mentioned in blog.wp-pizza.com)
    anyway, that particular one is now as follows (Note: that the variables output will have changed )

    
            /** do action */
            do_action('wppizza_on_order_execute', $order_id, $order_details, $print_templates);
    

    am in the process of writing the docs for v3.x as a lot has changed / been added.

    Thread Starter vishal05

    (@vishal05)

    Thanks ollybach For your answer.

    require(WPPIZZA_PATH.’classes/wppizza.order.details.inc.php’);
    $orderDetailsInformation=new WPPIZZA_ORDER_DETAILS();
    $orderDetailsInformation->setOrderId($order_id);
    $order=$orderDetailsInformation->getOrder();

    Here getOrder method is not working properly… $order_details is not give all information like discount amount and many more.

    Plugin Author ollybach

    (@ollybach)

    you are missing the point.

    you do not need any of this require ... $order = ... etc anymore

    simply use the $order_details parameter which will give you all details formatted (though differently than before and with more info)

    (which is why the hook name changed)

    • This reply was modified 7 years, 5 months ago by ollybach.
    Plugin Author ollybach

    (@ollybach)

    it will look something like this

    
    Array
    (
        [site] => Array
            (
                [blog_id] => Array
                    (
                        [label] => blog id
                        [value] => 1
                        [value_formatted] => 1
                    )
    
                [site_name] => Array
                    (
                        [label] => site name
                        [value] => wppizza demo
                        [value_formatted] => wppizza demo
                    )
    
                [site_url] => Array
                    (
                        [label] => siteurl
                        [value] => http://www.test.com
                        [value_formatted] => http://www.test.com
                    )
    
    /*......etc .........*/
    
            )
    
        [ordervars] => Array
            (
                [wp_user_id] => Array
                    (
                        [label] => User ID :
                        [value] => 0
                        [value_formatted] => 0
                    )
    
                [order_date_utc] => Array
                    (
                        [label] => Date UTC
                        [value] => 2017-05-03 10:20:36
                        [value_formatted] => May 3, 2017 10:20 am
                    )
    
    /*......etc .........*/
    
            )
    
        [customer] => Array
            (
                [cname] => Array
                    (
                        [label] => Name :
                        [value] => asdsa
                        [type] => text
                    )
    
                [cemail] => Array
                    (
                        [label] => Email :
                        [value] => dev@wp-pizza.com
                        [type] => email
                    )
    
    /*......etc .........*/
    
            )
    
        [order] => Array
            (
                [multiple_taxrates] => 
                [taxes_included] => 
                [items] => Array
                    (
                        [1.34.406.3] => Array
                            (
                                [blog_id] => 1
                                [post_id] => 406
                                [title] => Drink C
                                [price_label] => 1.00l
                                [quantity] => 1
    /*......etc .........*/
    						)
    
                    )
    
            )
    
        [summary] => Array
            (
                [total_price_items] => Array
                    (
                        [0] => Array
                            (
                                [label] => Your Items
                                [value] => 2.25
                                [value_formatted] => £ 2.25
                            )
    
                    )
    
                [delivery_charges] => Array
                    (
                        [0] => Array
                            (
                                [label] => Delivery Charges
                                [value] => 47.75
                                [value_formatted] => £ 47.75
                            )
    
                    )
    
    /*......etc .........*/
    
                [total] => Array
                    (
                        [0] => Array
                            (
                                [label] => Total
                                [value] => 51.43
                                [value_formatted] => £ 51.43
                            )
    
                    )
    
            )
    
        [localization] => Array
            (
                [sku_label] => SKU
                [free_delivery_for_orders_of] => free delivery for orders over
                [minimum_order_delivery] => minimum order for delivery
    /*......etc .........*/
            )
    
    )
    
    
    Thread Starter vishal05

    (@vishal05)

    i am using wppizza-gateway-sisow plugin but after successful payment wppizza_on_order_execute hook $order_details return blank value.

    do_action(‘wppizza_on_order_execute’, $order_id, $order_details, $print_templates);

    Although it is working on “Pay at delivery / pickup” ( cash on delivery ) hoping form here you soon.

    • This reply was modified 7 years, 3 months ago by vishal05.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Hook After Successful order’ is closed to new replies.