Jump to content

Demitry

Members
  • Content count

    493
  • Joined

  • Last visited

  • Days Won

    21

Demitry last won the day on October 12

Demitry had the most liked content!

4 Followers

Profile Information

Recent Profile Visitors

15,724 profile views
  1. Demitry

    Need some JS/jQuery help

    Hi, I’m finishing up an update to a Multi-Vendor Shipping (MVS) addon feature, and have encountered a situation that I am having a difficult time resolving. The problem is with my JS/jQuery skills. A while back, I made a Purchase Order feature that can be saved as a PDF file and sent to the vendor via email from the same page. While updating this page and its features, I came across an issue where the text that wraps inside of a textbox/textarea element, but does not wrap when rendered via a PDF file. I found a number of solutions to wrap this text for those fields in the PDF, but cannot seem to make any of these solutions work with my current jQuery code for generating the PDF file. The screenshot image below shows how the admin Vendor Purchase Order page looks. Within this page, there are 4 fields that I need to allow for text wrapping. The product name (when it’s a long one), the Vendor Instructions (not visible when no instructions are listed via the vendor profile), the customer’s comments from the order (not visible if no comments are made at the time of purchase), and the additional order comments (last-minute store-owner comments added before generating the PDF – these are not saved anywhere in osC, only to the generated PDF file). I could probably use the wordwrap() function via PHP for the first three fields (because the data for these are extracted from the database), but not for the last one. That additional order comments textarea should be jQuery. Here is the code I have to generate the PDF: <script src="https://unpkg.com/jspdf@latest/dist/jspdf.umd.min.js"></script> <script src="https://unpkg.com/html2canvas@1.3.2/dist/html2canvas.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.min.js"></script> and in the body: <script> $(document).ready(function() { $(".btn_genPDF").click(function() { var element = document.getElementById("pdf-Content"); html2pdf(element, { margin: <?php echo $js_margin; ?>, // margin in pixels when jsPDF units set to 'pt' = best page-centering filename: '<?php echo $filename; ?>', image: { type:'jpeg', quality:0.98 }, // default quality setting is 0.95 html2canvas: { scale:3, dpi:192, logging:true, letterRendering:true, position:0 }, // scale: 1 to 5, where 1 is default and lowest quality setting pagebreak: { mode:'avoid-all', before:'#po_page_break' }, jsPDF: { unit:'pt', format:'letter', orientation:'<?php echo $js_orientation; ?>' } }) }); }); </script> It seems that using the jQuery splitTextToSize() function is the valid way to wrap text inside an element, but I could really use some help with how to integrate that function with the current code that generates the PDF file. Any help would be greatly appreciated.
  2. Read through that thread. It seems that Gmail spam filters are blocking the subject line.
  3. Just wrap that in... if (is_array($customers_dob) && isset($customers_dob)) { ..... } Try it without the is_array() function.
  4. Try this for the first one. switch (isset($_GET['install'])) { or switch ((isset($_GET['install']) ? $_GET['install'] : null)) {
  5. if (is_array($group_id_array) && sizeof($group_id_array <= 1)) { Should really be... if (is_array($group_id_array) && sizeof($group_id_array) <= 1) {
  6. Demitry

    Transfer 2.3 to 2.3.41 with fresh install

    You can use MySQL Workbench or do it through phpMyAdmin. There are other database migration tools, but these are free and will do the job for you. Just read the instructions and make sure you make a back-up of your database first.
  7. Demitry

    Add "Keep me logged in" on login page

    Ok, let me replicate this feature on one of my development sites and see if there is something I missed. You don't need a separate cron job file for the sessions table, just use Jack's Database Optimizer add-on. It cleans the entire database, not just that sessions table. And, test all your stuff on a development site/sub-domain,.. Never on your live site!
  8. Demitry

    Add "Keep me logged in" on login page

    @Jack_mcs Hey Jack, Your Database Optimizer add-on cleans that sessions table, right? Does it clean everything or only expired sessions?
  9. Demitry

    Add "Keep me logged in" on login page

    I just looked at that sessions file and I think you're right, that add-on is made for sessions that are stored in the database. I've never dealt with storing sessions in a folder instead, ..or what changes need to be made to accommodate that set-up. Let's ask Jack @Jack_mcs about the automatic removal of expired sessions from the database. I believe that this is true, but Jack would know better than I. Jack also has an awesome add-on called, Database Optimizer. This keeps your database clean and light, and you can set up a cron job to clean that database once a week or once a month. Set it to run at like 4am when most everyone is snoring so as not to impact site performance for visitors. The process only takes a minute or so,.. so it's really not a big deal.
  10. Demitry

    Add "Keep me logged in" on login page

    Actually, that sessions storage change should not make any difference as far as the session expiration control. The osC system will handle sessions regardless of where you store them. The two SQL additions via that add-on, are just there to set time controls for the sessions in admin and the catalog/shop. You could actually do the same thing by defining these session settings in the two configuration files.
  11. Demitry

    Add "Keep me logged in" on login page

    I'll take a look at this tomorrow. This should not be a problem, but I need to get some sleep right now. Talk soon.
  12. Demitry

    Add "Keep me logged in" on login page

    Ok, so there you go. Your standard session timeout is set to 24 minutes (1440/60) of inactivity. And, your server back-up sessions are stored in ea-php56. However, your actual sessions should be stored in a database table called sessions. This also tells me that you originally had your VPS set up when you were running your store on PHP 5.6. ... hence, the name of that sessions back-up temp storage folder.
  13. Demitry

    Add "Keep me logged in" on login page

    Unless you have sessions stored somewhere else, they are stored by default in the database. I'll take a look at the configuration files again. There's also a copy stored in a server folder on a shared account, that you can change to your own location. Where do you have yours stored?
  14. Demitry

    Add "Keep me logged in" on login page

    And, ..yet another option is to present the customer with a pop-up warning to let them know that their session is expiring and ask them if they want to stay logged in. I don't know if there's an add-on like this available, but it should not be a difficult one to make.
  15. Demitry

    Add "Keep me logged in" on login page

    Just a bit of a fair warning,.. if a customer is on a public computer like a library or school computer, and forgets to log out, the person who gets on that computer afterwards has full access to your customer's account. Most people aren't assholes and would likely log out the previous user. However, a scenario like that certainly presents a great opportunity to be one.
×