Welcome to GPLDL - we are still beta - please report any bugs via the contact form.

GPLDLGPLDL
GPLDL
Download the most popular GPL licensed Premium WordPress Themes & Plugins and WooCommerce Extensions for FREE!
  • Blog
    • Blog Articles
    • Latest Updates & Additions
  • Repository
    • Full Repository
    • Premium WordPress Themes
    • Premium WordPress Plugins
    • Premium WooCommerce Extensions
    • Special Gifts for Premium Members
    • Tutorials
  • Forum
  • Free Membership
  • Donations
  • My GPLDL Account
  • Sign In
Menu back  

WooThemes Sequential Order Numbers Pro – pre-padding order numbers part

  • This topic has 1 reply, 1 voice, and was last updated 8 years, 6 months ago by Ludovit Mikula.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • October 30, 2016 at 6:45 pm #18070
    Ludovit Mikula
    Participant

    WooThemes Sequential Order Numbers Pro – ver 1.10.0 (06-04-2016)

    I have installed the plugin, however was unable to get the pre-padding of order numbers to get working.
    With order number template: {YYYY}-0001 i was supposed to get number: ‘2016-0001’ but i was getting ‘2016-1’ like in the free version.

    So i tried to dig in the code and found something that might be a bug or a clever camouflage :D

    On line 1083: if ( $order_number_length && ctype_digit( $order_number_length ) ) it checks whether order_number_length variable is set and whether it’s a digit. When you checked what was the input, then in my case i saw number 4.
    However ctype_digit takes string as argument, so it converted that number into ASCII with value 4 which is not a number and returned false. Therefore the pre-padding was not working.

    So what I ended up doing was, that i added casting that value to string (might not be the best solution, but working… with my almost non-existent PHP skills :D)

    Here is the “fix”:

    In file: woocommerce-sequential-order-numbers.php

    line 1084: $order_number = sprintf( "%0{$order_number_length}d", $order_number );
    change to: $order_number = sprintf( "%0{$order_number_length}d", (string)$order_number );

    Hope that helps.

    • This topic was modified 8 years, 6 months ago by Ludovit Mikula.
    November 1, 2016 at 9:54 am #18086
    Ludovit Mikula
    Participant

    the actual fix is on line 1083:
    change : if ( $order_number_length && ctype_digit( $order_number_length ) ) {
    to: if ( $order_number_length && ctype_digit( (string)$order_number_length ) ) {

    Had to also disable woothemes updates for this plugin, otherwise it got replaced.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In
Search the Repository
We reward your Donations!
We need your Donation to maintain and grow the GPLDL WordPress Repository - and we reward your generosity with Premium Memberships allowing you to download even more files.

Learn more about donations & rewards...
News from our blog
  • What is the Battle Between WordPress’s Matt Mullenweg and WP Engine about?
    October 31, 2024
  • Why GPLDL Cannot Accept Your WordPress Plugin or Theme Submission
    February 20, 2024
  • How to Ensure Your WordPress Plugin or Theme is Authentic and Secure
    January 25, 2024
Latest Updates & Additions
  • GPLDL News: 108 Updates & Additions today – Download 2842 Premium WordPress items!
    May 2, 2025
  • GPLDL News: 176 Updates & Additions today – Download 2840 Premium WordPress items!
    April 27, 2025
  • GPLDL News: 88 Updates & Additions today – Download 2838 Premium WordPress items!
    April 21, 2025
Free Downloads?

Most of the WordPress Plugins & Themes in the GPLDL repository are available for free download - yes, free! - that is even better than buying at a discount, rebate, promotion or with a coupon code.

After signing up for a free membership, you will instantly get a download link to GPLDL's WordPress plugins and themes including future updates.

Where is the catch? There is none. We re-distribute 100% exact copies of GPL-licensedWordPress items, completely unmodified - that means *not* nulled, cracked or otherwise modified code without any serial numbers, API keys or support.

How can you help? If you like our service, please spread the word. If you can afford to financially support us, please make a donation. All donations will be used for (recurring) subscriptions of WordPress plugins & themes and to grow the catalog!

Tags
authenticity check code collaboration commercial copyleft Copyright developers distribution Download Extensions fork Free fsf functions.php GNU Public License GPL Guide HowTo Instructions Legal license malware Modify nulled open source Plugin Plugins Premium redistribution remove Rights secure Security serial Software software development Themes tutorial Update Website WooCommerce wordpress WordPress Plugins WordPress Themes
Welcome to GPLDL!
scr02We love innovation and we believe in free software!

That's why we strive to make the world's best Premium WordPress Themes & Plugins and WooCommerce Extensions & Themes available for everyone!

Find us on:

FacebookTwitterRssPinterestWebsite
Latest Blog Posts
  • What is the Battle Between WordPress’s Matt Mullenweg and WP Engine about?
    October 31, 2024
  • Why GPLDL Cannot Accept Your WordPress Plugin or Theme Submission
    February 20, 2024
  • How to Ensure Your WordPress Plugin or Theme is Authentic and Secure
    January 25, 2024
Latest Updates & Additions
  • GPLDL News: 108 Updates & Additions today – Download 2842 Premium WordPress items!
    May 2, 2025
  • GPLDL News: 176 Updates & Additions today – Download 2840 Premium WordPress items!
    April 27, 2025
  • GPLDL News: 88 Updates & Additions today – Download 2838 Premium WordPress items!
    April 21, 2025
About GPLDL
  • About GPLDL
  • Need Help?
  • F.A.Q.
  • Terms of Service
  • Privacy Policy
  • Contact
GPLDL - all Rights reserved.
  • About GPLDL
  • Need Help?
  • F.A.Q.
  • Terms of Service
  • Privacy Policy
  • Contact
  • Sign In
GPLDL Widget Menu