| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Related Products: Don't show link if out of stock? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Related Products: Don't show link if out of stock?
I have discovered that a related product link is still displayed even if the related product is out of stock, regardless of whether the 'Disable products which are out of stock' box is checked. If the customer clicks one of these links they get an error if the product they are trying to find is out of stock / disabled. I think there needs to be a 'product_available = Y' check somewhere in the related_products.tpl before displaying the link but don't know the correct syntax.
Basically, what I want to do is.. If product is in stock display link or else do nothing. Any help here would be appreciated.
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
#2
|
|||||||
|
|||||||
Strange....I would have assumed X-Cart would have set it up to disable out of stock related and recommended products. Might want to open a ticket with them to address this...
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||||
|
|||||||||
If the related product is 'Available for Sale' and the 'Quantity in stock' = 0 the link is there on the Product page. If the related product is 'Disabled' the Related Products link disappears. I could just set all products with 'Quantity in stock = 0' to 'Disabled', but then I would have to remember to enable them again once stock is replenished.
Isn't there some query to check if the quantity in stock is greater than 0 so that I could add an 'if' statement to the related_products.tpl to determine whether to display the link or not? What I am looking for is the syntax of this query.
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
#4
|
|||||||
|
|||||||
{if $product.avail gt 0}
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||||
|
|||||||||
Thank you but I think that will just check to see if the original product >0, not the related product. Look at the related_products.tpl and we see it loops, looking at '$product_links[cat_num].productid' (of which, $product_links seems to be assigned by related_products.php).
Code:
I opened a ticket with Xcart.
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
#6
|
|||||||||
|
|||||||||
X-cart made a new related_products.php file that doesn't show products that are out of stock (provided 'Disable products which are out of stock' is checked). I assume this available to anyone in the files section of the Help Desk, and it doesn't look like they charged me any points either.
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
#7
|
|||||||||
|
|||||||||
Here is what X-cart sent me, and it seems to fix the problem... a new related_products.php. I assumed they would have the file available to everyone, but apparently not.
Code:
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
#8
|
|||||||||
|
|||||||||
Re: Related Products: Don't show link if out of stock?
Can anyone advise how you might be able to show whether a product in 'related products' is in or out of stock?
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World - Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com) X-Cart Version 4.1.10 |
|||||||||
#9
|
|||||||||
|
|||||||||
Re: Related Products: Don't show link if out of stock?
Using the 4.1.x versions of x-cart, related products will not be shown if they are out of stock by default. To show the out of stock products it is necessary to leave the 'Disable products which are out of stock' option unchecked in the general settings/appearance options of the admin section.
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
|
|||
X-Cart forums © 2001-2020
|