E-com DevBlog Spider-ball-vacuum

17Sep/080

Take product in/out of stock (adjust inventory)

Select "Operations - Find Inventory":

Enter a product name or the SKU (without the prd_):

Select the item SKU (the one without the prd_) and select “Adjust Quantity”:

Select “Decrease…” and enter a value equal to the current inventory to take it out of stock, or select “Increase…” and give it whatever value you wish to put it back in:

Print This Post Print This Post
2Jul/080

Import Explosions: how to calm the storm

So we recently started rebuilding our ProForm site (and by rebuilding I mean from the ground up...mostly), and lucky me I was placed on import duty. Well being the freakin' genius that I am I realized that .csv files for WorkoutWarehouse would likely work on Proform since we generally don't change them on the 6.0 stores (we tend to like to try to pretend we keep things standardized). So I grabbed me some WW goodness and commenced importing. I only had about 12 .csv files on me but it was enough to get a few products to test and build with.

Not long after the imports we noticed we couldn't add products to the shopping cart, we kept getting some bizzarre error saying that it couldn't resolve the product ID from the SKU.

MENTAL NOTE: when getting the aforementioned error check the "defining attributes"

I'd seen this error before on NordicTrack and I knew it has something to do with, you guessed it, the sku. However I was too involved in my own little world to do anything about it so Phil dug in and found that somehow our descriptive attributes from the .csv were placed in the wrong attributes section...instead they were placed as "defining attributes" which is bad because we all know that each defining attribute is a SKU. Once we deleted all defining attributes the products worked fine, however we were still stuck with the problem of what to do about the lousy imports that we would get should we try anymore .CSV's.

Turns out the answer is quite simple...there is a certain DTD (wcs.dtd) that needs to be defined to do what you want it to do and in our case on ProForm it was not defined so well. the trick here is to steal one you know works for the site you are on. Which brings me to the whole point of this post, all I really wanted to do was plaster this path somewhere else so when I run into this agian I have a better chance of stumbling onto a solution before it's too late. Sure I could go on about how to properly write a DTD and make it do what you want, but that would cut into my Reaper time?

the path you've all been waiting for, the path that contains all DTD's from WorkoutWarehouse to Proform and everything in Europe is:

\\wcdev\QIBM\UserData\WebSphere\AppServer\V6\ND\profiles\wcdev6\nulltemp\catalogimport

Print This Post Print This Post
29May/081

Awesome Image Evolution

So a while back, and by a while I mean about 3 months or so ago Marketing decided they'd like to show some eye catching images on some of the products on two of our sites...lucky me I got this task and at the time accomplished this the only way I could think of (and I'm not sure why it's the only thing I could think of). What I did was use Field 4 as a place holder for a phrase/word that would trigger an image to be shown if a proper word/phrase was in that field. The code looked quite similar to the following:

?View Code HTML4STRICT
<wcbase:useBean id="product" classname="com.ibm.commerce.catalog.beans.ProductDataBean" scope="request" />
 
<c:if test "${product.field4 == 'blah'}">
     <img src="blah"/>
</c:if>

While functional and handy for keeping any rougue phrases from triggering a false image this is not ideal, especially when your marketing group keeps adding more and more images to display...I think now we are up to around 8.
So about a month or so ago Phil got a task to add yet another image and while consulting about it we decided it would be better to change the code so that there weren't so many if's in our code. So we chaged it to the following:

?View Code HTML4STRICT
<wcbase:useBean id="product" classname="com.ibm.commerce.catalog.beans.ProductDataBean" scope="request" />
 
<c:if test="${product.field4 != ''}">
     <img src="<c:out value="${jspStoreImgDir}${product.field4}"/>.jpg" alt="<c:out value="${product.field4}"/>" />
</c:if>

This is much better because it allows us to put any value in field4 and then the code will strip that value and slap a .jpg on the end, so as long as we have a value.jpg image it will show up. However we did find a bug in this, apparently if you have had a value in field4 and deleted said value it confuses the code and websphere will still look for a .jpg image which of course is nowhere to be found, and if viewed in the wrong browser (ie IE) a missing image will appear (funny how missing images can appear). So recently we've changed this code yet again and this time I think we nailed it, have a look:

?View Code HTML4STRICT
<wcbase:useBean id="product" classname="com.ibm.commerce.catalog.beans.ProductDataBean" scope="request" />
 
<c:if test="${!empty product.field4}">
     <img src="<c:out value="${jspStoreImgDir}${product.field4}"/>.jpg" alt="<c:out value="${product.field4}"/>" />
</c:if>

The empty seems to ignore any previously entered values and focus on the fact that the field is empty and not so much look for a null value.

THE END

Print This Post Print This Post
17Mar/080

Change Pages in Accelerator (Dynamic Text)

So Ben has requested that we do this in all of our new 6.0 stores, and at one time or another we've all seen how dynamic text has helped save us time (replacing zingers, bugs, etc) and cut down on hard-coding in our jsp files. It also helps make our sites more internationally friendly (since our international team can just grab the localized text files and edit them for what they need :) ). So here we go, here is how to add some dynamic text into a page that you can then edit through accelerator.

To define the new dynamic text message for the store and the Change Pages page:

  • 1. Navigate to the following directory:
    * WC_eardir/Stores.war/WEB-INF/classes/ConsumerDirect
    * Cloudscape workspace_dir\Stores\WebContent\WEB-INF\classes\ConsumerDirect
  • 2. Open the storetext_dynamic_locale.properties file for editing.
  • 3. Insert the following text at the end of the file:
    # ShoppingArea/DiscountSection/DiscountDetailsDisplay.jsp
    Discount_Disclaimer = Some restrictions may apply. Discount cannot be combined with other offers.
  • 4. Save and close the file.
  • 5. Open the storetext_dynamic_labels_locale.properties file, located in the same directory, for editing.
  • 6. Insert the following text at the end of the file:
    # ShoppingArea/DiscountSection/DiscountDetailsDisplay.jsp
    DiscountDisclaimer = Discount disclaimer
    DiscountDisclaimer_Text =
  • 7. Save and close the file.
  • 8. Restart your WebSphere Commerce instance to load the changed properties files.

To add the option for setting the discount disclaimer text to the Change Pages page:

  • 1. Navigate to the following directory:
    * WC_eardir/Stores.war/WEB-INF/xml/tools/stores/ConsumerDirect/devtools/storefront
    * Cloudscape workspace_dir\Stores\Web Content\WEB-INF\xml\tools\stores\ConsumerDirect\devtools\storefront
  • 2. Open the StoreFront.xml file for editing.
  • 3. Add the following lines to the store-front-text element:
    
    
    	
    	
    		
    	
    	
    		
    	
    	
    
    
  • 4. Save and close the file.

Open your jsp file and where you want your dynamic text to appear, insert the following.

  • 1. <fmt:message key="Discount_Disclaimer" bundle="${storeDynamicText}"/>
  • 2. Save and close the file.

That should do it... please note that WordPress strips out all the formatting, so we lose all our nice tabbing, that explains why the code above looks so poor. The bulk of this post was taken directly from IBM's tutorial website, so if you get lost, go there.

Print This Post Print This Post
7Mar/080

Updating Struts

So we all remember that you only edit the struts-config-ext.xml file right (you don't edit the plain struts-config.xml because IBM constantly overwrites that file when you push updates etc.)? Wrong, to avoid spinning wheels and wondering why nothing is working (your view that is) make sure that you edit both struts-config-ext and struts-config-live. This also cuts down on brow-beating, dead-horse-beating, and all around sheepishness.

Print This Post Print This Post
18Feb/080

Dirty Auto-Eval of Rational in 561

So your compy has gone lag-happy, and it's all because of the auto syntax-error-warning checker and it's driving you nuts. Well no longer! Simply crack open your window->preferences and then scroll down to "Web and XML Files" expand that to "JSP Files", and then click on "JSP Annotations". On this click on warnings (over to the left) and un-check the show in text. That should fix your problems... Now code in peace, and enjoy!

561 Windows Preferences

Print This Post Print This Post