X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Need help creating 2 different out of stock messages (https://forum.x-cart.com/showthread.php?t=47818)

Hallsons 05-29-2009 02:44 PM

Need help creating 2 different out of stock messages
 
Hello,

I am trying to edit the buy_now.tpl template so that I can display two different messages for whether a product is Out of Stock By Mail (but available at the physical location) or Sold Out (completely gone). I have a nursery business and we only ship certain plants seasonally, but most plants are still available at the nursery in the summer.

My thought was that if I enter a product quantity something like -99 then it would display the message Out of stock by mail, otherwise quantities less than or equal to zero would just give my standard Sold Out message. Or I could do it the flip side - enter some huge number like 9999 and if the quantity available is 9999 then display the message Out of stock by mail.

Anyone able to help me out with my if statements in the buy_now.tpl template? So far I haven't been able to parse it correctly to make it work.

TIA,

Chris

ARW VISIONS 05-30-2009 07:12 AM

Re: Need help creating 2 different out of stock messages
 
{if $products[product].avail le 99 and $products[product].avail gt 0}Out of Stock By Mail - Pick Up Only{elseif $products[product].avail le 0}Out of Stock{else}In Stock{/if}

amy2203 05-30-2009 07:28 AM

Re: Need help creating 2 different out of stock messages
 
do you still want people to be able to buy online and pick up? or if it's pick up only they have to purchase offline?

Hallsons 05-30-2009 09:13 AM

Re: Need help creating 2 different out of stock messages
 
Thank you for the suggestions.

I still want to be able to have people order some items as I ship some things year round. However there are a some items I only ship in the spring, others only in the fall.

What has happened is that our mainly mail order website is now being used locally (and surrounding states) for people to make choices, then they are coming here and buying them. Every once in a while someone places a local order for pick up, but most of the time they just show up with a list they put together from the website.

When an item is no longer available by mail I don't want to disable it, as we are still selling them here, so I wanted to have a message "available for pick up at the nursery only" or something along those lines, but if I am really sold out I want to have it say "Sold Out" or "Out of Stock". Other items will still be available by mail, though.

Hope that helps to clarify it, and I will think more about this here too.

Chris

gb2world 05-30-2009 09:36 AM

Re: Need help creating 2 different out of stock messages
 
It seems that setting an artificially large number for inventory levels will be a little messy if you ever what to track true inventory with your X-Cart database.

Instead, you could use a product extra field and set that to some value to indicate a product is available for pick up.

Another option is to use BCS Preorder/Backorder mod. I think you should be able to easily modify the backorder functionality to be the "available for pickup" functionality, but you could check with BCS.

Hallsons 05-30-2009 11:17 AM

Re: Need help creating 2 different out of stock messages
 
Yes, that might work to have an extra options field, however I know I would still get people placing orders and asking to have it shipped. As we all know, most people don't take the time to read the details. Then again, I might be able to backorder those orders until fall or the following spring...

I'll keep thinking about this.

Chris

gb2world 05-30-2009 12:32 PM

Re: Need help creating 2 different out of stock messages
 
You could use the product extra field (not an extra option field) to remove the add-to-cart button and replace it with your "product available for pick up" message. That way - customers would not be able to add the item to the cart. If you do that - I'd also suggest adding XCARTMODS X-Cart Direct Product Enquiry Form - so they have a way on the product page to contact you directly about that particular product if they have questions.

Hallsons 05-30-2009 03:17 PM

Re: Need help creating 2 different out of stock messages
 
Now I'm making a little progress. I set up an extra field with "Availability : Out of Stock by mail - may be available for pickup at the nursery." This will appear on the product details page IF I force the quantity to -999. If a product is less than or equal to zero it is out of stock anyway, but when I can no longer ship something I can force the quantity to -999.

However, how do I use this to remove the add-to-cart button? And how do I get it on the product listings when browsing categories?

gb2world 05-30-2009 03:52 PM

Re: Need help creating 2 different out of stock messages
 
There are lots of posts on the forum about how to customize the extra fields - it seems complex, but once you get the hang of it - the extra fields can be useful for lots of things. Try this thread for the changes you need to make to use the extra fields on product listing pages.

Hallsons 05-31-2009 06:52 AM

Re: Need help creating 2 different out of stock messages
 
Thanks, I have it working just fine on the product page, am lost when trying to modify the products template, and need to get back to my regular job now. I'll revisit this some other time when my head clears. I know this is really a lot easier than it should be, but for now I'm lost and need to just quit.

Thanks again.

Chris


All times are GMT -8. The time now is 04:36 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.