Forums / Templates, Stylesheets, Page Layout / custom inventory look

custom inventory look

Locked

Views: 2,969

Results 1 to 20 of 24
This thread is locked. New replies are disabled.
28 Aug 2006, 10:18 AM
#1
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

custom inventory look

i need to have a page that shows the inventory of one specific item but in a very large font

ie an ezpage with the sql query embedded that just i code the html around it

anyone point me in the direction of how to structure the sql query :)

28 Aug 2006, 7:39 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,870
Plugin Contributions:
19

Re: custom inventory look

a google search of "sql queries in php" yields this.

Is this your only product?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

28 Aug 2006, 7:53 PM
#3
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

Re: custom inventory look

re:only product - no but only have a few and its the main product

28 Aug 2006, 8:01 PM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,870
Plugin Contributions:
19

Re: custom inventory look

Is this specifically something NOT contained in the product description?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

28 Aug 2006, 8:47 PM
#5
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

Re: custom inventory look

no its just the products inventory

the idea is basically to have an ezpage showing a "counter" of how much stock is left on this one item - the counter being the inventory level with the font size or form style being very large

28 Aug 2006, 9:30 PM
#6
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,870
Plugin Contributions:
19

Re: custom inventory look

The "counter" is already there by default as the quantity. You could have a specific css file for that product's page to change the quantity font when that page is called.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

28 Aug 2006, 9:33 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,870
Plugin Contributions:
19

Re: custom inventory look

The CSS_read_me.txt in the includes/templates/template_default/css folder tells how you would name the special stylesheet.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

28 Aug 2006, 9:47 PM
#8
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

Re: custom inventory look

i´´m not worried about the size, i´´m trying to get the coding into a seperate, effectively static, page - ie an ezpage

ie something like this (very basic) that i can put into the contents of an ezpage

"Hurry we only have:

<div class"100pxfontsize"> <?php echo get stock level for product #id1?></div>

units of this product left"

29 Aug 2006, 1:03 AM
#9
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: custom inventory look

By search there is a topic about this, please refer to it.
PHP inside ezpages

.

A New Starter again

29 Aug 2006, 7:04 AM
#10
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

Re: custom inventory look

thanks but i still dont know how to pull the inventory data from the db and display it ;)

29 Aug 2006, 8:09 AM
#11
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

Re: custom inventory look

my product id is 1, but when i do this i get the sold out button but it definitly has stock - what am i missing ? :)

i think i have to define the product id somewhere to begin with ?

<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
  // do nothing
} else {
?>
            <?php
    $display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['1'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['1']) . '</p>' : '');
            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
              // hide the quantity box and default to 1
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('1', (int)$_GET['1']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            } else {
              // show the quantity box
    $the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['1'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['1']) . '<br />' . zen_draw_hidden_field('1', (int)$_GET['1']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            }
    $display_button = zen_get_buy_now_button($_GET['1'], $the_button);
  ?>
  <?php if ($display_qty != '' or $display_button != '') { ?>
    <div id="cartAdd">
    <?php
      echo $display_qty;
      echo $display_button;
            ?>
          </div>
  <?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->
29 Aug 2006, 8:42 AM
#12
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

Re: custom inventory look

ive nearly sussed it - ive added &product_id=1 to the end of the link and put product_id back in the code but i only get the add to cart button and not the quantity or buy now button!

arrgggghhhh

<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
  // do nothing
} else {
?>
            <?php
    $display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
              // hide the quantity box and default to 1
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            } else {
              // show the quantity box
    $the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            }
    $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
  ?>
  <?php if ($display_qty != '' or $display_button != '') { ?>
    <div align=center">
    <br /><br />
<table width="477" border="0" align=center cellpadding="4" cellspacing="0" bgcolor="#0000CC">
<tr>
<td class="whitetext">
<p align="justify">Hosting slots available: <?php
      echo $display_qty;
echo;
      echo $display_button;
            ?>
          </div>
  <?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box--></p></td>
</tr>
</table>
30 Aug 2006, 2:52 PM
#13
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

Re: custom inventory look

need this quite urgently now - ive put a commercial help request in as well

thanks

31 Aug 2006, 3:45 PM
#14
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

Re: custom inventory look

bump a

31 Aug 2006, 6:48 PM
#15
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,870
Plugin Contributions:
19

Re: custom inventory look

I'm way behind the power curve here with security updates for Joomla now. Let me know the specific id of the product in question and I'll see what I can do later today.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

31 Aug 2006, 6:53 PM
#16
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

Re: custom inventory look

product id is 1 ;) - honestly..

anything you can do would be great :)

(i used joomla on another site about 6 months ago and was able to hack something similar hence me wanting to do the same here but i had time then... )

1 Sep 2006, 5:33 PM
#17
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,870
Plugin Contributions:
19

Re: custom inventory look

Here's a copy of a file that will do what you want once you fill in the requirements. Adjust the text as you like. Add css where needed. Then you will need to call it from wherever in the site you want with an include.

<?php

  // Connect to the database server
    $dbcnx = @mysql_connect("###.###.###.###",
           "$$$$$$$", "%%%%%%%%%");
  if (!$dbcnx) {
    echo( "<P>Unable to connect to the @@@@@@" .
          "database server at this time.</P>" );
    exit();
  }

  // Select the @@@@@@@ database
  if (! @mysql_select_db("^^^^^^^") ) {
    echo( "<P>Unable to locate the @@@@@@@ " .
          "database at this time.</P>" );
    exit();
  }

?><P> Here is where you put the text you want associated with the call out.  FOR INFO--The ###.###.###.### is the host of your database(could be localhost, an IP address, etc).  The $$$$$$ is the database username.  The %%%%%%%% is the database password.  The @@@@@@ is the site name. The ^^^^^^^^ is the name of your database</P><BLOCKQUOTE>

<?php
   // Request the quantity of the product
  $result = mysql_query(
            "SELECT products_quantity  FROM products WHERE products_id=1");

  if (!$result) {
    echo("<P>Error performing query: " .
         mysql_error() . "</P>");
    exit();
  }


  // Display the quantity in a paragraph
  while ( $row = mysql_fetch_array($result) ) {
    echo(
	"<P>Better Hurry\! We only have <strong>" . $row["products_quantity"] . " left\!</strong></P>");
  }
?>

Sorry for the delay. 10G irons in the fire.

And... I'm sure there will be other suggestions.:D

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

1 Sep 2006, 5:47 PM
#18
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

Re: custom inventory look

wot a star :)

its friday night and have been at this site for 14 days straight so i´´m taking a bit of a siesta but will let you know tomorrow :)

top man

2 Sep 2006, 1:09 PM
#19
slingman avatar

slingman

New Zenner

Join Date:
Aug 2006
Posts:
30
Plugin Contributions:
0

Re: custom inventory look

i get this error :(

Error performing query: Table 'sling.products' doesn't exist

2 Sep 2006, 2:24 PM
#20
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,870
Plugin Contributions:
19

Re: custom inventory look

IF sling is your table prefix does it have an underscore instead of a period? Check with phpmyadmin to verify the table name.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com