Jump to content

JCHH

Member
  • Posts

    6
  • Joined

  • Last visited

Everything posted by JCHH

  1. Sorry another update... I'm stuck here for now but basically using the widgetOutput(''), I had it output a html button based on the same concept as above, elseif ($get=="qty") { if($qty >=1) { widgetOutput('<a href="https://whmcs_url.com/cart.php?a=add&pid=11" class="btn btn-danger btn-xs" role="button">Deploy Now</a>'); } else { widgetOutput('<a href="#" class="btn btn-danger btn-xs disabled" role="button">Out Of Stock</a>'); } } Here's my issue though, I need the href link to be dynamic and I can't figure out how to do that. I tried using this, which didn't work. Changing around ' and " would cause the entire thing to stop working, so this is basically where I'm stuck on for now. Any additional help would be great, thank you! elseif ($get=="qty") { if($qty >=1) { widgetOutput('<a href="{$systemUrl}cart.php?a=add&pid={$pid}" class="btn btn-danger btn-xs" role="button">Deploy Now</a>'); } else { widgetOutput('<a href="#" class="btn btn-danger btn-xs disabled" role="button">Out Of Stock</a>'); } }
  2. Just another update-- I managed to set it to change the text of the button depending on if it's in stock or not, but I'm still not sure how I can disable the actual button so it can't be clicked if out of stock. I'm also not sure if this is the right way to do it but it works in terms of changing the text. elseif ($get=="qty") { if($qty >=1) { widgetOutput('Buy Now'); } else { widgetOutput('Out Of Stock'); } }
  3. I think it'd be ideal for the feed generate the button based on the stock # of the PID, but I can't quite figure out how to do that. Right now, my stock.php feed is just the productsinfo.php but with this bit added in. How do I make an if condition to check the quantity and output a corresponding button depending on if the stock is >= 1? elseif ($get=="qty") { widgetOutput($qty); Thanks!
  4. Thank you for your response. Here is what's on my website as of now, they're just static buttons that I manually change every time there's a change in stock. Out of stock button <a href="#" class="btn btn-danger btn-xs disabled" role="button">Out Of Stock</a> Buy Now button <a href="whmcs_order_link" class="btn btn-danger btn-xs" role="button">Buy Now</a> I'm not really an expert so I'm not sure how to proceed in making them dynamically change. Thank you in advanced!
  5. I am trying to figure out how to dynamically change the "Buy" button on my website to "Out of stock" when WHMCS reports 0 stock for a particular PID. I am, at the moment, using the following guide to pull the stock number from the WHMCS data feed. https://whmcs.community/topic/304174-display-stock-status-on-an-html-front-page Now that only gets me the # of stock available, but I want to be able to have my website change the button text to "Out of stock" and disable the button if the stock shows "0". Could someone help me with this? Thanks in advanced!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated