| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Adding text to products.tpl | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hi,
I would like to add text and appropriate links to the summary product template - customer/main/products.tpl Currently, the following is on this template, which states that a product is in stock and links to the product page: {if $config.General.unlimited_products eq "Y" or ($products[product].avail gt 0 and $products[product].avail ge $products[product].min_amount)}<a href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_p age}{if $featured eq 'Y'}&featured{/if}" class="pl2_is"><b><u>IN-STOCK:</u></b> Ships immediately</a>{/if}<br /> I would also like to add similar linked text for out of stock and on pre-ordered items. These are already on the individual product page - customer/main/product.tpl as follows: {if $product.preorder eq "Y"}<font style="font-size: 14px; color: #004488"><u>PRE-ORDER</u>: </font><font style="font-size: 12px;">Release Date: {$product.dvd_release_date|date_format:"%e %b %Y"}</font>{elseif $product.avail gt 0}<font style="font-size: 14px; color: #C21C20"><u>IN-STOCK</u>: </font><font style="font-size: 12px;">Ships immediately</font>{else}<font style="font-size: 14px; color: #008000"><u>OUT OF STOCK</u>: </font><font style="font-size: 12px;">Normally ships within 14 days</font>{/if}<br /> {if $product.preorder eq "Y"}{elseif $product.avail gt 0}<font style="font-size: 9px;">Guaranteed to Ship next Business Day.</font>{else} {/if}<br /> Can anyone advice on how to do this please? Thanks |
|||||||
#2
|
|||||||||
|
|||||||||
![]() I think you could use the same code just change it a bit.
place the entire code block it in products.tpl where ever you want it and where you see $product replace it with $products[product] haven't tested this tho
__________________
xcart 5.1.2 |
|||||||||
#3
|
|||||||
|
|||||||
![]() Thanks for the advice Ashley.
For in stock and out of stock items, it works perfectly. However, the preorder items are displaying as out of stock. This is the code I used: {if $products[product].preorder eq "Y"}<a href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_p age}{if $featured eq 'Y'}&featured{/if}" class="pl2_is"><b><u>PRE-ORDER</u>:</b> Release Date: {$products[product].dvd_release_date|date_format:"%e %b %Y"}</a>{elseif $products[product].avail gt 0}<a href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_p age}{if $featured eq 'Y'}&featured{/if}" class="pl2_is"><b><u>IN-STOCK</u>:</b> Ships immediately</a>{elseif $products[product].preorder ne "Y" || $products[product].avail eq "0"}<a href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_p age}{if $featured eq 'Y'}&featured{/if}" class="pl2_is"><b><u>OUT OF STOCK</u>:</b> Normally ships within 14 days</a>{/if}<br /> Can you please offer any further suggestions so that preorder items display as such, rather than as out of stock? The preorder items have a zero stock level. Thanks very much. |
|||||||
#4
|
|||||||||
|
|||||||||
![]() not sure right off hand. I'll have to try and figure this one out.
__________________
xcart 5.1.2 |
|||||||||
#5
|
|||||||
|
|||||||
![]() Thanks!
|
|||||||
#6
|
|||||||
|
|||||||
![]() Hi Ashley,
I'm still struggling with this one. Can I pm you? Thanks |
|||||||
#7
|
|||||||||
|
|||||||||
![]() Quote:
looks like you have custom coded for perorder.Are you sure you are getting value for $products[product].preorder as Y or N.Jus check this the conditions seems to be fine
__________________
MercuryMinds Technologies Development Team, Professional X-Cart Design, X-Cart Development, X-Cart Customization Services www.mercuryminds.com X-Cart Mailchimp Ecommerce 360 Plugin/integration module (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) Smasher, a smart search engine for x-cart store (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) One Page Checkout (OPC) - X-Cart module (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) |
|||||||||
#8
|
|||||||||
|
|||||||||
![]() that the problem. home.php is not getting the value but product.php is.
__________________
xcart 5.1.2 |
|||||||||
#9
|
|||||||||
|
|||||||||
![]() You mentioned that stock level for the preodered product is zero.
Then why dont you try this: {if $products[product].avail eq "0" or if $products[product].avail lt "0" } Enter your text here.. {/if}
__________________
MercuryMinds Technologies Development Team, Professional X-Cart Design, X-Cart Development, X-Cart Customization Services www.mercuryminds.com X-Cart Mailchimp Ecommerce 360 Plugin/integration module (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) Smasher, a smart search engine for x-cart store (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) One Page Checkout (OPC) - X-Cart module (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) |
|||||||||
#10
|
|||||||||
|
|||||||||
![]() how would I get that to be available to the product.tpl?
__________________
xcart 5.1.2 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|