Jump to content

Auto instock update Mod with extras


Recommended Posts

okay, here it is - let me know if you have problems - I'll try to help

Make sure you start with the install.txt file

instockmod_fr_fx_plus_albert_fix.zip

not for one thing or the other, but why isn't this update 'verion' in the download area?

that would save a lot of topic reading and frustations

just my $0.02 as a newby :D

Link to comment
Share on other sites

  • Replies 161
  • Created
  • Last Reply

Top Posters In This Topic

Guest cyber63

hi all :on2long:

excuse my language, but i'm french :lol:

i try to implemented in instock_mod

stock by option----

product1/option1 = value1

product1/option2 = value2

product1 = value1 + value2

i'm not a expert :D

i post my work if i finish and if you want ;)

if you have a idea ..... thk thk

cubecart is soooooo gooooodddd

Link to comment
Share on other sites

  • 3 weeks later...
Guest carasel

Before I install this, what version of cart was it compatible with? No where have I seen the version of cart.... :rolly:

just wondering...

Thanks ahead of time,

Marie

Link to comment
Share on other sites

Guest readitag

This is compatible with cube cart 2.0.0 and following. There are different instructions for the different versions. Look for them in install.txt.

Good luck.

Link to comment
Share on other sites

Guest sakwoya

Hi all

Well I've been struggling with this mod for what feels like an age. I've now done a clean install of Cubecart and overwritten all the files using the zip file provided on the previous page on this forum.

The prolem appears to be to do with writing to the 'instock' value in the MySQL database.

e.g.

If I create a new stock item and give it any quantity value it will always revert to the 'instock' default value in the database and then fail to decrease if I buy any items.

If I manually edit the stock item after creation then I can change the stock value from teh SQL default to my own - but, again, this will not decrease in line with sales.

All other aspects of the mod are working fine.

The system is running on a home PC under Windows with latest win 32 versions of MySQL and PHP - if that helps.

Graeme

Link to comment
Share on other sites

Guest sakwoya

Ok I've got it running correctly - the bundled php files in the previous post was lacking secure.php or secure.txt.

One you locate secure.txt from wildbill's original zip file use that - but also check back a few pages on this thread to find two errors corrected by somebody else (a missing "}" and an extra ";"

This was why the inventory total was not working for me.

There is also a problem in add_product.php in that it fails to update the value of $instock in the sql table - if you look at arount line 323 there is an sql insert command? It's missing references to instock so you'll need to change it to:

$sql_insert = "insert into ".$prefix."store_inventory (product, quantity, description, image, price, title, cat_id, sale_price, instock) values ('$product', '$quantity', '$description', '$userfile_name', '$price', '$title', '$cat_id', '$sale_price', '$instock')";

Graeme

Link to comment
Share on other sites

Guest Nimrod

Thank you so much for posting this information.

I've been battling with this problem for the past few days and have finally got this mod to work thanks to your posting.

Thanks too to the original designer, Wild Bill, and those who have posted the other adjustments and corrections in earlier posts. This has made all the difference for me in deciding whether or not to buy Cube Cart because I sell mainly one off items and there would be all hell to pay if I sold the same item to more than one person.

Link to comment
Share on other sites

Guest GuillaumeF

I have a problem !

The stock is always the value of default (SQL) !!!

I must edit the product to put the correct value of stock.

My code add_product.php :

<?php

/*************************************************************************** 

*   File Info: admin/add_product.php 

*   Purpose:   Add Product 

*   Updated:   31/07/2003 

****************************************************************************   

*   Developer: Alistar Brookbanks (Brooky.com) 

*   Copyright: (C)2003 http://www.brooky.com

*	Copyright: (C)2003 http://www.cubecart.com

*   This program is not "free" software and restrictions apply! 

*   Further Info: http://www.cubecart.com/license.php

*   Contact [email protected] if any conditions are not clear. 

*

*   Licensees holding valid "CubeCart Licence Number" may edit

*   the (powered by CubeCart) from browser title and "Powered by CubeCart"

*   and "(c) Brooky.com" from the web page footer.

*

*   This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING

*   THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR

*   PURPOSE. This and all others in the download package can only be

*	redistributed with written permission from Alistair Brookbanks!

*

*   The "CubeCart License" is available to purchase at

*   https://secure.cubecart.com/

*   For pricing please contact us via e-mail at [email protected] 

***************************************************************************/



/*************************************************************************** 

*   Modified to allow custom product numbers by BrJones33;) Cheers Dude!  

****************************************************************************/

session_start();



// if session is not registered redirect to login

if (!session_is_registered("admin"))

  {

    header("Location: login.php"); 

  }

// if session is registered continue

if(session_is_registered("admin")){

include ("config.php");

include ("settings.inc.php");

include ("../images/makethumb.txt");

include_once ("header.inc.php");

echo "<h2>$la_add_prod</h2>";



// see if categories are present

	$sql_count = "select * from ".$prefix."store_category";

	$result_count = mysql_query ($sql_count);

	$total = mysql_num_rows($result_count);

if ($total==0)

{

	echo "<div align=center><a class=MainLink href='add_category.php'>$la_add_cat_title</a></div><p align=\"center\">$la_no_prod_no_cat<p>";

include ("footer.inc.php");

exit;

}

// if submit has not been clicked

if (!$submit){



echo "<FORM ENCTYPE=\"multipart/form-data\" ACTION=\"add_product.php\" METHOD=\"POST\">

<table align=center width=\"600\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

            <tr><td bgcolor=\"$colour_2\">

<table width=\"100%\" align=\"center\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\">

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_title</b></td>

    <td width=\"400\" valign=\"top\"><input class=\"textbox\" type=\"textbox\"  name=\"title\"><font color=\"990000\"><b>*</b></font></td>

  </tr>

  <tr bgcolor=\"$colour_3\">

	<td width=\"200\" valign=\"top\"><b>$la_prod_stock</b></td>

	<td width=\"400\" valign=\"top\"><input class=\"textbox\" type=\"textbox\"  name=\"prodnum\"></td>

	</tr>

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_description</b><br>$la_html_tip</td>

    <td width=\"400\" valign=\"top\"><textarea name=\"description\" cols=\"40\" rows=\"8\"></textarea></td>

  </tr>

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_category</b></td>

    <td width=\"400\" valign=\"top\">";



// Build drop down menu for full category!

	print "<select  name=\"cat_id\"><option value=\"none\">$la_please_choose</option>";

	$select = mysql_query("select * from ".$prefix."store_category");

	while ($row = mysql_fetch_array($select))

      {

          $cat_id_dd = $row["cat_id"];

    

	echo"<option value=\"$cat_id_dd\">";

	$cat_full_name = $row["cat_full_name"];

    $category = $row["category"];

    $catfatherid_1 = $row["cat_father_id"];

  

        $t1 = $category;



        if ($catfatherid_1 <> 0)

        {

             $sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_1";

             $result1 = mysql_query ($sql_lowercat);

             $row1 = mysql_fetch_array($result1);

             $catfatherid_2 = $row1["cat_father_id"];

             $catname_2 = $row1["category"];

             $t2 = $catname_2;

             $catid2 = $catid_2;

        }



        if ($catfatherid_2 <> 0)

        {

             $sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_2";

             $result1 = mysql_query ($sql_lowercat);

             $row1 = mysql_fetch_array($result1);

             $catfatherid_3 = $row1["cat_father_id"];

             $catname_3 = $row1["category"];

             $t3 = $catname_3;

             $catid3 = $catid_3;

        }



        if ($catfatherid_3 <> 0)

        {

             $sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_3";

             $result1 = mysql_query ($sql_lowercat);

             $row1 = mysql_fetch_array($result1);

             $catfatherid_4 = $row1["cat_father_id"];

             $catname_4 = $row1["category"];

             $t4 = $catname_4;

             $catid4 = $catid_4;

        }



        if ($catfatherid_4 <> 0)

        {

             $sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_4";

             $result1 = mysql_query ($sql_lowercat);

             $row1 = mysql_fetch_array($result1);

             $catfatherid_5 = $row1["cat_father_id"];

             $catname_5 = $row1["category"];

             $t5 = $catname_5;

             $catid5 = $catid_5;

        }



        if ($catfatherid_5 <> 0)

        {

             $sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_5";

             $result1 = mysql_query ($sql_lowercat);

             $row1 = mysql_fetch_array($result1);

             $catfatherid_6 = $row1["cat_father_id"];

             $catname_6 = $row1["category"];

             $t6 = $catname_6;

             $catid6 = $catid_6;

        }



        if ($catfatherid_6 <> 0)

        {

             $sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_6";

             $result1 = mysql_query ($sql_lowercat);

             $row1 = mysql_fetch_array($result1);

             $catfatherid_7 = $row1["cat_father_id"];

             $catname_7 = $row1["category"];

             $t7 = $catname_7;

             $catid7 = $catid_7;

        }

  

  if ($catfatherid_7 <> 0)

        {

             $sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_7";

             $result1 = mysql_query ($sql_lowercat);

             $row1 = mysql_fetch_array($result1);

             $catfatherid_8 = $row1["cat_father_id"];

             $catname_8 = $row1["category"];

             $t8 = $catname_8;

             $catid8 = $catid_8;

        }



  if ($catfatherid_8 <> 0)

        {

             $sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_8";

             $result1 = mysql_query ($sql_lowercat);

             $row1 = mysql_fetch_array($result1);

             $catfatherid_9 = $row1["cat_father_id"];

             $catname_9 = $row1["category"];

             $t9 = $catname_9;

    

        }





if ($t9)

print "$t9/";

if ($t8)

print "$t8/";

if ($t7)

print "$t7/";

if ($t6)

print "$t6/";

if ($t5)

print "$t5/";

if ($t4)

print "$t4/";

if ($t3)

print "$t3/";

if ($t2)

print "$t2/";

if ($t1)

print "$t1/";

unset($t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$catfatherid_1,$catfatherid_2,$catfatherid_3,$catfatherid_4,$catfatherid_5,$catfatherid_6,$catfatherid_7,$catfatherid_8,$catfatherid_9,$catname_1,$catname_2,$catname_3,$catname_4,$catname_5,$catname_6,$catname_7,$catname_8,$catname_9);

    echo"</option>";}

    echo"</select><font color=\"990000\"><b>*</b></font></td>

  </tr>";

    echo"<tr bgcolor=\"$colour_3\">

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_instock</b></td>

    <td width=\"400\" valign=\"top\">&nbsp;&nbsp;<input class=\"textbox\" type=\"textbox\"  name=\"instock\"><font color=\"990000\"><b>*</b></font></td>

  </tr>";

  //<tr bgcolor=\"$colour_3\">

  //  <td width=\"200\" valign=\"top\"><b>$la_quantity</b></td>

  //  <td width=\"400\" valign=\"top\"><input class=\"textbox\" type=\"textbox\"  name=\"quantity\"><font color=\"990000\"><b>*</b></font></td>

  //</tr>

  echo"<tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_norm_pri</b></td>

    <td width=\"400\" valign=\"top\">$currency<input class=\"textbox\" type=\"textbox\"  name=\"price\"><font color=\"990000\"><b>*</b></font></td>

  </tr>

 <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_sale_pri</b></td>

    <td width=\"400\" valign=\"top\">$currency<input class=\"textbox\" type=\"textbox\"  name=\"sale_price\"><br>$la_leave_empt_no_sa</td>

  </tr>

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_upload_im</b></td>

    <td width=\"400\" valign=\"top\"><input name=\"upload_image\" type=\"checkbox\" value=\"yes\">$la_upload_checked</td>

  </tr>

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_image</b></td>

    <td width=\"400\" valign=\"top\"><INPUT class=\"file\" NAME=\"userfile\"  TYPE=\"file\">$la_prod_types</td>

  </tr>

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\">&nbsp;</td>

    <td width=\"400\" valign=\"top\"><INPUT class=\"submit\" TYPE=\"submit\" NAME=\"submit\" VALUE=\"$la_add_prod\"></td>

  </tr>

</table>

</td></tr></table>

</FORM>";



}

 // if submit has been clicked

if ($submit){

	

	

// create back link

$goback="<p align=\"center\"><a class=MainLink href=\"javascript:history.back()\">$la_try_again</a></p>";



// create back link

	$goback="<p align=\"center\"><a class=MainLink href=\"javascript:history.back()\">Try again</a></p>";

	$dupquery="select * from ".$prefix."store_inventory where product='$prodnum'";

	$dupresult = mysql_query($dupquery);

	// check required fields were filled

	if ((empty($title)) or (empty($price)))

  {

  echo "<p align=\"center\">$la_required_add_prod</p><p>$goback</p>";

  exit;

  }

	// if product number field is blank, create a product number

	if ((empty($prodnum)))

  {

  $addfrontchar = substr($title,0,3);

  $addfrontchar = strtoupper($addfrontchar);

  $chars = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N",

    "O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3",

    "4","5","6","7","8","9","0");

  $max_chars = count($chars) - 1;

  srand((double)microtime()*1000000);

	for($i = 0; $i < 5; $i++)

  {

  $randnum = ($i == 0) ? $chars[rand(0, $max_chars)] : $randnum . $chars[rand(0, $max_chars)];

  }

  $addcatid = $cat_id;

  $createprodnum = $addfrontchar . $randnum . $addcatid;

  $prodnum = $createprodnum;

  }

	// make sure product number doesn't already exist

	if (mysql_num_rows($dupresult)!=0 )

  {

  echo "<p align=\"center\"><b>$la_prod_exists</b><br><br>$goback</p>";

  exit;

  }



// check category was selected

if ($cat_id=="none")

	{

	echo "<p align=\"center\">$la_no_sel_cat<br><br>$goback</p>";

	exit;

	}



// make sure quantity is apropriate

if (eregi("[a-z\.\!\"\£\$\%\^\&\*\(\)\-\+\{\}\:\;\'\@\~\#\\\|\<\>\?\/]", $quantity)) 

	{

	echo "<p align=\"center\">$la_must_whole_no<br><br>$goback</p>";

	exit;

	}



// make sure price is apropriate

if (eregi("[a-z\!\"\£\$\%\^\&\*\(\)\-\+\{\}\:\;\'\@\~\#\\\|\<\>\?\/]", $price)) 

	{

	echo "<p align=\"center\">$la_price_no_val<br><br>$goback</p>";

	exit;

	}

// make sure sale price is apropriate

if (eregi("[a-z\!\"\£\$\%\^\&\*\(\)\-\+\{\}\:\;\'\@\~\#\\\|\<\>\?\/]", $sale_price)) 

	{

	echo "<p align=\"center\">$la_sale_price_no_val<br><br>$goback</p>";

	exit;

	}





// if upload was not selected

if($upload_image!=="yes"){



$sql = "SELECT max(product) AS total FROM ".$prefix."store_inventory";

  	if(!$r = mysql_query($sql, $db))

  	die("Error connecting to the database.");

  	list($product) = mysql_fetch_array($r);

  	$product = $prodnum;



  	$title = addslashes($title);

  	$description = addslashes($description);

  	$userfile_name = "nophoto.jpg";

  	$userfile_name = addslashes($userfile_name);

  	if(empty($sale_price)){$sale_price="0.00";}

  	$quantity=1;

            $sql_insert = "insert into ".$prefix."store_inventory (product, quantity, description, image, price, title, cat_id, sale_price, instock) values ('$product', '$quantity', '$description', '$userfile_name', '$price', '$title', '$cat_id', '$sale_price', '$instock')";



  	

   $result = mysql_query($sql_insert);

  	$description= nl2br($description);

  	$title = stripslashes($title);

  	$title = stripslashes($title);

  	$instock = stripslashes($instock);

  	$description = stripslashes($description);

  	$description = stripslashes($description);

  	$sale_price = sprintf("%.2f", $sale_price);

  	$ship_price = sprintf("%.2f", $ship_price);

  	$price = sprintf("%.2f", $price);

echo "<p align=\"center\">$la_product_nm $product $la_it_add_succ</p>

<FORM ACTION=\"edit_product.php?product=$product\" METHOD=\"POST\">

<table align=center width=\"600\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

            <tr><td bgcolor=\"$colour_2\">

<table width=\"100%\" align=\"center\" cellpadding=\"2\" cellspacing=\"1\">

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_title</b></td>

    <td width=\"400\" valign=\"top\">$title</td>

  </tr>

  <tr bgcolor=\"$colour_3\">

	<td width=\"200\" valign=\"top\"><b>$la_prod_stock</b></td>

	<td width=\"400\" valign=\"top\">$product</td>

  </tr>

 <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_description</b></td>

    <td width=\"400\" valign=\"top\">$description</td>

  </tr>";

  echo"<tr bgcolor=\"$colour_3\">

   <td width=\"200\" valign=\"top\"><b>$la_instock</b></td>

   <td width=\"400\" valign=\"top\">$instock</td>

 </tr>";

  //<tr bgcolor=\"$colour_3\">

  //  <td width=\"200\" valign=\"top\"><b>$la_quantity</b></td>

  //  <td width=\"400\" valign=\"top\">$quantity</td>

  //</tr>

  echo"<tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_norm_pri</b></td>

    <td width=\"400\" valign=\"top\">$currency$price</td>

  </tr>

<tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_sale_pri</b></td>

    <td width=\"400\" valign=\"top\">$sale_result</td>

  </tr>

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_prod_image</b><br><img src=\"../images/thumb_$userfile_name\"></td>

    <td width=\"400\" valign=\"top\"><img src=\"../images/$userfile_name\"></td>

  </tr>

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\">&nbsp;</td>

    <td width=\"400\" valign=\"top\"><INPUT class=\"submit\" TYPE=\"submit\"  VALUE=\"$la_edit_prod\"></td>

  </tr>

</table>

</td></tr></table>

</FORM>";



echo "<p align=\"center\"><a class=MainLink href=add_product.php>$la_add_anoth_prod</a> | <a class=MainLink href=\"product_options.php\">$la_product_options</a></p>";



}



// if upload was clicked

if($upload_image=="yes"){

// Upload

$path = "$site_dir/images/";

$max_size = 200000;



if (is_uploaded_file($userfile)) {



if ($userfile_size>$max_size) { echo "$la_too_big<br>\n"; exit; }



if (($userfile_type=="image/x-png") || ($userfile_type=="image/pjpeg") || ($userfile_type=="image/jpeg")) {



if (file_exists($path . $userfile_name)) { echo "<p align=\"center\">$la_used_already</p><br>\n";$escape=1; }



if($escape!=1){

$res = move_uploaded_file($userfile, $path . $userfile_name);

// create thumbnail



if (file_exists("$site_dir/images/" . "thumb_$userfile_name"))

	{

  

  unlink("$site_dir/images/thumb_$userfile_name");

  $thumb=new thumbnail("$site_dir/images/$userfile_name");

  $thumb->size_auto(75);

  $thumb->jpeg_quality(75);

  $thumb->save("$site_dir/images/thumb_$userfile_name", $gd_version);

	

	} else {

  

  $thumb=new thumbnail("$site_dir/images/$userfile_name");

  $thumb->size_auto(75);

  $thumb->jpeg_quality(75);

  $thumb->save("$site_dir/images/thumb_$userfile_name", $gd_version);

  }

}

if($escape=1){$res="continue";}



// Resultant output



if (!$res) {

echo "<p align=\"center\">$la_upload_failed<br><br><a class=MainLink href=\"javascript:history.back()\">$la_try_again</a></p>\n"; exit; }

  } else { echo "<p align=\"center\">$la_wrong_type<br><br><a class=MainLink href=\"javascript:history.back()\">$la_try_again</a></p>\n"; exit; }





// everything is ok 

if (!$stop)

  {

  	

  	$sql = "SELECT max(product) AS total FROM ".$prefix."store_inventory";

  	if(!$r = mysql_query($sql, $db))

  	die("Error connecting to the database.");

  	list($product) = mysql_fetch_array($r);

  	$product = $prodnum;



  	$title = addslashes($title);

  	$description = addslashes($description);

  	if(empty($sale_price))

      {$sale_price="0.00";}

  	$quantity=1;

  	$sql_insert = "insert into ".$prefix."store_inventory (product, quantity, description, image, price, title, cat_id, sale_price) values ('$product', '$quantity', '$description', '$userfile_name', '$price', '$title', '$cat_id', '$sale_price')";

  	$result = mysql_query($sql_insert);

  

  $title = stripslashes($title);

  $title = stripslashes($title);

  $description= nl2br($description);

  $description = stripslashes($description);

  $description = stripslashes($description);

  $description= nl2br($description);

  $instock = stripslashes($instock);

  $price = sprintf("%.2f", $price);

  $sale_price = sprintf("%.2f", $sale_price);

  $ship_price = sprintf("%.2f", $ship_price);

  if($sale_price=="0.00"){$sale_result="$la_it_nt_sale";}

  if($sale_price!=="0.00"){$sale_result="$currency$sale_price";}



// display product info



echo "<p align=\"center\">$la_product_nm $product $la_it_add_succ</p>

<FORM ACTION=\"edit_product.php?product=$product\" METHOD=\"POST\">

<table align=center width=\"600\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

            <tr><td bgcolor=\"$colour_2\">

<table width=\"100%\" align=\"center\" cellpadding=\"2\" cellspacing=\"1\">

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_title</b></td>

    <td width=\"400\" valign=\"top\">$title</td>

  </tr>

  <tr bgcolor=\"$colour_3\">

	<td width=\"200\" valign=\"top\"><b>$la_prod_stock</b></td>

	<td width=\"400\" valign=\"top\">$product</td>

  </tr>

  <tr bgcolor=\"$colour_3\">

   <td width=\"200\" valign=\"top\"><b>$la_instock</b></td>

   <td width=\"400\" valign=\"top\">$instock</td>

 </tr>

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_description</b> </td>

    <td width=\"400\" valign=\"top\">$description</td>

  </tr>";

  //<tr bgcolor=\"$colour_3\">

  //  <td width=\"200\" valign=\"top\"><b>$la_quantity</b></td>

  //  <td width=\"400\" valign=\"top\">$quantity</td>

  //</tr>

  echo"<tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_norm_pri</b></td>

    <td width=\"400\" valign=\"top\">$currency$price</td>

  </tr>

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_sale_pri</b></td>

    <td width=\"400\" valign=\"top\">$sale_result</td>

  </tr>

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\"><b>$la_prod_image</b><br><img src=\"../images/thumb_$userfile_name\"></td>

    <td width=\"400\" valign=\"top\"><img src=\"../images/$userfile_name\"></td>

  </tr>

  <tr bgcolor=\"$colour_3\">

    <td width=\"200\" valign=\"top\">&nbsp;</td>

    <td width=\"400\" valign=\"top\"><INPUT class=\"submit\" TYPE=\"submit\"  VALUE=\"$la_edit_prod\"></td>

  </tr>

</table>

</td></tr></table>

</FORM>";



echo "<p align=center><a class=MainLink href=add_product.php>$la_add_anoth_prod</a> | <a class=MainLink href=\"product_options.php\">$la_product_options</a></p>";

  

  }



}}

}

include ("footer.inc.php");

} // end if session is registered

?>

I have take the file of the instockmod_fr_fx_plus_albert_fix.zip and the sakwoya's fix, but, it doesn't want worked.... :(

EDIT : Oups, i think that i have bugged the forum... :rolly::errm:*/* :D

Edited by GuillaumeF
Link to comment
Share on other sites

Guest sakwoya

I have a problem !

The stock is always the value of default (SQL) !!!

I must edit the product to put the correct value of stock.

My code add_product.php :

Hi

There are two places in the add_product code to insert the database records - you need to ensure that 'instock' and '$instock' are added to both - the first is at about line 332 as I mentioned above and the second is at about 444.

The second insert has not been updated in your quoted code

Graeme

Link to comment
Share on other sites

Guest readitag

sakwoya,

Thanks for finding and fixing these problems.

I've modified the download to reflect these changes. Take a look and see if everything looks like it should.

Thanks, Mark Peterson

instockmod.zip

Link to comment
Share on other sites

:rolly: Ok, I'm scared now... all of you people have stores and are making statements like "WAAAH! It no work! u fix now ok plzzzzzzzzzzzzzzzzz"?! Then There's a response saying "Ok, what did the error you get say?" And to that you respond "Duh! U fix now k??? It borken, me get errr", and THEN people respond saying, ok, open this file, find this text, and replace with this text." and how do you respond? "WHAT?>!?!?!?!? How DARE u tellz me hows to fix it!!!! cant u jst put up a zip file, itll take 30 secs ok thnx". I can't believe these people are running their own stores, much less are able to figure out how to turn on a computer!

Link to comment
Share on other sites

Guest staff_bull

apparently..it's supposed to do that haha..theres a line in the view_product.php that basically says...if the category image is not equal to catnoimage.gif, show the category image at the top of the page...and since the page that I added the mod to uses custom category images...it shows the category image at the top. I just added your mod to another cart by copying your files over, not modifying mine and the images dont show up. then again...im not using custom images. i just checked another cart that I used custom images on and it does the same thing. I never noticed it before and I guess it just looks weird because the one I noticed it on has big category images. this has nothing to do with your script! haha thank you for making it though, it works well and its a big help!

I will start by saying i am NOT a programmer in any shape or form and know nothing about programming php scripts but any help would be much appreciated.

I have recently downloaded and installed CubeCart including the instock mod and everything works apart from the extra image placed above the category listing. Has anybody managed to find out what is causing this and a solution to the problem.

Answers on a postcard please.

staff_bull

Link to comment
Share on other sites

Hi All!! :(

This download is now fixed. Sorry for the inconvenience before... slowly this server is coming together again. :)

If anyone has copies of any other mods please email them to [email protected] and I will fix them. :(

All mods were lost as they were directly uploaded to the server and no back up was taken. :)

Link to comment
Share on other sites

Guest staff_bull

If there is anyone wanting any mods which was lost from this site, please send an email to [email protected] with the name of the mod as subject and i will email you the mod until the mods are restored on the server.

Brooky, if you want all the mods, i have already emailed them to [email protected] was that the right address?

staff_bull

Link to comment
Share on other sites

Guest pataslak

this mod is not complete

the authors miss some part .

exemple : when you delete an order the inventory stay the same and no change is made in the inventory.

will try fix /add this today

Link to comment
Share on other sites

Please help......

I have uploaded all the files as informed. but ...

On the installation it say the following:

*Note* You also need to create a new row in your store_inventory database file called instock

The php code is: $sql = 'ALTER TABLE `store_inventory` ADD `instock` INT( 30 ) DEFAULT \'0\' NOT NULL ; ';

Where and how do i do this?

All i get at the mo is a error when i try to add a product.

Thanks in advance for any help :)

Link to comment
Share on other sites

Guest pataslak

if you have php mysql

run this SQL command :

if your prefix is ""

ALTER TABLE `store_inventory` ADD `instock` INT( 30 ) DEFAULT '0' NOT NULL

if you prefix is "test"

ALTER TABLE `teststore_inventory` ADD `instock` INT( 30 ) DEFAULT '0' NOT NULL

Link to comment
Share on other sites

Thanks for your reply.

When i try to edit my products i get the following error.

Parse error: parse error, expecting `','' or `';'' in /home/public_html/shop/admin/edit_product.php on line 455

If i try to add a product i get the following error.

Parse error: parse error, expecting `','' or `';'' in /home/public_html/shop/admin/add_product.php on line 213

I have uploaded all the files and doubled checked them but am still stuck on the

*Note* You also need to create a new row in your store_inventory database file called instock

The php code is: $sql = 'ALTER TABLE `store_inventory` ADD `instock` INT( 30 ) DEFAULT \'0\' NOT NULL ; ';

what file do i need to get in or where do i create this new row.

I looked in mysql and got lost.

Would really appreciate some help in basic form.

Thanks in advance

Link to comment
Share on other sites

Guest candspc

Ok here is what I have done, I have put the instock mod and the ship price mod together in 1 mod. The zip containes the files in the directorys they belong and also the sql files to insert. If brooky wants he can put them on the server to download as a combined mod, by the sounds of it both are very commen mods people want. I hope this helps every one out that has not got this working or just installed the cart.

Ship price and Auto instock Combined Mods

Now has anybody come up with a autosend mod for cubecart yet? :)

Link to comment
Share on other sites

Guest pataslak

great.

but this file are unusable for me :) and probably for some other who already made some change on all my install.

i will have diff all theese file.

do you have what to change on each file ?

Link to comment
Share on other sites

Guest candspc

pretty much, if you have changed any of the files listed below you might want to think of another way, these are done on a fresh cubecart install. I should have taken notes when I fixed it, but I was going along well fixing it so I really couldnt tell you what lines have to be changed, but what I can tell you is most errors you encounter with the 2 files are:

you will see an error pop up on lets say line 212 look about 4 or 5 lines up and you will see </tr> just make it </tr>"; this is the problem on a few lines.

Under root

----------

order.php

ship_price.php

view_product.php

secure.php

view_cart.php

Under admin

-----------

edit_product.php

view_product.php

add_product.php

inventory.php

under admin/lang

----------------

english.inc

English.inc.php

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...