A few simple questions/changes

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

A few simple questions/changes

Post by William_firefold » Wed Aug 13, 2008 8:57 am

I have a couple of small fixes that I need some help with.

Image

In the green box:
We need this to show only when the item is in stock. When the item is out of stock, this should go away to prevent customers from getting confused. It should be a simple if/else but we dont know where to put it.

In the red box:
We just need to take this part out. Both lines. The first line is extra info, and the second line doesn't convey any new info.

Any info or fixes for this are much appreciated.
Thanks

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: A few simple questions/changes

Post by mazhar » Wed Aug 13, 2008 9:39 am

In the green box:
We need this to show only when the item is in stock. When the item is out of stock, this should go away to prevent customers from getting confused. It should be a simple if/else but we dont know where to put it.
This can be done with some NVelocity Code. Edit the ShowProduct1 scriptlet and locate the following line

Code: Select all

[[ConLib:BuyProductDialog]]
and put the following code just beneath it

Code: Select all

#if($Product.InStock > 0 )
Your Custom Message or html will be here
#end

Robbie@FireFold
Commodore (COMO)
Commodore (COMO)
Posts: 433
Joined: Wed May 28, 2008 9:42 am
Location: Concord, NC
Contact:

Re: A few simple questions/changes

Post by Robbie@FireFold » Wed Aug 13, 2008 9:47 am

I fixed the 'red' bug.

Gotta be careful when adding rows. If you click add row - and then click save without entering information.. you get 0 on 0.
Robbie Hodge
General Manager
Robbie@FireFold.com
http://www.FireFold.com

evanb@firefold.com
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Mon Jul 21, 2008 3:45 pm

Re: A few simple questions/changes

Post by evanb@firefold.com » Wed Aug 13, 2008 10:38 am

Thank you Mazhar, I tried the code but nothing seems to be displaying.

Code: Select all

<tr>
     <td>
     [[ConLib:BuyProductDialog]]
     </td>
</tr>
<tr>
     <td>
     #if($Product.InStock > 0)
     <span style="font-weight:bold;">Ships Same Day</span>
     #end
     </td>
</tr>
<tr>
     <td>
     #if ($Product.ManufacturerId != 0)
     Other products by <a href="Search.aspx?m=$Product.ManufacturerId">$Product.Manufacturer.Name</a>
     #end
     </td>
</tr>

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: A few simple questions/changes

Post by mazhar » Wed Aug 13, 2008 1:13 pm

First Make sure from the merchant side that from the store configurations that Enable Inventory Management option is checked and and also for the product you are using for testing has the optoin Inventory Tracking: Track Product and some positive InStock value.

if this doesn't work then Make sure that you are editing the right scriptlet. Navigate to the store side and and go to the product details page and then edit the Show Product Page 1 scriptlet in browser and check weather it contains the newly added code or not, i mean the if statement.

evanb@firefold.com
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Mon Jul 21, 2008 3:45 pm

Re: A few simple questions/changes

Post by evanb@firefold.com » Thu Aug 14, 2008 8:18 am

Thank you, that suggestion works 100%.

One last question regarding this matter:

We do not track inventory on some products, and we'd like our message to display on those pages. On the items that we DO track inventory we'd like to call the function which you've helped me with thus far.
Last edited by evanb@firefold.com on Thu Aug 14, 2008 1:37 pm, edited 1 time in total.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: A few simple questions/changes

Post by mazhar » Thu Aug 14, 2008 11:15 am

You can check the inventory mode id to check wheather the Inventory is off or not. InventoryModeId is equal to 0 means it is off 1 for track the product and 2 for variants. So a check that should only execute when inventory is off could be as below

Code: Select all

#if($Product.InventoryModeId == 0 )
Inventory Off
#end
Last edited by mazhar on Mon Oct 20, 2008 10:58 am, edited 1 time in total.

evanb@firefold.com
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Mon Jul 21, 2008 3:45 pm

Re: A few simple questions/changes

Post by evanb@firefold.com » Thu Aug 14, 2008 1:17 pm

Thanks, I took what you said and got it to work with this:

Code: Select all

#if($Product.InventoryModeId == 0)
<span style="font-weight:bold;">Ships Same Day</span>
#end
#if($Product.InventoryModeId == 1)
     #if($Product.InStock > 0)
     <span style="font-weight:bold;">Ships Same Day</span>
     #end
#else
#end
If someone wants a message to display when the stock quantity is 0, then this:

Code: Select all

#if($Product.InventoryModeId == 0)
<span style="font-weight:bold;">Ships Same Day</span>
#end
#if($Product.InventoryModeId == 1)
     #if($Product.InStock == 0)
     <span style="font-weight:bold;">Out of stock</span>
     #end
     #if($Product.InStock > 0)
     <span style="font-weight:bold;">Ships Same Day</span>
     #end
#else
#end

Post Reply