Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by bsmither

  1. I would like for you try this: <!-- Stuff at the top. --> <div class="row pad-left"> <div class="row"> {if $INCLUDE_CHECKOUT && !$DISABLE_GATEWAYS} <div class="small-6 columns"> <!--<a href="?" class="right">{$LANG.basket.continue_shopping}</a>--><h3>{$LANG.gateway.select}</h3> <ul class="no-bullet" id="gateway_error"> {foreach from=$GATEWAYS item=gateway} <li> <input name="gateway" type="radio" class="nosubmit" value="{$gateway.folder}" id="{$gateway.folder}" required {$gateway.checked} rel="gateway_error"><label for="{$gateway.folder}">{$gateway.description}</label> {if !empty($gateway.help)} <a href="{$gateway.help}" class="info" title="{$LANG.common.information}"><svg class="icon"><use xlink:href="#icon-info-circle"></use></svg></a> {/if} </li> {/foreach} </ul> {if $DISABLE_CHECKOUT_BUTTON!==true} {if $CHECKOUTS} <div class="row"> <div class="small-12 columns text-right">-- {$LANG.common.or} --</div> </div> {foreach from=$CHECKOUTS item=checkout} <div class="row"> <div class="small-12 columns text-right pad">{$checkout}</div> </div> {/foreach} {/if} {/if} </div> {/if} <div class="small-6 columns right"> {if $DISABLE_CHECKOUT_BUTTON!==true} <button type="submit" name="proceed" id="checkout_proceed" class="button right g-recaptcha">{$CHECKOUT_BUTTON} <svg class="icon"><use xlink:href="#icon-chevron-right"></use></svg></button> {/if} </div> </div> </div> <div class="hide" id="validate_gateway_required">{$LANG.gateway.choose_payment}</div> {if $TERMS_CONDITIONS && isset($ALTERNATE_TERMS) && $ALTERNATE_TERMS=='0'} <!--Rest of the stuff at the bottom.-->
  2. Hm. It seems the Checkout button is now inside the {if $INCLUDE_CHECKOUT}"Pick a Gateway" block, which the gateways are not shown when viewing the basket. Working on a refined approach...
  3. CubeCart's /files/ folder does have a /public/ subfolder, and has an .htaccess file that allows the web server permission to deliver all requested files. But the /files/ folder itself has an .htaccess file that denies the web server permission to deliver any requested file (except for a couple of situations specific to CubeCart's needs). If you haven't read it yet, please review the GitHub issue: https://github.com/cubecart/v6/issues/2898 The point about not calculating the hash can be put into effect in the file /classes/filemanager.class.php, near line 938: From: 'md5hash' => md5_file($product[0]['digital_path']), To: // 'md5hash' => md5_file($product[0]['digital_path']), So, with the previously discussed edits and web server configuration change, we should be getting to a point where offering super-large files is workable. Also, when using the special link created by CubeCart (the one with "accesskey=randomchars"), CubeCart does make sure that the file to be downloaded under CubeCart control passes restrictions imposed: time limit and download limit.
  4. Currently, the Foundation skin template main.php has this statement at line 21: {include file='templates/element.google_analytics.php'} Looking in the template element.google_analytics.php, we see that (and this has been the case for some months now) the visitor must have agreed to the use of cookies in order for GA to work. You must also not have configured your browser add-ons (no-script, cookie-basher, etc) to whitelist Google's cookies and javascript. Notice also the use of {literal} and {/literal}. The Smarty template engine reserves for itself the use of braces to indicate what is and what is not Smarty code. So, if any code in a template has braces, it must follow a syntax rule, or be enclosed in these tags. The syntax rule is that braces must have whitespace next to them. Whitespace is a space, new line, or tab. Looking at your code above, we see that line 5 has braces with a character other than whitespace right next to the brace character. This is a syntax error and will cause Smarty to throw an exception (which CubeCart does not yet catch). The GA code template is included in the main.php, main.checkout.php, and main.stream.php templates, which covers all pages. If you really need to use your version of the GA code, you can create your own version of element.google_analytics.php, after fixing the syntax error, or wrapping your code in {literal} tags.
  5. The code that you moved into the first 6 column block should come after the closing </ul> tag. You have it before the closing </ul> tag. The {if $DISABLE_CHECKOUT_BUTTON!==true} block of code at the very end is probably still visible - after having copied it to the new location.
  6. The credit card radio button is in a <ul> list within a block that uses all 12 columns. We can split that into two blocks that use 6 columns each: From: <div class="small-12 columns"> <ul class="no-bullet" id="gateway_error"> <li><input name="gateway" type="radio" class="nosubmit" value="Stripe" id="Stripe" required="" checked="checked" rel="gateway_error"> <label for="Stripe">Credit Card</label></li> </ul> <div class="hide" id="validate_gateway_required">Please select a payment method.</div> </div> To: <div class="small-6 columns"> <ul class="no-bullet" id="gateway_error"> <li><input name="gateway" type="radio" class="nosubmit" value="Stripe" id="Stripe" required="" checked="checked" rel="gateway_error"> <label for="Stripe">Credit Card</label></li> </ul> </div> <div class="small-6 columns"> <!-- Put what you want here with class="right". --> </div> <div class="hide" id="validate_gateway_required">Please select a payment method.</div> Move the button id="checkout_proceed" code into that new 6 column block. As for the PayPal button, that comes in with this template code: {if $DISABLE_CHECKOUT_BUTTON!==true} {if $CHECKOUTS} <div class="row"> <div class="small-12 columns text-right">-- {$LANG.common.or} --</div> </div> {foreach from=$CHECKOUTS item=checkout} <div class="row"> <div class="small-12 columns text-right pad">{$checkout}</div> </div> {/foreach} {/if} {/if} You can move that to just after the closing </ul> tag in the first 6 column block. (Remove 'text-right' from the class of the small-12 columns div tags.)
  7. In the row that has the credit card choice, there is a <ul> tag with an id of "gateway_error" and a class of "right". Remove the word 'right' and that should fix that anomaly. Currently, "Continue Payment" seems to be in the right place. The PayPal button is special. I am not 100% sure what it bypasses, but it may bypass the need to fill in any form elements (as a guest), nor possibly even having the guest be required to answer the reCaptcha.
  8. Allow me to ask, how long did it take you to FTP the 13GiB file to your site?
  9. Working with this theory, let's explore what the values of the various variables are. We will use a function to show these values: $GLOBALS['debug']->debugMessage("The stock_status is: ".($stock_status?"True":"False")); $GLOBALS['smarty']->assign('STOCK_STATUS', $stock_status, true); $GLOBALS['debug']->debugMessage("The stock_level is: ".$stock_level); $GLOBALS['smarty']->assign('STOCK_LEVEL', $stock_level, true); $GLOBALS['debug']->debugMessage("The stock_level_supplier is: ".$stock_level_supplier); $GLOBALS['smarty']->assign('STOCK_LEVEL_SUPPLIER', $stock_level_supplier, true); $GLOBALS['debug']->debugMessage("The stock_level_shop is: ".$stock_level_shop); $GLOBALS['smarty']->assign('STOCK_LEVEL_SHOP', $stock_level_shop, true); $GLOBALS['debug']->debugMessage("The stock_level_warehouse is: ".$stock_level_warehouse); $GLOBALS['smarty']->assign('STOCK_LEVEL_WAREHOUSE', $stock_level_warehouse, true); When I said: "there might be more than one record where product_id is A and location_id is B", I fear you misunderstood. The following query illustrates my question: SELECT `stock_level` FROM `stock_levels` WHERE stock_levels.product_id = '11262' AND stock_levels.location_id = '1'; where 'A' is 11262 and 'B' is 1. But I will not pursue this any longer because, as you say, clearing the cache seems to clear out the stale data. By using the debugMessage() function, we will see the values being assigned to the Smarty template variables. If the source values are stale, we can eliminate Smarty as the cause, and start looking where the source variables become stale. With CubeCart's Debug mode enabled, these messages will appear just below the list of SQL queries.
  10. We managed to work around the immediate obstacles (basically, the web server timeout). With CubeCart's recent ability to "stream" a product's digital file, there is now a reasonable use case to accommodate large files. A "Feature Request" can be made in CubeCart's GitHub asking to re-code CubeCart to do this.
  11. I see, as a minimum, a few things that could be done to accommodate the outlier situation of wanting to offer super-huge downloadable files: eliminate the use of md5_file() function - it relies on reading the file from the disk change the CubeCart_filemanager 'filesize' column to "BIGINT 12" for all installations, make a strong detailed advisory at setup that there are practical limits to the number of products, filesizes, etc, that are based on real-world laws of physics that are associated with the server environment
  12. Please let us know the location of the link that was used to get to the Registration page (if it worked)? The Login/Register links seen on every page? Or when checking out? That determines which skin template has a hard-coded link that includes .html as part of the link. The link should look like: <a href="{$STORE_URL}/register{$CONFIG.seo_ext}" ...
  13. There is also another instance of using md5_file in the FileManager class, getFileInfo(). This is in a section of code where the product was given a digital path (as opposed to having had a file assigned to the product) to a file that exists somewhere on the server (near line 914). So, in this situation, a file not specifically 'assigned' to a product, but indicated in the digital path text entry field, when getting ready to deliver that file, there will be that 100 second dead time. Here's an interesting question you can ask your host: does your hosted environment use hard drives, or SSD storage drives?
  14. Here's an interesting conversation that answered quite a few of my questions about this: https://forums.phpfreaks.com/topic/313075-function-md5_file-limits/ If possible, please use phpMyAdmin to view the CubeCart_filemanager table directly. What does the filesize say? I just now looked at my CubeCart_filemanager table and I see that the 8GiB file has a reported filesize of "4294967295" -- which "4GiB - 1" bytes. The actual query (as recorded in my diagnostic trace) specified "9117468856" as the filesize -- which is just shy of 8.5GiB <- it's true size. So, let's look at the database table schema for CubeCart_filemanager. That column is declared for INT. The MySQL data type of "unsigned INT" can hold a maximum value of 4294967295. See: https://dev.mysql.com/doc/refman/5.7/en/integer-types.html I would say the next step is to alter the CubeCart_filemanager table, 'filesize' column to be a "unsigned BIGINT". You might also bump the column's schema attribute 'length' from 10 to 12.
  15. Do you have complete control of the server hosting your site? (dedicated or virtual) If so, what is the web server? Apache? Nginx?, Litespeed? Let's try to adjust the timeout setting of the web server to wait twice as long for PHP to process that 13GB file. As an aside, would you be willing to beta test something?
  16. I created an 8GiB zip file to test this situation. The web server waited 60 seconds (default) for PHP to respond, resulting in a 504 Gateway Time-out. (An error was logged in the web server's error log.) I see no evidence that PHP actually timed out (no error logged), and the database got the record inserted. My diagnostic tracing shows that the task completed successfully. Seeing as how long it took my system to calculate the MD5 hash for the newly discovered file (approx 70 seconds, even though PHP is set to have a max_execution_time of 60 seconds, and did not run out of memory -- max used 12.5 MB), I have to imagine that the machine running your site also took about that long. The database record for the newly found file is being built in the FileManager class, near line 297. Of concern is the PHP function md5_file(). I believe this is the culprit. "when i go to press the update file list the browser crashes" Was there a significant time delay between when you clicked on the Update File List tab and when the browser indicated an error? Or was it immediate? To solve this, not only must we (to be safe) increase PHP's max_execution_time, but also the web servers timeout setting to something longer - maybe 120 seconds?
  17. I thought that was the problem. PayPal acquiring a default parameter which then had CubeCart telling the template that this choice is to show as being pre-selected. You are saying the radio button for PayPal is still selected? Allow me to ask, after having made the edit to the PayPal file, are you simply having the browser re-fetch the checkout page? If so, we recommend that you empty the basket, followed by re-visiting the product page, and re-adding the product back into the cart. Then go to the checkout page.
  18. So we are still working on the Update File List problem. I also think we can eliminate the error message that was last mentioned as an indicator of what went wrong. The most recent versions of CubeCart keeps the debug results spooled in the session file, ready to unspool whenever CubeCart delivers a viewable page. This means that if CubeCart is set to have its debug mode enabled (admin, Store Settings, Advanced tab, Debug Mode enabled, and also your local IP address (www.showmyip.com) entered in the following text field), we can examine what was the last database query made, which will give us a clue as to where to focus our investigation. (I need to find a 13GiB zip file for further experiments.)
  19. Hmm. Looking through the PayPal Commerce code again, I find that in the module's file /hooks/class.cubecart.display_gateways.php, there is some code that sets $gateway[99] -- that is not related to 'position' -- to have a 'default' array element of true. You can change that to read: // 'default' => true
  20. I made an experiment on an installation that was given 256MiB memory, where I placed a 360MiB zip file in the /files/ folder, then had CubeCart Update File List. If any part of CubeCart were to read in that file to memory, I would expect a "Out of Memory" error. However, looking again the error message posted above, I now notice that "POST Content-Length" has been exceeded. In admin, PHP Info, scroll to the "core" table and find the 'post_max_size' value. Maybe it's 5000M? If the error message is to be believed, it seems there was an attempt to have the browser do the file upload of the 13GiB file (which was worked around by FTPing the file).
  21. These modules may have a setting called 'Position". If the Position setting is visible, you can enter a number where '1' is of a higher position in the list as compared to another module that has '5' as the position (for example). The PayPal Commerce module does not expose this setting, but rather it is present in the code. In PayPal Commerce file /skin/admin/index.tpl, near the bottom, is a series of <input type="hidden"> tags. One <input> has a name="module[position]" with a value of "1". Change this to a value of "99". See if the PayPal choice is now at the bottom of the list and is not pre-selected. There is also a module's setting to be the 'Default' choice, but I find nothing in the code that manages this setting. Therefore, I am curious about what you say that PayPal Commerce is 'pre-selected' in the radio-button list.
  22. For some reason, CubeCart is wanting to load into memory that 13GiB file, but the environment is set at 5GiB - thus running out of memory. So, we need to figure out why CubeCart wants to examine this file (possibly to create some sort of hash code based on the contents). Then try to convince CubeCart to not do this on large files.
  23. There is some questionable math, but nothing that using the cache would affect. Please let us know where $product['available_to_order'] is calculated.
  24. I don't see anything obviously wrong, but I need to ask this: In examining the database table 'stock_levels', do you find that there might be more than one record where product_id is A and location_id is B? Your query is asking for records with these WHERE conditions, then having the database engine sort on the column 'location_id'. The utility phpMyAdmin makes it easy to sort on multiple columns: sort first on product_id then on location_id and see if there is more than one of any of the combinations. However, again, with cache not being used, clearing the cache would have no effect at resolving this kind of scenario.
  25. Currently, you need to create one 'package' - usually as a zipped archive. Coincidentally, I've created a solution to have multiple downloadable files: one solution is as several files assigned to a product (as in an album of songs), and a slightly different solution as the ability to assign one distinct file to each of the several option combinations (as in a choice of flac or mp3 format). See: https://github.com/cubecart/v6/issues/2749
  • Create New...