jamododger87
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Using update_meta_data on WooCommerce thank you pageFound the solution to this:
Used add_action(‘woocommerce_thankyou’… instead of wp_footer. And as woocommerce_thankyou only receives the order id as an argument, i needed to use $order = wc_get_order($order_id) to get the WC_Order object.
//functions.php add_action( 'woocommerce_thankyou', 'hasLoadedPlayPage', 20, 1); function hasLoadedPlayPage( $order_id ){ $order = wc_get_order($order_id); $order->update_meta_data('hasLoadedPlayPage', 'Yes'); $order->save(); }
Forum: Fixing WordPress
In reply to: Help! Redirects/Caching on with restricting access to postsI just needed to add the redirect param!
function redirect_non_logged_users_to_specific_page() { if (! is_user_logged_in() && (is_singular(array('talks','interviews','articles'))) ) { wp_redirect('https://cybertalks.co.uk/login/?redirect_to='.get_permalink()); exit; } } add_action('template_redirect', 'redirect_non_logged_users_to_specific_page');
Forum: Fixing WordPress
In reply to: Help! Redirects/Caching on with restricting access to postsHi jnashhawkins,
Thanks for your response.
The logging in process is fine i think.
Eg:
Logged Out user comes to site – Clicks on login – Goes to UM login page – Logs in – Gets redirected to homepage – Can view articles
The problem is I have restricted access to the posts (logged out users get redirected to login page), and then they cant click on an article:
Eg:
Logged Out user comes to site – Clicks on article A – Gets redirected to UM login page – Logs in – Gets redirected to homepage – Clicks on article A – Gets redirected to UM profile page (not article A).
If they were to go back to the homepage they could click on any of the other articles to view them, just not article A.
I am stumped!
I had a similar issue – i resolved the issue by placing the most recent version of jquery before the closing <head> tag:
<script type=’text/javascript’ src=’https://yourdomain.co.uk/wp-content/themes/theme/js/jquery.min.js’></script>
<?php wp_head(); ?>
</head>Hope this helps some of you!
I had a similar issue – i resolved the issue by placing the most recent version of jquery before the closing <head> tag:
<script type=’text/javascript’ src=’https://yourdomain.co.uk/wp-content/themes/theme/js/jquery.min.js’></script>
<?php wp_head(); ?>
</head>Hope this helps some of you!
Forum: Plugins
In reply to: [WooCommerce] Customizing the WooCommerce flowHi Con,
Not sure this is closed or not, but will post anyway.
I have not had the chance yet to figure this out (My task this weekend), but I have collated three links that I will be using to get try and this done!
Creating the thank you page:
https://nicola.blog/2015/01/21/customize-the-thank-you-page-in-woocommerce/Creating a form that updates the order notes:
https://rudrastyh.com/woocommerce/thank-you-page.htmlAdding the notes to email
https://www.remicorson.com/add-order-notes-to-woocommerce-completed-order-email/I will be creating a game on my thank you page where the customer plays and it sets coordinates to form fields.
I will need to be able to search through all these coordinates in the back end to determine a winner (Its a competition), so maybe using order notes is not the best solution but I will try and create custom order meta as per your response above.
If this thread is open please keep it open and I will post more of the solution if and when I find it this weekend!
Regards,
James
Forum: Plugins
In reply to: [WooCommerce] Customizing the WooCommerce flowHi Con,
Thanks for your swift response!
I will take a look at this documentation and give it a go!
May i keep the thread open? If I succeed i will post my solution for anyone else looking to do the same thing.
Cheers,
James
Thanks for your help Daniel I will look into it!
James