bsandall

Member
  • Content count

    206
  • Joined

  • Last visited

  • Days Won

    11

bsandall last won the day on May 8

bsandall had the most liked content!

Community Reputation

13 Good

About bsandall

  1. Same here. I always recommend compressing the database backup with 7-zip, winzip, etc. and then using phpMyAdmin's import tool to run it - it's very fast and can handle a LOT of data.
  2. Thanks! I wrote it for my own use and figured I'd toss it up on GitHub. It's not a pretty interface and some of the product warnings aren't useful / entirely accurate, but it gets the job done. For the OP, it doesn't update stock levels, but with a little MySQL/PHP knowledge, it wouldn't be difficult to modify it to do so.
  3. I wrote a simple script that updates prices from .csv - I use it for my site all the time. If you have any questions about using it, ask away and I'll try to respond in a timely fashion.
  4. You could put it wherever you want, yes, provided you make sure to assign the customer group data to SMARTY before whatever page it is you want to display it on is loaded.
  5. Part of your problem may be that CubeCart doesn't by default share the customer group membership data with SMARTY, so the variable `$customer_membership` shouldn't even exist unless you have specifically set it yourself. Another issue is that fetching customer memberships would give you an array, not a single value, so it will never be equal to 2. This code will do what you need: // You can create a snippet for `class.cubecart.display_homepage` or just add this code // directly to `cubecart.class.php::displayHomePage()` around line 128: $GLOBALS['smarty']->assign('CUSTOMER_GROUPS', $GLOBALS['user']->getMemberships()); // Then add the following to your `content.homepage.php` template, probably right before the {if $LATEST_PRODUCTS} line {if isset($CUSTOMER_GROUPS)} {foreach from=$CUSTOMER_GROUPS item=group} {if $group.group_id == 2} <div class="small-12"> <p>Your message here</p> </div> {break} {/if} {/foreach} {/if}
  6. If that is the correct variable (I haven't checked), the reason it isn't working is because you are using an assignment operator instead of a comparison operator. In other words, you are telling the code to set the group_id to equal 1, rather than checking if it is equal to 1. One example of correct syntax is: {if $customer_membership.group_id == '1'} Note the double equals sign (==) - this is the non-strict comparison operator which will evaluate to true whether group_id is the integer 1 or the string '1'.
  7. Create a code snippet using the hook `class.cart.add.preredirect` and add the following code: <?php $category_id = $GLOBALS['db']->select('CubeCart_category_index','cat_id',array('product_id'=>$product_id,'primary'=>1)); if ($category_id) { $redirect_url = $GLOBALS['seo']->buildURL('cat', $category_id[0]); if ($redirect_url) { httpredir($redirect_url); } } ?> This will cause the page to redirect to the main category of the product any time a user adds it to the basket and avoids entirely the JS-powered auto-display of the side basket (though this basket can still be displayed if the user specifically clicks on it). Do note, however, that the script above does not elegantly handle the case where the user adds a product from any page other than the product page, for example if they added a product to their basket from the home page. Should be enough to get you started, though.
  8. So what you're saying is you're at the pub right now replying from your phone, right? Because it's around 11 pm in London right now.
  9. I've found I can edit my posts so long as it is right after I post it. If I wait too long or someone else posts in the same thread, the option to edit seems to become unavailable.
  10. You can always find where Smarty variables are assigned by doing a global search for them in your CubeCart directory. On Windows, for example, open a console in said directory and run: findstr /i /n /s /c:"CHECKOUT_BUTTON" *.* The output will look something like this: classes\cubecart.class.php:571: $GLOBALS['smarty']->assign('CHECKOUT_BUTTON', true); classes\cubecart.class.php:1702: $checkout_button = (CC_SSL) ? $GLOBALS['language']->checkout['secure_checkout'] : $GLOBALS['language']->checkout['checkout']; . . . Usually you will have to actually open the files and read the code around the lines mentioned, but in this case you can probably safely conclude that the language entries you need to change are under checkout.secure_checkout and checkout.checkout. Also, you can search for 'checkout' in the definitions.xml file - you will see entries in both the basket and checkout groups; I do not know whether both need to be changed or just the ones in the checkout group, and there may be others (I stopped looking).
  11. @Dirty Butter The reason I didn't make a GitHub issue originally is because I wanted to determine steps to replicate the issue, since it's nearly impossible to fix an issue that you can't replicate (as Al and any other developer can attest to). That said, good luck @Al Brookbanks - you've been on a roll lately! I suspect you haven't been sleeping as I see you online at odd hours of the night (your time).
  12. This was my option #1 if fixing the indexes didn't resolve it: It can easily be kept up-to-date after the initial calculation whenever an order is created, modified, or deleted, perhaps with a total recalculation on demand feature.
  13. This is what I use in my .htaccess file - put this right after enabling the RewriteEngine and setting the RewriteBase: # Require SSL SSLOptions +StrictRequire SSLRequireSSL SSLRequire %{HTTP_HOST} eq "yoursite.com" ErrorDocument 403 https://yoursite.com # Require SSL without mod_ssl RewriteCond %{HTTPS} !=on [NC] RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
  14. It looks like your database is missing some indexes - this could explain why your query is taking so long to run. Here are my results: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE S range cart_order_id_2,status,cart_order_id status 1 NULL redacted Using index condition; Using temporary; Using file... 1 SIMPLE O ref product_id,cart_order_id cart_order_id 56 S.cart_order_id 1 NULL 1 SIMPLE I eq_ref PRIMARY PRIMARY 4 O.product_id 1 NULL Note the key 'status' in the first row with a key_length of 1; also note that row 2 returns rows on a 1-to-1 basis, whereas yours returned 96 products. I recommend you go through each of your tables and compare them to CubeCart's database setup file. You may also be able to check the indexes from your Admin's Maintenance tab. By the way, running the actual query only takes 0.0053 seconds for me. Other options to consider if fixing your table indexes doesn't work: 1. Create a summary table (and regularly update it) containing a running tally of quantities sold so that the database doesn't have to actually SUM potentially tens of thousands of rows. This wouldn't be a bad idea for core CubeCart to implement. 2. If you have control over the server hardware, you could swap in an SSD drive to store the database on, increase RAM, etc. to improve query speeds. If you cannot manage the hardware, you may still be able to contact your host and see if they have better options for you. 3. Partition the table (look up table partitioning) so that there aren't such huge amounts of data to query against, especially since the Dashboard only cares about the most recent ones. I don't think this is actually a viable solution in your case, but it is a common practice when dealing with large amounts of data.
  15. By "disable the reCaptcha" do you mean you solved the challenge or you disabled reCaptcha in the admin side? If you disabled it via admin, did you clear the skin cache before trying to register? I've had issues with 6.1.7 and invisible reCaptcha, but once it is disabled everything works fine.