Add to Cart and Out of Stock on Mobile

Questions and answers about ShopSite Custom Templates

Add to Cart and Out of Stock on Mobile

Postby bravewink » Wed Dec 19, 2012 1:53 pm

I've changed the code for my products and more info pages to place an "out of stock.jpg" and remove the function to add to cart when the inventory quantity is zero.

I'd like to do this with the mobile version, but can't seem to figure it out.

It's been over a year since I coded the original and can't "exactly" remember what all I changed to get there, but I think I added something similar to this under the ADD TO CART section

Code: Select all
  [-- if PRODUCT.QuantityOnHand "0" --]
<img src="[-- OUTPUT_DIRECTORY_URL --]/media/out_of_stock.gif">
[-- else --]
[-- INCLUDE Product-AddToCartButton PROCESS --]
[-- END_IF --] 



I'm not seeing any "add to cart button process" or "add to cart" under products on the mobile templates.

Also, I'd like to use my custom Add to Cart Button instead of the mobile default.
bravewink
 
Posts: 6
Joined: Sat Feb 11, 2012 5:51 pm

Re: Add to Cart and Out of Stock on Mobile

Postby Jim » Wed Dec 19, 2012 5:32 pm

The current implementation of template code for mobile devices does not permit images to be used for buttons, they will always be text. So you might try changing the code from using an image to text for the Out of Stock.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Add to Cart and Out of Stock on Mobile

Postby bravewink » Thu Dec 20, 2012 4:02 pm

Using Text, I can get the "Out of Stock" to show up on the More Info Page, but not on the Regular Page.

I've change the following code on the Product Template (mb_MobileDefaultProduct.sst)

Code: Select all
Qty: <input type="text" size="3" value="1" name="[-- PRODUCT.RecordNumber --]:qnty">
#end if for subproducts --]
[-- END_IF --]
<input class="pr_add" type="submit" value="[-- STORE.MB_AddToCart --]">
</form>
</div>
[-- IF REVIEWS --]


to this and it works for the More Info Pages

Code: Select all
Qty: <input type="text" size="3" value="1" name="[-- PRODUCT.RecordNumber --]:qnty">
#end if for subproducts --]
[-- END_IF --]
[-- if PRODUCT.QuantityOnHand "0" --]
[Out of Stock]
[-- else --]
<input class="pr_add" type="submit" value="[-- STORE.MB_AddToCart --]">
</form>
</div>
[-- END_IF --]
[-- IF REVIEWS --]



I've tried similar methods of if/end if statements in the same line of the Default Cart Template (mb_MobileDefaultCart.sst) , but nothing seems to work to place the Out Of Stock Text

I don't see any thing in the Page Template (mb_MobileDefalut.sst) to change so I may get the desired results.

Thanks again.
bravewink
 
Posts: 6
Joined: Sat Feb 11, 2012 5:51 pm

Re: Add to Cart and Out of Stock on Mobile

Postby Jim » Thu Dec 20, 2012 4:14 pm

Did you do it in both the [-- Define Product --] and [-- Define MORE_INFO_PAGE --] sections? Also if you have subproducts you may need to do it there also.
What code do you have for the actual add to cart ?
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Add to Cart and Out of Stock on Mobile

Postby bravewink » Fri Dec 21, 2012 4:15 pm

AHHHH, thanks for the obvious heads up. Everything works as it should.

(I had the [Define Product] section highlighted in blue on my notepad to change it, but when I printed it off on my black and white printer, it didn't show up very well.)
bravewink
 
Posts: 6
Joined: Sat Feb 11, 2012 5:51 pm


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 8 guests