Page 1 of 1

A few simple questions/changes

Posted: Wed Aug 13, 2008 8:57 am
by William_firefold
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

Re: A few simple questions/changes

Posted: Wed Aug 13, 2008 9:39 am
by mazhar
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

Re: A few simple questions/changes

Posted: Wed Aug 13, 2008 9:47 am
by Robbie@FireFold
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.

Re: A few simple questions/changes

Posted: Wed Aug 13, 2008 10:38 am
by evanb@firefold.com
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>

Re: A few simple questions/changes

Posted: Wed Aug 13, 2008 1:13 pm
by mazhar
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.

Re: A few simple questions/changes

Posted: Thu Aug 14, 2008 8:18 am
by evanb@firefold.com
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.

Re: A few simple questions/changes

Posted: Thu Aug 14, 2008 11:15 am
by mazhar
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

Re: A few simple questions/changes

Posted: Thu Aug 14, 2008 1:17 pm
by evanb@firefold.com
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