Thorvaldur Sveinsson

Forum Replies Created

Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • in reply to: Error 20004 Invalid nounce after plugin update #49787

    Ok never mind I’ll figure it out.

    in reply to: Error 20004 Invalid nounce after plugin update #49778

    Hm the only time I ever configure a nounce is when I am building a custom Ajax call and I am not doing so on this website. (Im not implementing the wp_create_nonce(‘some_nounce_secret_string’) method )

    The site works with the wp-pizza version 3.12.1 but the error occurs after the update to 3.12.10 so apparently nounces are not missing before that.

    The live site is using v. 3.12.1 and we are able to check out.

    No templates have been messed with just this update.

    in reply to: Error 20004 Invalid nounce after plugin update #49776

    Im sorry I thought I had disabled that plugin. (it is built on the gateway demo within the wp-pizza plugin) and is causing some troubles. But I have set the debug mode to true and I did encounter some warnings that I have taken care of. The errors in the console were actually reminders for myself to have the gateway pluggin turned on but those are gone now since I disabled the “avista_is-avista-wppizza-gateway-50726f33a922” plugin but still the error persists

    Pic of error

    in reply to: Error 20004 Invalid nounce after plugin update #49773
    This reply has been marked as private.
    in reply to: Error 20004 Invalid nounce after plugin update #49772

    Oh dear. My head was on backwards yesterday…
    I am spinning up a staging server to show you what going on and this error only occurs when trying to checkout the order. I have disabled all gateway pluggins and am just using the Pay on pickup option for the test order. I will send you a private msg when I have the staging running with passwords and whatnot.

    This reply has been marked as private.
    in reply to: Geting the current discount/label name #43872

    Im sorry to be drowning you in posts like this but this seems to be a bug. I added an extra discount with the same properties as the one with the id 0 and then this works as expected. So It seems that for some reason that a id 0 gets left out if the Cumulative apply… checkbox is unchecked.

    cheers

    in reply to: Geting the current discount/label name #43871
    This reply has been marked as private.
    in reply to: Geting the current discount/label name #43870

    Oh I am sorry but the Cumulative apply in conjunction with other applicable discounts seems to achieve this so never mind the last comment

    in reply to: Geting the current discount/label name #43869

    I wonder if there is a way with the myprefix_discountids_applied function to use the Id’s retrieved to simply turn off another discount by id.

    Say i want discount id 0 to be valid over id 2. Can I somehow from here tell the pluggin to deactivate discount with the Id 2 if 0 is in the array.

    In other words flick this on/off
    https://www.dropbox.com/s/xbaj6emyhmi9drs/Screenshot%202019-07-08%2012.18.21.png?dl=0

    in reply to: Geting the current discount/label name #43868

    Thank you so much I will try these out!

    Cheers!

    Thats great and clarified! Thank you for all your help!

    cheers

    Hi Olly and thanks responding so quickly! 😀
    Yes I had debugging on but locally I’m not getting any errors. I did do a test on a live staging server and I do get an error claiming that I have only passed 2 arguments but 4 are needed. Strange because as you can see in my code snippet above I have 4 arguments lined up.

    I did try another thing and that was to declare 2 arguments in the add_filter method and then pass only 2 arguments to the function and then It worked for my purposes for now.

    add_filter( 'wppizza_filter_orderhistory_order_info', 'my_orderinfo_add_total', 10, 2);
    function my_orderinfo_add_total($markup, $order_id){
    $markup['order_update'] .='<div>test</div>';
    return $markup;
    }

    Like I said this works with the above solution but perhaps there is something going on under the hood that needs investigating so below is the error I get when using 4 suggested arguments.

    Error with 4 arguments:
    Fatal error: Uncaught ArgumentCountError: Too few arguments to function my_orderinfo_add_total(), 1 passed in /www/wp-includes/class-wp-hook.php on line 288 and exactly 4 expected in /www/wp-content/themes/shakepizza/functions.php:390 Stack trace: #0 /www/wp-includes/class-wp-hook.php(288): my_orderinfo_add_total(Array) #1 /www/wp-includes/plugin.php(208): WP_Hook->apply_filters(Array, Array) #2 /www/wp-content/plugins/wppizza/classes/modules/mod.orderhistory.orderhistory.php(1393): apply_filters(‘wppizza_filter_…’, Array, Array) #3 /www/wp-content/plugins/wppizza/classes/modules/mod.orderhistory.orderhistory.php(652): WPPIZZA_MODULE_ORDERHISTORY_ORDERHISTORY->order_history_markup() #4 /www/wp-includes/class-wp-hook.php(286): WPPIZZA_MODULE_ORDERHISTORY_ORDERHISTORY->order_history_results(”) #5 /www/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array) #6 /www/wp-includes/plugin.php(465): WP_Hook->do_action(Array) #7 /www/wp-content/plugins/wppizza/classes/subpages/subpage.order_history.php(243): do_act in /www/wp-content/themes/shakepizza/functions.php on line 390

    in reply to: v3 custom gateway #42348

    Brilliant! Cheers!!

    Adding the category_id did the trick! Cheers!

    Small update so we are just getting the shakes if we are on the shakes :

    $queried_object = get_queried_object();
    $queried_object_id = $queried_object->term_id;
    $category_title = $queried_object->name;
    $category_slug = $queried_object->slug;
    if (have_posts()) {
    while(have_posts()) {
    the_post();
    $postID = get_the_ID();
    if(get_query_var( WPPIZZA_TAXONOMY ) == $category_slug){
    echo do_shortcode("[wppizza type='add_item_to_cart_button' id='{$postID}']");
    }
    }
    }

    from my_theme_root/wppizza/markup/loop/theme-wrapper.php

    if (have_posts()) {
    while(have_posts()) {
    the_post();
    $postID = get_the_ID();
    echo do_shortcode("[wppizza type='add_item_to_cart_button' id='{$postID}']");
    }
    }

    I setup the twenty sixteen theme with same results for the add_item_to_card_button

    This reply has been marked as private.

    Hi and thanks for your quick reply. All the menu items are assigned to a category.
    I updated the original plugin from 2.16.11.14 to 2.16.11.26 as instructed in the documentation before updating to the v3. All other short codes work fine. Apart from the warning the rendered buttons do not work to add the items to the cart. I also noticed that if I am on a say Pizzas category archive page the shortcut will work if I test with menu Items not in that category fx if I hardcode an menu item id from the drinks category the button works fine with out the warning.

Viewing 19 posts - 1 through 19 (of 19 total)