shopping cart in stock

Started by rbarbour on 7 Apr 2013, 10:31 AM · Views: 812

Results 1 to 5 of 5
7 Apr 2013, 10:31 AM
#1
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

shopping cart in stock

simply trying to add in stock to the shopping cart page

replace *** (out of stock) with (in stock) when product is available

client request, did this before but having a brain fart.

7 Apr 2013, 10:51 AM
#2
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: shopping cart in stock

figured it out :smile:

7 Apr 2013, 11:58 AM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: shopping cart in stock

Mind posting what you found for others that might find this thread later

Zen-Venom Get Bitten

7 Apr 2013, 2:12 PM
#4
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: shopping cart in stock

sure

first open /includes/templates/YOUR_TEMPLATE_NAME/templates/tpl_shopping_cart_default.php

add:

<th scope="col" id="scAvailabilityHeading"><?php echo TABLE_HEADING_AVAILABILITY; ?></th>

after:

<th scope="col" id="scUpdateQuantity"> </th>

then add:

<td class="scAvailability">
<?php
  if ($product['flagStockCheck'] == '') {
    echo '<span class="alertGo bold">' . TEXT_PRODUCTS_QUANTITY . '</span>';
  } else {
    echo '<span class="alert bold">' . $product['flagStockCheck'] . '</span>';
  }
?>
</td>

after:

       <td class="cartQuantityUpdate">
<?php
  if ($product['buttonUpdate'] == '') {
    echo '' ;
  } else {
    echo $product['buttonUpdate'];
  }
?>
       </td>

then create a file called
/includes/languages/english/extra_definitions/YOUR_TEMPLATE_NAME/shopping_cart_extras.php

add

<?php define('TEXT_PRODUCTS_QUANTITY', 'In Stock'); ?>

end result should add a column that shows *** or In Stock

you can change *** to Out of Stock in ADMIN > CONFIGURATION > STOCK

further customization can be done, see example below
[Attachment no longer available]

8 Apr 2013, 8:15 AM
#5
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: shopping cart in stock

Nice one rbarbour! Will come in handy one day...

Frank

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.