logo
down
shadow

Generating a unique QR code for each Order in Woocommerce


Generating a unique QR code for each Order in Woocommerce

By : light
Date : November 25 2020, 07:22 PM
hope this fix your issue Without knowing anything of WooCommerce or Wordpress I would suggest:
Adding a 'Custom order metadata item' with a unique ID: Check:'Add custom order item meta data' Maybe this is unnecessary and you can reuse the plain ID from the order Then 'Dynamically generating a QR code with PHP' to render the QR
code :


Share : facebook icon twitter icon
Generating a truly unique order id in PHP?

Generating a truly unique order id in PHP?


By : xxywy
Date : March 29 2020, 07:55 AM
like below fixes the issue I'm considering using this: http://phpgoogle.blogspot.com/2007/08/four-ways-to-generate-unique-id-by-php.html , Assuming your users are authenticated and have a user id:
code :
$unique_id = time() . mt_rand() . $userid;
Generating Order Numbers - Keep unique across multiple machines - Unique string seed

Generating Order Numbers - Keep unique across multiple machines - Unique string seed


By : Ipunk Giejee
Date : March 29 2020, 07:55 AM
Any of those help If you have a relatively small number of machines and each one can have it's own configuration file or setting, you can assign a letter to each machine (A,B,C...) and then append the letter onto the order number, which could just be an auto-incrementing integer in each DB.
i.e.
code :
Starting each database ID at 1000:
1001A // First  order on database A
1001B // First  order on database B
1001C // First  order on database C
1002A // Second order on database A
1003A // Third  order on database A
1004A // etc...
1002B
1002C
Generating Unique Order Number

Generating Unique Order Number


By : Thamis
Date : March 29 2020, 07:55 AM
around this issue I am trying to upload the cover image of a Facebook Page via Graph API, But it appears on the Timeline once its updated.
code :
while (!empty($order_no_exisits)) {
$unique_order_number = strtoupper(substr(md5(microtime()), 0, 8));
if(!$this->Order->find('first', array('order_no' => $unique_order_number)))
exit;
}
How to add Unique nos in order email for each unit of woocommerce product sold

How to add Unique nos in order email for each unit of woocommerce product sold


By : igi
Date : March 29 2020, 07:55 AM
it helps some times I found a solution if this helpful for you. I think you can store unique nos in database order item meta when product sold. Put this hook in your active theme functions.php file.
code :
add_action( 'woocommerce_add_order_item_meta', 'add_random_number_item_meta', 10, 2 );

function add_random_number_item_meta( $item_id, $item_data ){
  // store each product item quantity in array
  $random = array();
  for( $i = 0; $i < $item_data['quantity']; $i++ )
  $random[$i] = rand(10000, 90000);
  // save unique numbers array each order item
  wc_add_order_item_meta( $item_id, '_unique_nos', $random );   

}
//woocommerce\emails\email-order-items.php

 $unique_numbers = wc_get_order_item_meta( $item_id,  '_unique_nos', true );
 echo implode( "," , $unique_numbers );

// This will be same both for admin or customer
Order items in a JS tracking code on Order received page in Woocommerce

Order items in a JS tracking code on Order received page in Woocommerce


By : user1924432
Date : March 29 2020, 07:55 AM
will be helpful for those in need The following revisited code adds the correct order items loop and uses "Order received" page (Thankyou) dedicated action hook:
code :
add_action( 'woocommerce_thankyou', 'js_tracking_thank_you_page', 90, 1 );
function js_tracking_thank_you_page( $order_id ) {
    // Get the WC_Order instance Object
    $order = wc_get_order( $order_id );

    // Output
    ?>
    <script type="text/javascript">
    ADMITAD = window.ADMITAD || {};

    ADMITAD.Invoice = ADMITAD.Invoice || {};

    // deduplication parameter (for Admitad by default)
    ADMITAD.Invoice.broker = "adm";

    // action code (defined during integration)
    ADMITAD.Invoice.category = "1";

    // temporary array for product items
    var orderedItem = [];

    <?php
    // Loop through Order items
    foreach( $order->get_items() as $item ) :
        $product = $item->get_product();
    ?>
    orderedItem.push({

      Product: {
        // internal product ID (not more than 100 characters, the same as in your product feed)
        productID: '<?php echo $item->get_product_id(); ?>',

        // tariff code (defined during integration)
        category: '1',

        // product price
        price: '<?php echo $product->get_price(); ?>',

        // currency code in the ISO-4217 alfa-3 format
        priceCurrency: '<?php echo $order->get_currency(); ?>',
      },
      // product quantity
      orderQuantity: '<?php echo $item->get_quantity(); ?>',

      additionalType: "sale" // always sale

    });
    <?php endforeach; // End of Loop ?>

    // adding items to the order
    ADMITAD.Invoice.referencesOrder = ADMITAD.Invoice.referencesOrder || [];

    ADMITAD.Invoice.referencesOrder.push({
      // internal order ID (not more than 100 characters)
      orderNumber: "<?php echo $order->get_id(); ?>;",

      orderedItem: orderedItem

    });

    // Important! If order data is loaded via AJAX, uncomment this string.
    // ADMITAD.Tracking.processPositions();
    </script>
    <?php
}
// product price
price: '<?php echo $product->get_price(); ?>',
// Converted product price (rounded with 2 decimals)
<?php $price = EuroFxRef::convert( $product->get_price(), 'RON', 'EUR' ); ?>
price: '<?php echo round( $price, 2 );  ?>',
Related Posts Related Posts :
  • What could be causing my WhatsApp Stickers Pack not to work?
  • How Can I Reorder/Sort The Collections List in Directus?
  • Is this language generic/mighty enough to be used for a generic game AI?
  • graphite, use regular expressions to select the target, or an alternative
  • subtract functions with type real in ml
  • how to filter '(' in navision 2013
  • sending sms from a mobile browser
  • NuGet behind firewall
  • Gstreamer hangs while generating timelapse from JPEGs on Raspberry pi
  • How to retrieve total view count of large number of pages combined from the GA API
  • Websites rich with exercices or explanation for SML?
  • Is there a TempData equivalent in ServiceStack?
  • scipy-0.12.0 failing to install on mountain lion using python setup.py install
  • Looking for simplest option to render Razor cshtml pages in a console application without any web server
  • Evaluating variables at a specific time in Modelica
  • When I run the Application, only "web" engine is running in GlassFish. "webservices" is not started
  • How To Set MIME Type Of Google Drive File
  • Remove Missing Values in Weka
  • Reloading a UICollectionView using reloadData method returns immediately before reloading data
  • carrot2 - can I cluster documents from a folder?
  • StreamSocket has no Close Implementation in C#
  • Rails, Foundation 4, Respond.js not working properly in IE8
  • How can i create imagesurface from cairo xlib's Graphics Context using cairo and x11 Api's?
  • CKEditor "overflow: scroll" on parent causes toolbar to freeze at initial position
  • Differences between components and controls in ENYO
  • Photoshop making isometric?
  • Does Intel IPP 8.0 support in-place operations?
  • What is Object dictionary in CANOpen?
  • Example of orbBasic Indexed User Variables
  • convert to ABSOLUTE in logback
  • How to conditionally download file using p:fileDownload
  • Error on pod install
  • Set HTTP GET Parameters in Finagle
  • different attack that uses sql injection
  • How can I change my xampp username not as 'root'
  • AMQP Content header payload structure
  • Apache POI formula evaluation not working for Excel IF
  • How can I trace RESTEasy's dispatch?
  • Map Freezes on iOS 7 with Google Maps SDK 1.4
  • Comparing lists, is the subset list within the first list
  • Non-ascii character highlight in Sublime Text 2
  • Installing Magit in Aquamacs
  • Receiving error - System.Net.Mail.SmtpException: 4.3.2 try again later
  • Coreaudio render callback in monotouch
  • The command 'yarn --v' also initiates 'yarn install' and installs packages automatically. Why is this happening?
  • save multiple matches in a list (grep or awk)
  • Can a number register be used in a groff request?
  • Mapping FAQ with RASA for large dataset (2000+)
  • Fragment not receiving LiveData updates after remove + add
  • FitText.js makes text bigger rather than smaller
  • ARM - Implementing stack with load/store multiple register values
  • How to check if a ChromeCast Session is already in progress
  • ngForm inside a Carousel Slide in UI Bootstrap not working
  • Clearing attributes in Tritium
  • "vagrant up" failing: Vagrant VM failed to remain in the running state
  • ftsearch returning empty docs
  • What are the advantages of setting "hive.exec.parallel" to false in Hive ?
  • Creating a root certificate in FiddlerCore
  • How to access app.config in a blueprint?
  • DB2 RECORDSET table name converted to uppercase
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org