Forums / All Other Contributions/Addons / Delivery control

Delivery control

Views: 11,033

Results 41 to 57 of 57
2 Jul 2009, 3:25 AM
#41
chemvil avatar

chemvil

New Zenner

Join Date:
Jun 2009
Posts:
7
Plugin Contributions:
0

Delivery control

hello zen-cart guru

i tried to solve my problem with delivery control mod,
sadly i have limited knowledge of php
i tried to look at the script.

i found these code in the script in delivery_new.php

if($action == "add") // ADD PRODUCT DELIVERY !!!
{                   
   ...            
   ...
   ...

   if($step > 3)
   {
      //test if record exist
      $exist = $db->Execute("select prod_quantity AS quantity
                             from delivery_products
                             where del_id = '".$dID."' 
                             and prod_id = '".$add_product_products_id."' ");

   

      $action='update';

      echo "<tr class=\"dataTableRow\">
	   <form action='$PHP_SELF?dID=$dID&action=$action' method='POST'>\n";
           echo "<td class='dataTableContent' align='right'><b>STEP 3:</b></td>";
           echo "<td class='dataTableContent' valign='top'>
	    	 <input name='add_product_quantity' size='5' value='1'>" . ADDPRODUCT_TEXT_CONFIRM_QUANTITY . "</td>
		 <td align='center'><input type='submit' value='" . ADDPRODUCT_TEXT_CONFIRM_ADDNOW . "'></td></tr>";

      echo "<tr><td></td><td class='dataTableContent' valign='top'></td>";
         if ($exist->RecordCount() > 0) {
            //record exist!
            echo ('<tr><td></td>
            <td><font color="red">Product exists and it\'s quantity will be updated!</font>
            <br>
            <i>Original quantity: ' . $exist->fields[quantity] . '</i>
            </td>
            <td></td></tr>');
            echo "<input type='hidden' name='exist' value='yes'>";

         }


      echo "<td>";

      if(IsSet($add_product_options))
      {
         foreach($add_product_options as $option_id => $option_value_id)
            {
               echo "<input type='hidden' name='add_product_options[$option_id]' value='$option_value_id'>";
            }
      }
   
      echo "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
      echo "<input type='hidden' name='pID' value='$add_product_products_id'>";
      echo "</td>\n";
      echo "</form></tr>\n";
   }

   echo "</table>\n";
   echo '<br><center><a href="' . zen_href_link(FILENAME_DELIVERY, 'dID='.$dID, 'NONSSL') . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a></center>';
}

and these code on top of the delivery_new.php, and i copied to a file named test.php

require('includes/application_top.php');

$action = (isset($_GET['action']) ? $_GET['action'] : '');
$pID = zen_db_prepare_input($_POST['pID']);
$dID = zen_db_prepare_input($_GET['dID']);
$exist = zen_db_prepare_input($_POST['exist']);
$step = zen_db_prepare_input($_POST['step']);
$add_product_categories_id = zen_db_prepare_input($_POST['add_product_categories_id']);
$add_product_products_id = zen_db_prepare_input($_POST['add_product_products_id']);
$add_product_quantity = zen_db_prepare_input($_POST['add_product_quantity']);


if (zen_not_null($action)) {
switch ($action) {

case 'update':
	if ($exist == 'yes')
	{
	//record exist!

	$db->Execute("UPDATE delivery_products
	
	              SET prod_quantity = '".$add_product_quantity."'

		      WHERE del_id = '".$dID."' and prod_id = '".$add_product_products_id."' ");

	echo "UPDATE delivery_products SET prod_quantity = '".$add_product_quantity."' WHERE del_id = '".$dID."' and prod_id = '".$add_product_products_id."' ";

	$messageStack->add('DB updated! Unique price £'.$add_product_new_price.' of product ID #'.$pID.' modified for customer ID #'.$cID.' successfuly.', 'success');

        } else {

	//record doesn't exist!

	$db->Execute("INSERT INTO delivery_products (del_id, prod_id, prod_quantity)

	              VALUES ('".$dID."','".$add_product_products_id."','".$add_product_quantity."')");

        echo "INSERT INTO delivery_products (del_id, prod_id, prod_quantity) VALUES ('".$dID."','".$add_product_products_id."','".$add_product_quantity."')";

	$messageStack->add('DB updated! Unique price £'.$add_product_new_price.' for product ID #'.$pID.' added to customer ID #'.$cID.' successfuly.', 'success');
        }

   ob_start();
   echo "Test";
   header("Location:" . zen_href_link(FILENAME_DELIVERY, "dID=" . $dID, "NONSSL"));
   ob_flush();

break;

...
...
...

}

i tried to change the form_action to other file i created (test.php)
the value sent by _POST method is valid and correct

if there is require('includes/application_top.php'); on top of the script, every time i click submit it would always go back to admin home and not process the rest of the code,

if i remove the require('includes/application_top.php'); i cannot use the function like $db->Execute, etc, which is required for the rest of the code

is there any mistake?
hope someone can help me out

many thanks

2 Jul 2009, 4:36 PM
#42
starbuck avatar

starbuck

New Zenner

Join Date:
Jun 2008
Posts:
47
Plugin Contributions:
0

Re: Delivery control

chemvil have you applied the new security_patch_v138_20090619 that was released the other day?

I have found that the update has caused the problem you are describing where you make a change/ press buttons and you go back to main page with now change being made for me this is happing on all parts of my site.

To see if it is this causing it try making a change to a shipping price and see if you are kicked back to the main admin page or not.

hope this helps

3 Jul 2009, 2:05 AM
#43
chemvil avatar

chemvil

New Zenner

Join Date:
Jun 2009
Posts:
7
Plugin Contributions:
0

Re: Delivery control

hi starbuck

yes, i have applied the security patch the other day,
i have not tried using the delivery control before security patch applied, i will try that also

i tried to change the shipping price in Modules>Shipping, and i had successfully changed the price without getting kicked back to the admin home.

will try to see if i get kick back to admin page after pressing change/submit button on any other part of my site.

thanks a lot for the info

3 Jul 2009, 5:47 PM
#44
chemvil avatar

chemvil

New Zenner

Join Date:
Jun 2009
Posts:
7
Plugin Contributions:
0

Re: Delivery control

HI starbucks,

seems there is some changes in the security patch. i tried to reinstall new zen-cart, and tried the delivery control before i applied the security patch, and it worked ok

i guess it's the security patch that made the delivery control mod not working, any idea how to fix?

many thanks

9 Sep 2009, 7:57 PM
#45
loadedframe avatar

loadedframe

New Zenner

Join Date:
Sep 2009
Location:
Castle Rock, CO
Posts:
1
Plugin Contributions:
0

Re: Delivery control

I stumbled across a few things wrong with the "delivery_new.php" page with regards to security patched version 1.3.8. The biggest hurdle was to change "update" to something else... not that it was a hurdle of technical difficulty, just that after hours of head scratching, I just thought... hmm... maybe "update" is a bad thing to put on the querystring. So there ya have it, I changed it on lines:

50
373

I used "updateDelivery"

Also, I'm going to attempt to insert the new MySQL call from line 238:

$result = $db -> Execute("SELECT products_name, p.products_id, categories_name, ptc.categories_id FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id=p.products_id) LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc ON (ptc.products_id=p.products_id) LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON (cd.categories_id=ptc.categories_id) ORDER BY categories_name");

I also manually or "hard coded" the Database Query names wherever I needed to use a prefix. (Sorry - too many places to count)

Hope this helps someone!

Robert Thompson
Loaded Frame LLC
http://www.loadedframe.com

1 Feb 2010, 9:58 PM
#46
holz avatar

holz

New Zenner

Join Date:
Feb 2009
Posts:
10
Plugin Contributions:
0

Re: Delivery control

hello,

Please can someone fix the published package contains errors and upload the new version?

  1. missing semicolon in SQL script
  2. correction relative references to sql tables
  3. and some others..

Many thanx!

ZC 1.3.8 installed

10 Feb 2010, 12:23 PM
#47
andy_gs avatar

andy_gs

Zen Follower

Join Date:
Jun 2008
Posts:
187
Plugin Contributions:
0

Re: Delivery control

Do i assume this module development has died? i just downloaded the addon and installed it it seems to installed without error.

However......

i can't seem to add any deliveries or anything like that. When i click either of the 2 buttons at the top of:

reports - > delivery

i click the buttons at the top of this page and nothing happens.

i've done the altered multi langugae thing as we don't use it so i've removed it as per the readme.txt

any people still active to help?
Maybe this mod should be removed as the download doesn't seem to function, and no updates have been applied?

regards
Andy.

oh dear gurrrddddd.

6 Aug 2010, 4:35 PM
#48
flix avatar

flix

New Zenner

Join Date:
Mar 2010
Posts:
33
Plugin Contributions:
0

Re: Delivery control

Hi there

I love delivery control. Great module!

But after upgrading to ZC v1.3.9, the module does not work properly anymore.

I am still able to create new deliveries but I am no longer able to add products to a delivery. I can select a product for a given delivery but after adding it to the delivery, the added product does just not show up in the delivery, i.e. the delivery still has no product assigned.

Anyone having similar problems when upgrading to v1.3.9?

18 Sep 2010, 11:39 AM
#49
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: Delivery control

I had the same problem with Delivery control and ZC v1.3.9f.
I were able to fix it by renaming the action "update" to "devUpdate".

On line 47: Change "case 'update':" to "case 'devUpdate':"
On line 371: Change "$action='update';" to "$action='devUpdate';"

Good luck and thanx for the mod!

Focus dammit, I'm trying to focus!

SweetFabrik - True believer of Zen Cart!

http://www.last.fm/user/beez/

17 Oct 2010, 10:54 PM
#50
simondale123 avatar

simondale123

New Zenner

Join Date:
Jun 2008
Posts:
60
Plugin Contributions:
0

Re: Delivery control

Andy_GS:

i can't seem to add any deliveries or anything like that. When i click either of the 2 buttons at the top of:

reports - > delivery

i click the buttons at the top of this page and nothing happens.

i've done the altered multi langugae thing as we don't use it so i've removed it as per the readme.txt

I get the exact same thing on 1.3.8a and I have also followed all the tips to take out the multilanguage part and rename the word "update". The buttons at the top still do nothing.

I have tried manually adding a record to the delivery table and the screen then shows one delivery (which proves that the new table is there and everything) but the buttons just won't do anything.

Is this something to do with a security patch or something along those lines perhaps?

I'd love to get this working and would be very grateful of any further ideas.

All the best

Simon

24 Jan 2011, 12:55 AM
#51
baracudamax avatar

baracudamax

New Zenner

Join Date:
Jul 2010
Posts:
33
Plugin Contributions:
0

Re: Delivery control

Very clever... Thanks for your tip works like a charm...

24 Jan 2011, 12:58 AM
#52
simondale123 avatar

simondale123

New Zenner

Join Date:
Jun 2008
Posts:
60
Plugin Contributions:
0

Re: Delivery control

baracudamax:

Very clever... Thanks for your tip works like a charm...

Works like a charm? Really? Which bit?

I never did get this working and I'd love to! Could you tell me what you did to make it work please?

Thanks a lot

Simon

25 Jan 2011, 8:42 PM
#54
simondale123 avatar

simondale123

New Zenner

Join Date:
Jun 2008
Posts:
60
Plugin Contributions:
0

Re: Delivery control

baracudamax:

Fixed duplicate quantity update and add new product for anyone has updated to the latest security patch.

http://www.e-matrix.gr/downloads/Delivery_Control_1.3_by_BARACUDAMAX.zip

Cool - thanks for the reply. Is that link to a Zip file an updated file with the fixes in it? It would be fantastic if it was!!

Unfortunately the link 404s though :-(

Thanks

Simon

26 Jan 2011, 1:55 PM
#55
baracudamax avatar

baracudamax

New Zenner

Join Date:
Jul 2010
Posts:
33
Plugin Contributions:
0

Re: Delivery control

Sorry for the bad link. Some more tests and it will be available again.

24 Jun 2011, 9:19 AM
#56
axl_gold_racing avatar

axl_gold_racing

New Zenner

Join Date:
Mar 2011
Posts:
5
Plugin Contributions:
0

Re: Delivery control

Hi,

I have installed the Delivery control module, on a Zen 1.3.9h shop,

Been reading this whole thread, tried the tips , but still no result.
When i push a button, nothing happens.

Anyone who can help ??

19 Aug 2011, 8:25 AM
#57
billyboyle avatar

billyboyle

Zen Follower

Join Date:
Jul 2011
Location:
Glasgow, Scotland
Posts:
115
Plugin Contributions:
1

Re: Delivery control

Take it this is dead in the water.
No Dev in put for a couple of years, looked like some helpful tips but which files should they be applied to in the mod?

Anyone

Today I am trying something different. Read the install.txt Read the FAQ Read the forum for answers; Then Install the mod. ;-)
AML Candles