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
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
18Feb/080

Using Accelerator Fields to set Images on Product Displays.

So you've got a marketing "genius" who would like to place variable images on various products throughout the website. This can be quite simply done with the use of a bean. You can use the "com.ibm.commerce.catalog.beans.ProductDataBean" to get the field information at the product level.

Simply declare your bean:
<wcbase:usebean id="product" classname="com.ibm.commerce.catalog.beans.ProductDataBean" scope="request"></wcbase:usebean>

Then wherever you need to access a field on the page you can call the bean and field like so:

<c:if test="${product.field4 == 'EXCLUSIVE'}">
<div><img src="<c:out value="${jspStoreImgDir}" />Exclusive.jpg" alt="Internet Exclusive" /></div>
</c:if>

Per the above example any product with the word "EXCLUSIVE" in field 4 will display the "Exclusive.jpg" image.

You can also use this logic in a choose statement and display different images.

e.g.

<c:choose>
<c:when test="${product.field4 == 'EXCLUSIVE'}">
<div><img src="<c:out value="${jspStoreImgDir}" />Exclusive.jpg" alt="Internet Exclusive" /></div>
</c:when>
<c:when test="${product.field4 == 'INTRODUCTORY OFFER'}">
<div><img src="<c:out value="${jspStoreImgDir}" />IntroOffer.jpg" alt="Introductory Offer" /></div>
</c:when>
<c:otherwise>
<div><img src="<c:out value="${jspStoreImgDir}" />Sale.jpg" alt="Sale" /></div>
</c:otherwise>
</c:choose>

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