lolitsjohnnyboy
Forum Replies Created
-
When a customer buys something, the order gets created and nearly at the end of the checkout process, the above hook gets called. We use this hook because the address of the customer and other information are not set at the time of the initial order creation. Somehow, your order number is missing at this point. Some seconds later the order number is available but not at this time at this hook. Maybe there is a parallel process which does something in the DB which is not done at this point? I saw that you are using the order created hook for your plugin.
It’s a hook which gets executed nearly at the end of a checkout process. It appears at all installations.
Maybe you can hook into this hook as well to change the order number by using prio 1? I can use a lower prio, that would be no problem.
Forum: Plugins
In reply to: [WP Crontrol] Issue during cron execution – not acceptableI can understand your point of view but as a developer I see more and more plugins that are badly programmed which produces more issues instead of helping someone. What I’m missing here is something like a quality gate which prevents at least some basic issues…
Forum: Plugins
In reply to: [WooCommerce] button alignmentCheck this out:
https://www.tychesoftwares.com/hide-woocommerce-categories-shop/
Forum: Plugins
In reply to: [WooCommerce] button alignmentPlease remove the alignment plugin and tell me if it’s done. I’ll give you some code for alignment afterwords.
Forum: Plugins
In reply to: [WooCommerce] button alignmentFirst you need to add a screenshot and be a bit more specific. It’s really hard to understand what you mean when theres just 1080p between us.
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Error in debug.logPerfekt, thanks a lot!
I’m so dumb. I’ve added a parameter t=<timestamp> to the URL and now it’s working. Looks like a caching error in the browser. Thanks for your help mate! Happy coding ??
Hmm didn’t worked sadly. Are you caching the invoice somehow? Maybe this makes a problem? I’ve disabled any caching by myself but the problem is still there so I thought that there is an invoice caching?
Where can I get the $order_id from? With $this->order_id?
I’ve thought now to use another way instead using GET parameters but I’ve still a problem with it. I’m now trying to pass my parameters from the order to the invoice template. The process is following:
1: The customer presses a button that calls an AJAX function
<span onclick="viewInvoice($invoice_url)">View Invoice</span>; function viewInvoice(invoiceUrl) { let data = { action: "view_invoice" }; jQuery.post( ajax_url, data, function () { } ).success( function () { let tab = window.open(); if ( tab ) { tab.location.href = invoiceUrl; } } ).fail( function ( response ) { } ); }
2: The function sets the meta data and returns with 200 -> AJAX success -> Open Invoice
$param = array( 'id' => 1, 'bidirectional' => true ); add_post_meta( $order_id, 'tmp_invoice_view', $params ); wp_send_json_success( $response, 200 ); wp_die();
3: Inside the invoice.php I’m trying to receive my meta data and delete it after getting it
$tmp_invoice_view = get_post_meta( $order_id, 'tmp_invoice_view' ); delete_post_meta( $order_id, 'tmp_invoice_view' ); error_log( print_r( $tmp_invoice_view, true ) );
The problem is now that there is nothing logged out until I reload the PDF. I’ve absolutely no idea why this happens. I expect that the data are directly logged out.
I’ve added a timeout after adding the meta data to be sure that it’s in the DB already but still the same problem.
Maybe you have an idea why this happens? Is there something special about the generation I need to know?
- This reply was modified 5 years, 2 months ago by lolitsjohnnyboy.
- This reply was modified 5 years, 2 months ago by lolitsjohnnyboy.
- This reply was modified 5 years, 2 months ago by lolitsjohnnyboy.
Worked! Perfect. Maybe you can add a method description so that developers know whats the init means.
BG to u!
Thanks for no reply..
I’ve tried using
add_filter('um_dequeue_select2_scripts','__return_true');
without any success. When I remove it manually, the conditional logic has a problem because I’m showing 2 different registration forms if the user changes the role dropdown. I want to remove select2 because it causes some problems within my code.