|
|
 |
I've created an easy-to-install tool for older stores to use to help block the recent SQL injection attacks, as well as future attacks that may be more specifically targeted or use other methods (hackers are very good at switching tactics as people fix their sites!) I will be releasing an update to version 6 shortly that will include this as well, just as a precaution against attacks (and to prevent error messages being generated by them) but if you don't tend to update your stores, you can use this tool on version 6 sites as well (or any other CF site you wish to use it with). This tool replaces the code changes listed in the earlier blog article, and can be found on my Downloads page.
Posted At : July 22, 2008 6:21 PM | Posted By : Mary Jo
Related Categories:
CFWebstore
A couple issues regarding CFWebstore have come up recently. You may have received an email regarding these issues, I am providing more information here to help detail the issues and what should be done, and to help reach anyone that may not have received an email or been on the email list where these have been discussed.
[More]
Posted At : June 23, 2008 2:41 PM | Posted By : Mary Jo
Related Categories:
CFWebstore
Here's a modification I had to make for a customer recently, that I thought others might find useful. Basically they needed to not only set different pricing for wholesale customers, they wanted to require them to purchase in bulk as well. But they also serviced normal retail customers as well, and wanted to not require any minimum purchase from them. CFWebstore has a function to require a minimum purchase amount as well as multiples of that amount (so you can force amounts like 6, 12, 18, etc.) but typically it applies to everyone. It's not hard however, to modify the store to make it apply to wholesalers only...you just have to know how! CFWebstore saves a setting to session memory for whether a user is a wholesaler or not, so you can easily use this variable in changing the code. Here's what you need to do:
First, go to the product/listings/put_orderbox.cfm file. This is where you will find the javascript validation routines that will warn the user about the quantity they are trying to buy. First, around line 152 find the line that determines and sets the minimum quantity that is required for this product. Change this line to read:
<cfset MinQuant = iif(qry_get_products.Min_Order GT 0 AND Session.Wholesaler, qry_get_products.Min_Order, 1)>
Now, open up shopping/basket/act_recalc.cfm. This file is where the shopping cart calculations are done and it will make sure that if the user has javascript turned off, or tries to manually edit the quantity, it will get rounded back to the necessary amounts. First change line 37 in the cfscript, which checks that the cart meets the minimum amount. The new line should read:
else if (Session.Wholesaler AND qry_Get_Basket.Min_Order GT 0 AND RowQuantity LT qry_Get_Basket.Min_Order)
And then change line 41 which checks for multiples of the minimum to read:
else if (Session.Wholesaler AND qry_Get_Basket.Min_Order GT 0 AND qry_Get_Basket.Mult_Min IS 1 AND RowQuantity MOD qry_Get_Basket.Min_Order GT 0) {
These changes will now ensure that wholesalers only need to buy in minimum amounts, but you may also want to tweak your product admin form where these amounts are entered (product/admin/products/dsp_price_form.cfm ) so that the merchant understands how they are being used.
Posted At : June 20, 2008 11:29 PM | Posted By : Mary Jo
Related Categories:
CFWebstore
Recently I was asked to look at a website for a company that was hosting a couple CFWebstores and looking to add another. They were concerned because the site was drawing so much database traffic and loading very slow. They saw what looked to be huge number of queries on the site and wanted to know if there was a bug or issue with the software that was causing it. It took only a quick glance to see what the problems were and how to easily address them. First, they were using the standard product templates for all the categories. It's important to note that when you use the standard product listing, a great deal of product information is included on the page, including all the product options and addons, pricing, review summary, etc. Each of these requires database calls to retrieve. I actually code the software to retrieve as much of this as possible in a single query, and then loop through it to output each, but there's still some that run for each product. To compound the problem, the user was not making good use of the "Maximum Product per Page" function so some pages were trying to output as many as 50 products with full detailed information. No wonder the database was getting taxed!
There are many ways to improve performance on your site, so you always want to evaluate how much information you are trying to show per page and see if there are better approaches. Try using the different listing methods: short, vertical, horizontal and gallery (some of these are not available in older versions, all are found in the current 6.3 release). You can change the listing method simply by entering it as a parameter on the category page down below the description. All of these alternate listings use much less information on the category page and thus are much faster and less taxing on the database. On the site I was reviewing, simply switching from the standard product listing to the short listing improved the average load time about four-fold.
Setting a maximum products per page is also a good idea if you have a lot of products per category, and more friendly for your users as well. You can add default settings in the Main Settings and override this if needed on a per-category basis. The fewer products per page, the faster your pages will load and overall you'll reduce load on the server. You can also set the store to Cache Products which will save product queries into server memory rather than having to get them from the database for every page hit. If you have control of your server, you may want to look into Trusted Cache which saves the CFML templates into memory and greatly improves load time as well (but can make updates to the code more tedious so only use if you are not actively working on your site).
Hope these tips help get your site running faster than ever!
Posted At : April 16, 2008 7:06 PM | Posted By : Mary Jo
Related Categories:
CFWebstore
CFWebstore allows you to set up shipping costs either globally, or on a per-product basis. If you enter a freight amount or an over-sized package dimension, it will use these instead of the usual shipping cost that would be calculated. But what if you want to simply add some additional amount to the cost of the shipping for that product? For instance, you want to use a calculated UPS rate but add an additional $1 to that cost for a specific product. Well, this is actually a very easy change to make...with the assumption that you don't have any products using freight as it is normally intended (as a cost that overrides normal shipping cost.) Simply open up the cfcs/shopping/checkout.cfc and find the GetCheckoutsVars method (around line 16). Look for the section that calculates the running totals for shipping (around line 89). You will find an 'if' statement for freight, followed by an 'else' statement for the other types of shipping. All you need to do is comment out the 'else' line like this: //else { and also comment out the ending bracket for this block as well, which appears here: //}
//end freight or not freight check Save your changes, and if necessary run the Refresh Cache option in the admin to reload the component into memory. Now the freight amounts you enter for products will be added to your shipping costs. You probably will also want to be sure to turn off the setting to display freight amounts in the Shipping Settings, so they just appear as part of the shipping costs, rather than as a separate line item.
Posted At : March 26, 2008 6:25 PM | Posted By : Mary Jo
Related Categories:
CFWebstore
CFWebstore has a lot of different settings that will allow you to do a really wide range of custom shipping methods. In version 6, even more options were added to custom shipping methods that improved the flexibility of options even more. Of course all the complexity does make things a bit more confusing so I thought a little example of one type of shipping setup might be helpful. If you have a particular shipping setup that is really complicated and difficult to set up, by all means let me know and I will try to help you get it configured...and maybe add it as another tutorial on this blog as well. But let's first take a look at a setup a recent customer needed.
[More]
Posted At : March 15, 2008 10:20 PM | Posted By : Mary Jo
Related Categories:
CFWebstore
The default WSIWYG editor used in CFWebstore comes with a variety of pre-configured CSS styles that you can use in your product layouts. These are taken from the default.css style sheet included with the software. But what if you use another style sheet or want to add some additional style to the editor when adding product descriptions? It's actually very easy to do!
First, you will need to make sure that the editor is using your personal style sheet, if you are not using default.css. Go to customtags/fckeditorV2/ and open up the fckconfig.js file in a text editor. Around line 31 you will find the style sheet configuration, just change it to use your store's css file instead.
Now we just need to add our styles to the FCKEditor Style definition page. You will find this in your store's css directory, fckstyles.xml. Open up this file in a text editor. You will see a basic XML definition of the styles used by the editor. For each style you add, you'll need to give it a name that it will appear as in the WSIWYG styles list, the type of tag it is (span, div, etc.) and then define the actual attributes that will be used. In most cases, if you have defined the style in your style sheet, you would use "class" or "id" here, but you can also put a full list of attributes that will be created if you want to add styles here that are not in your css file. As an example, if you want to add a style that will wrap a span tag using the class "myspan" and you're going to call this "My Span" in the editor, you would add the following code to the XML file:
<Style name="My Span" element="span">
<Attribute name="class" value="myspan" />
</Style>
Adding new styles to the editor can be really helpful when creating custom product descriptions, so don't miss out on this great feature!
Posted At : March 14, 2008 2:58 PM | Posted By : Mary Jo
Related Categories:
CFWebstore
Did you know that CFWebstore comes with a ColdFusion scratch pad that you can use for testing code? This is a great little tool for trying out code that you don't want to actually implement into the fusebox structure. Let's say you want to check out a new web service. Open up test.cfm in the top-level directory and paste in your code for calling the service, plus any debug or output code you need. Save the file and then call the scratch pad from your website using the format:
http://www.yoursite.com/index.cfm?fuseaction=home.test
[More]
Here's some exciting news for CFWebstore users that want to run their own servers, be it VPS or dedicated. New Atlanta has announced that later this year they will be making the BlueDragon/J2EE version of their server open source. The latest versions of CFWebstore are fully compatible with this server, and should run flawlessly on it. What does this mean for you? Well, it means that you can purchase a VPS or dedicated server from any hosting company that you want to use, install a J2EE server like JBoss, install the open source BlueDragon server on it, along with a database server (like MySQL which is also open source), unzip CFWebstore and setup your datasource, etc. and away you go! Considering the licensing change with CF8 that made a VPS even more expensive than before, and the availability of other free web application scripting languages like PHP, Ruby, JSP, ASP.Net, etc. this is a really exciting advancement for the ColdFusion platform, and will certainly have a lot more people looking at NewAtlanta's offerings as well. Read more about it here:
New Atlanta News
and here:
Vince Bonfanti's Weblog
Posted At : March 7, 2008 10:35 PM | Posted By : Mary Jo
Related Categories:
CFWebstore
CFWebstore includes two different types of PayPal integration: PayPal Standard which is the original PayPal transaction method which redirects the customer to the PayPal site at the end of the checkout process, completes the payment on their site and uses IPN behind the scenes to finish the order. The newer PayPal checkout is PayPal Pro. This includes a PayPal transaction method that behaves similar to a normal gateway where the customer stays on your site and completes a credit card order from your checkout area. However, PayPal also requires that merchants that use PayPal Pro include PayPal Express integration. This is a payment method where the customer leaves your site at the beginning of the checkout process, selects their address and payment method at PayPal, and then returns to your site to complete the order. Both have their advantages and disadvantages both for the user and for the merchant. Customers that are regular PayPal users like not having to re-enter their address and payment information, but it may be confusing to some customers to leave and then return to the site. For merchants, it has the disadvantage of hiding all the billing address information, but Express has shown to be more reliable for most as it does not have the same possibility of a payment at PayPal completing, but nothing returning to your site. So many merchants that use Standard have considered switching to using Express for the better experience for the customer and greater reliability. So in this article, I'll show you how you can do this on version 6 of CFWebstore.
[More]
More Entries
|
|
|
|
|