Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Scott, are you around?

 

Its been another month now and no word on the new version.

Are you still working on it, or is it not going to happen now?

 

Im in desperate need for the ability to be able to serve different products 'AND' prices to different groups as Im sure a few others are too, and the next version of 'Seperate Pricing per Customer' as you explained it would do the job nicely.

 

If anyone can suggest a work around for this, with perhaps a modification to the contribution, "Discount Groups" even, that would be a fantastic temporary measure!

 

While we're waiting on Scott's latest version of course! :)

Link to comment
Share on other sites

  • 2 weeks later...

I am getting a parse eror that says this

 

Parse error: parse error, expecting `')'' in /homepages/34/d84309762/htdocs/catalog/includes/classes/order.php on line 117

 

Line 117 is in bold below

'id' => $orders_products['products_id'],

                                        'name' => $orders_products['products_name'],

                                        'model' => $orders_products['products_model'],

                                        'tax' => $orders_products['products_tax'],

                                        'price' => $orders_products['products_price'],

                                        'final_price' => $orders_products['final_price'],

          global $customer_id;

$customer_group_id_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '". $customer_id . "'");

$customer_group_id = tep_db_fetch_array($customer_group_id_query);

  if ($customer_group_id['customers_group_id'] != '0'){

  $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id['customers_group_id'] . "' and products_id = '" . $products[$i]['id'] . "'");     

  if ($orders_customers = tep_db_fetch_array($orders_customers_price)){

    $this->products[$index] = array('price' => $orders_customers['customers_group_price'],

                                    'final_price' => $orders_customers['customers_group_price']);

  }                             

}

 

any ideas appreciated

 

thanks

 

mark

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

I have been using this for some time and it is working awesome for me.

 

i was wondering since we have about 3000+ products is there a way to just do a % discount on all items for each group?

 

Has anyone tried this or is successfull in doing this with this contrib? I just find it hard to constantly update every item with every new group or new products..

 

thanks,

 

Mikey

Link to comment
Share on other sites

I am getting a parse eror that says this

 

Parse error: parse error, expecting `')'' in /homepages/34/d84309762/htdocs/catalog/includes/classes/order.php on line 117

 

Line 117 is in bold below

'id' => $orders_products['products_id'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'name' => $orders_products['products_name'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'model' => $orders_products['products_model'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'tax' => $orders_products['products_tax'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'price' => $orders_products['products_price'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'final_price' => $orders_products['final_price'],

? ? ? ? ? global $customer_id;

$customer_group_id_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '". $customer_id . "'");

$customer_group_id = tep_db_fetch_array($customer_group_id_query);

? if ($customer_group_id['customers_group_id'] != '0'){

? $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id['customers_group_id'] . "' and products_id = '" . $products[$i]['id'] . "'");? ? ? 

? if ($orders_customers = tep_db_fetch_array($orders_customers_price)){

? ? $this->products[$index] = array('price' => $orders_customers['customers_group_price'],

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'final_price' => $orders_customers['customers_group_price']);

? }? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

}

 

any ideas appreciated

 

thanks

 

mark

try this:

 

'id' => $orders_products['products_id'],
                                       'name' => $orders_products['products_name'],
                                       'model' => $orders_products['products_model'],
                                       'tax' => $orders_products['products_tax'],
                                       'price' => $orders_products['products_price'],
                                       'final_price' => $orders_products['final_price']);

changed the 'final_price' => $orders_products['final_price'], to );

 

 

the rest of the code looks okay, but i'm affraid you made a typo with adding 'a' contribution.

ALWAYS watch carefully what you copy/past into original files

just comment out the real code next time to see the differences when you have an error somewhere...

 

When you get an error with a linenumber then ALWAYS look BEFORE that line because that's where the error stops

 

Good luck ;)

Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Link to comment
Share on other sites

  • 2 weeks later...

Guys I am gettign a parse error at line 127 - anyone seee what is wrong pls - line 127 is in bold

 

thanks

 

mark

 

$index = 0;
     $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_returned, products_exchanged, products_exchanged_id, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");
     while ($orders_products = tep_db_fetch_array($orders_products_query)) {
       $this->products[$index] = array('qty' => $orders_products['products_quantity'],
                                'id' => $orders_products['products_id'],
                                       'name' => $orders_products['products_name'],
                                       'model' => $orders_products['products_model'],
                                       'tax' => $orders_products['products_tax'],
                                       'price' => $orders_products['products_price'],
                                       'final_price' => $orders_products['final_price']);
global $customer_id;
$customer_group_id_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '". $customer_id . "'");
$customer_group_id = tep_db_fetch_array($customer_group_id_query);
 if ($customer_group_id['customers_group_id'] != '0'){	
 $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id['customers_group_id'] . "' and products_id = '" . $products[$i]['id'] . "''");     	 
 if ($orders_customers = tep_db_fetch_array($orders_customers_price)){	
   $this->products[$index] = array('price' => $orders_customers['customers_group_price'],
                                   'final_price' => $orders_customers['customers_group_price']);
 }                              
}
    	 [B] 	 'id' => $orders_products['products_id'],[/B]

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

I don't think my last post was posted so here it is again

 

I get a paerse error on line 127 which is in bold below

 

any ideas pls as I can't see the problem

 

regards

 

mark

 

      $index = 0;
     $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_returned, products_exchanged, products_exchanged_id, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");
     while ($orders_products = tep_db_fetch_array($orders_products_query)) {
       $this->products[$index] = array('qty' => $orders_products['products_quantity'],
                                'id' => $orders_products['products_id'],
                                       'name' => $orders_products['products_name'],
                                       'model' => $orders_products['products_model'],
                                       'tax' => $orders_products['products_tax'],
                                       'price' => $orders_products['products_price'],
                                       'final_price' => $orders_products['final_price']);
global $customer_id;
$customer_group_id_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '". $customer_id . "'");
$customer_group_id = tep_db_fetch_array($customer_group_id_query);
 if ($customer_group_id['customers_group_id'] != '0'){	
 $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id['customers_group_id'] . "' and products_id = '" . $products[$i]['id'] . "''");     	 
 if ($orders_customers = tep_db_fetch_array($orders_customers_price)){	
   $this->products[$index] = array('price' => $orders_customers['customers_group_price'],
                                   'final_price' => $orders_customers['customers_group_price']);
 }                              
}
         [B]'id' => $orders_products['products_id'],[/B]

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

Try removing the second ' here:

 

$orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id['customers_group_id'] . "' and products_id = '" . $products[$i]['id'] . "''");     

 

 

IIRC that's what was doing it on mine.

Link to comment
Share on other sites

  • 3 weeks later...

This is my first time posting and I am new to OS commerce. I have installed the latest version and added a few mods. I just added Sep. pricing mod and I have a couple of issues.

1. The wholesale pricing works great, but when I go to checkout the cart totals retail pricing.

2. After installing this mod when I signup as a new customer everything is fine, but when an existing customer logs in and clicks sign in, they get a "page can not be found" error. If they use the back button and go back to the index page they are logged in.

 

 

I have checked my login.php and it has not been changed. Has anyone alse seen this problem?

 

Thanks,

Steve

Link to comment
Share on other sites

I have been using it and it works great.

 

I was wondering, if a customer is not logged in and it adds a product in the shopping cart (shopping_cart.php) can I show the price of a specific customer group in the shopping cart rather than the default price. What possible modifications could I do in the /class/shopping_cart.php to show that.

 

Thanks in advance for you help.

Link to comment
Share on other sites

  • 4 weeks later...

I've scanned the entire thread and have not found anyone mentioning this, so maybe some of you already have it figured out;

 

The contribibution works well, but just one issue; for most of us who use this contribution, we create additional groups such as resell, wholesale, distributor... etc. All (or most) of these additional groups are tax exempt. How are you guys editing the code so that sales tax is not applied when these resellers / wholesalers / distributors, who happens to be in the same state, place an order online? (this would not be a problem for resellers out of state since out of state sales are not taxed anyway).

 

Your help is greatly appreciated.

 

Jimmyz008

Edited by jimmyz008
Link to comment
Share on other sites

hmm..seems Scott has dissappeared...so im guessing waiting for vers 4.0 with ability to hide products to some users wont be coming anytime soon? if anyone else could work on this mod would be greatly appreciated by me and many others i presume.

Link to comment
Share on other sites

Yep, Ive been waiting on this for some time, and still very interested in a contribution that can allow me to show select products to different customers.

 

Anyone want to take this on? ;) , I figure it wont be easy, but I believe it would be a contrib that many people would want.

Link to comment
Share on other sites

Hey all,

 

finally have this seperate pricing running awesome.. great job..

 

What I would love to do now is disable my free shipping per order count when the customer is not a reseller or dropship customer...

 

I figure it could be done somewhere here in this section of code from catalouge/includes/modules/shipping/freecount.php

 

I guess somewhere in the bold how would i put in something like if customer_group_id is not 0 (default regular price group) do not allow freecount?

 

Its a bit over my head but any suggestions ?

 

// class constructor
   function freecount() {
     global $order, $total_count;

     $this->code = 'freecount';
     $this->title = MODULE_SHIPPING_FREECOUNT_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_FREECOUNT_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_FREECOUNT_SORT_ORDER;
     $this->icon = '';
     $this->tax_class = MODULE_SHIPPING_FREECOUNT_TAX_CLASS;
     $this->enabled = ((MODULE_SHIPPING_FREECOUNT_STATUS == 'True') ? true : false);

     [B]if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FREECOUNT_NUMBER <= $total_count) ) {
         if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FREECOUNT_ZONE > 0) ) {
           $check_flag = false;[/B]
           $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FREECOUNT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
           while ($check = tep_db_fetch_array($check_query)) {
             if ($check['zone_id'] < 1) {
               $check_flag = true;
               break;
             } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
               $check_flag = true;
               break;
             }
           }

           if ($check_flag == false) {
             $this->enabled = false;
           }
         }
      }
      else{
          $this->enabled = false;
      }
   }

Link to comment
Share on other sites

Excused for my English.

I have installed this contribution :Quick Price Updates (by Category)

http://www.oscommerce.com/community/contri...ons,700/page,20

I have only 2 categories:Retail and Commercianti

 

This contribution it allows to only change the price Retail :(

I would want to change also to the price Commercianati

You can help me? B) B) www.fiorucciricambi.it

 

<?php
include('includes/application_top.php');
// category drop down
$sql3 = mysql_query("SELECT categories_id, categories_name FROM categories_description ORDER BY categories_name");
?>
<?php
if ($action == "category") {
   echo "<form name=\"update\" method=\"post\" action=\"".$_SERVER["PHP_SELF"]."?action=update_prices\">";
   echo "<table>";
   echo "<tr><th>Product ID</th><th>Product Name</th><th>Prezzo privati</th><th>Prezzo Commercio</th></tr><tr>";
   $result = mysql_query("SELECT * FROM products, products_description, products_to_categories WHERE products_to_categories.categories_id = $option AND products_to_categories.products_id = products.products_id AND products.products_id = products_description.products_id");
   if ($row = mysql_fetch_array($result)) {
       do {
           echo "<td align=\"center\">".$row["products_id"]."</td>\n";
           echo "<td>".$row["products_name"]."</td>\n";
           echo "<td align=\"center\"><input type=\"text\" name=\"product_new_price[".$row['products_id']."]\" value={$row['products_price']}></td>\n";
           echo "</tr>\n";
       }
       while($row = mysql_fetch_array($result));
   }
   echo "</table>\n";
   echo "<br><input type=\"submit\" value=\"Update Prices\">";
   echo "</form>";
}
?>
<?php
if ($action == "update_prices") {
   foreach($HTTP_POST_VARS['product_new_price'] as $id => $new_price) {
       mysql_query("UPDATE products SET products_price=$new_price WHERE products_id=$id");
   }
   $random = date("U");
   echo "<p><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\"><b>Prices Updated</b></font></p>";
   echo "<p><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">Your price list for this Category has been updated.</p>";
   echo "<p><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">Click <a href=\"$PHP_SELF?$random\">here to Update</a> prices in a different category.</font></p>";
   exit;
}
?>

<html>
<head>
<title>Product Quick Add</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
th {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; background-color: #eeeeee}
table {  border: #666666; border-style: dashed; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}
td {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; padding-top: 3px; padding-bottom: 3px; padding-left: 5px}
td.left {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; padding-top: 3px; padding-bottom: 3px; padding-left: 5px; text-align: right; padding-right: 16px}

-->
</style>
</head>
<body bgcolor="#FFFFFF">
 <table>
   <tr> 
     <th>Choose Category to update prices</td>
   </tr>
   <tr>
     <td>
     <?php
     if(mysql_num_rows($sql3)) {
         while($row = mysql_fetch_row($sql3)) {
             print("<a href=\"".$_SERVER["PHP_SELF"]."?action=category&option={$row[0]}\">$row[1]</a><br>");
         }
     }
     ?>
     </td>
   </tr>
 </table>
</form>
</body>
</html>

Link to comment
Share on other sites

Hey all,, I have installed everything great but I am using a contribution that lists the products in columns rather than in one column.

 

This is the page I am using instead of the standard catalog/includes/modules/product_listing.php

 

and I cant find anywhere where it refers to

After:

 

case 'PRODUCT_LIST_PRICE':

$lc_align = 'right';

 

Add:

 

and wonderd if anyone could help me...

 

Where would I add

$customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id =  '" . $customer_id . "'");
$customer_group = tep_db_fetch_array($customer_group_query);
$customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $listing['products_id'] . "' and customers_group_id =  '" . $customer_group['customers_group_id'] . "'");
if ( $customer_group['customers_group_id'] != 0) {
 if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
   $listing['products_price'] = $customer_group_price['customers_group_price'];
 }
}

 

to my listings in a column page below..

<?php
/*
 -- Changed 11/10/03 for v 2.2 MS2 - Randy Pertiet

 $Id: product_listing_col.php,v 1.00 2002/05/06 20:28:07 icw_ Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- product_listing_col //-->
<?php

 DEFINE('PRODUCT_LIST_COL_NUM',3);

 $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
 <table border="0" width="100%" cellspacing="0" cellpadding="2">
   <tr><td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
     <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
   </tr>
 </table>
<?php
 }

 $info_box_contents = array();

 if ($listing_split->number_of_rows > 0) {

$row = 0;
$col = 0;

   $listing = tep_db_query($listing_split->sql_query);
   while ($listing_values = tep_db_fetch_array($listing)) {

     $listing_values['products_name'] = tep_get_products_name($listing_values['products_id']);

     $lc_text= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . $listing_values['products_name'] . '</a><br>';

     if ($listing_values['specials_new_products_price']) {
       $lc_text .= ' <s>' .  $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing_values['specials_new_products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</span> ';
  } else {
       $lc_text .= ' ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . ' ';
     }

     if (PRODUCT_LIST_BUY_NOW) {
       $lc_text .= '<br><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing_values['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . '</a> ';      
     }

     $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"',
                                          'text' => $lc_text);

     $col ++;
     if ($col > PRODUCT_LIST_COL_NUM-1) {
       $col = 0;
       $row ++;
     }
   }

   new contentBox($info_box_contents);

 } else {

   $info_box_contents = array();

   $info_box_contents[0] = array('params' => 'class="productListing-odd"');
   $info_box_contents[0][] = array('params' => 'class="productListing-data"',
                                  'text' => TEXT_NO_PRODUCTS);

   new contentBox($info_box_contents);

 }

if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
 ?>
 <table width="100%">
  <tr>
    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
     <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
  </tr>
 </table>
<?php
 }
?>

 

 

PLEASE this has me totally insane and feeling stupid for not knowing how to intergrate the contrib with my current contrib..

 

any hints also would be sweet..

 

totally learning here, thanks. Mikey

Link to comment
Share on other sites

Hello,

I recently installed this mod

workin great except few things

when i find product threw either search or categories it displays web price and not group discount price..but when item is clicked on it displays current price..could i have missed something? if so which file would i look at

help would be greatly aprreciated..

Link to comment
Share on other sites

Hello, a little quest -- soory :)

 

 

i?ve installed the SPPC 3.5 up to

***STOP HERE********

and it works fine.

After testing I continued the installation up to the end.

And Know I have a problem. went in my admin interface and click on the point for specials I became a blank white page.

Can anybody help me?

 

The last page which need to edit is (after description)

catalog/includes/classes/shopping_card.php

is it correctly ( or is it admin/includes........ )

 

 

The file which didn?t work is: www.abc.xy/shop/admin/specials.php

 

Thanks for your help!

 

Sebastian

Edited by mannstein
Link to comment
Share on other sites

Hello, a little quest -- soory :)

 

 

i?ve installed the SPPC 3.5 up to

***STOP HERE********

and it works fine.

After testing I continued the installation up to the end.

And Know I have a problem. went in my admin interface and click on the point for specials I became a blank white page.

Can anybody help me?

 

The last page which need to edit is (after description)

catalog/includes/classes/shopping_card.php

is it correctly ( or is it admin/includes........ )

 

 

The file which didn?t work is: www.abc.xy/shop/admin/specials.php

 

Thanks for your help!

 

Sebastian

One quick check is to see if you have any blank lines after the final line of code that ends with ?> on any of the pages you have edited.

 

It happens alot to me for some reason if there are and empty lines after the last line. A shot in the dark but sometimes it helps..

Link to comment
Share on other sites

The file which didn?t work is: www.abc.xy/shop/admin/specials.php
if this is one of the files that the code was changed in then check that the code changes were correct as it does not take much of an error in the code to cause an issue

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Hi Thankz for response...

 

first, there is no empty line or blank sign after the last ?>

 

 

second, i?ve make a control of all sites which i?ve edited, but i did not find a fault.

 

I can create groups and can put a customer in a group. I can assign prices to special groups and everything works well with exeption of the Specials point.

 

quest is: the last File which must edit is it the catalog/includes/classes/shopping_card.php ot the

admin/includes/classes/shopping_card.php

 

I?ve done it first for the catalog/... after that I?ve made step back and edit the admin/... file

In both cases the result is the same, that brings me to the conviction, that the error must lie elsewhere.....

 

 

This is my admin/specials.php:

<?php
/*
 $Id: specials.php,v 1.41 2003/06/29 22:50:52 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 if (tep_not_null($action)) {
   switch ($action) {
     case 'setflag':
       tep_set_specials_status($HTTP_GET_VARS['id'], $HTTP_GET_VARS['flag']);

       tep_redirect(tep_href_link(FILENAME_SPECIALS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'sID=' . $HTTP_GET_VARS['id'], 'NONSSL'));
       break;
     case 'insert':
       $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
       $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);
       $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
       $day = tep_db_prepare_input($HTTP_POST_VARS['day']);
       $month = tep_db_prepare_input($HTTP_POST_VARS['month']);
       $year = tep_db_prepare_input($HTTP_POST_VARS['year']);
       $customers_group=tep_db_prepare_input($HTTP_POST_VARS['customers_group']);
       $price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS. " WHERE products_id = ".(int)$products_id . " AND customers_group_id  = ".(int)$customers_group);
       while ($gprices =  tep_db_fetch_array($price_query)) {
           $products_price=$gprices['customers_group_price'];
       }

       if (substr($specials_price, -1) == '%') {
         $new_special_insert_query = tep_db_query("select products_id, products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
         $new_special_insert = tep_db_fetch_array($new_special_insert_query);

         $products_price = $new_special_insert['products_price'];
         $specials_price = ($products_price - (($specials_price / 100) * $products_price));
       }

       $expires_date = '';
       if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
         $expires_date = $year;
         $expires_date .= (strlen($month) == 1) ? '0' . $month : $month;
         $expires_date .= (strlen($day) == 1) ? '0' . $day : $day;
       }

       tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status, customers_group_id) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '1', ".(int)$customers_group.")");

       tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));
       break;
     case 'update':
       $specials_id = tep_db_prepare_input($HTTP_POST_VARS['specials_id']);
       $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);
       $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
       $day = tep_db_prepare_input($HTTP_POST_VARS['day']);
       $month = tep_db_prepare_input($HTTP_POST_VARS['month']);
       $year = tep_db_prepare_input($HTTP_POST_VARS['year']);

       if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price));

       $expires_date = '';
       if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
         $expires_date = $year;
         $expires_date .= (strlen($month) == 1) ? '0' . $month : $month;
         $expires_date .= (strlen($day) == 1) ? '0' . $day : $day;
       }

       tep_db_query("update " . TABLE_SPECIALS . " set specials_new_products_price = '" . tep_db_input($specials_price) . "', specials_last_modified = now(), expires_date = '" . tep_db_input($expires_date) . "' where specials_id = '" . (int)$specials_id . "'");

       tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials_id));
       break;
     case 'deleteconfirm':
       $specials_id = tep_db_prepare_input($HTTP_GET_VARS['sID']);

       tep_db_query("delete from " . TABLE_SPECIALS . " where specials_id = '" . (int)$specials_id . "'");

       tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));
       break;
   }
 }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
<?php
 if ( ($action == 'new') || ($action == 'edit') ) {
?>
<link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">
<script language="JavaScript" src="includes/javascript/calendarcode.js"></script>
<?php
 }
?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<div id="popupcalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
<?php
 if ( ($action == 'new') || ($action == 'edit') ) {
   $form_action = 'insert';
   if ( ($action == 'edit') && isset($HTTP_GET_VARS['sID']) ) {
     $form_action = 'update';

     $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, s.specials_new_products_price, s.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id and s.specials_id = '" . (int)$HTTP_GET_VARS['sID'] . "'");
     $product = tep_db_fetch_array($product_query);

     $sInfo = new objectInfo($product);
   } else {
     $sInfo = new objectInfo(array());

// create an array of products on special, which will be excluded from the pull down menu of products
// (when creating a new product on special)
     $specials_array = array();
   $specials_query = tep_db_query("select p.products_id, s.customers_group_id from " .  TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id");
   while ($specials = tep_db_fetch_array($specials_query)) {
      $specials_array[] = (int)$specials['products_id'].":".(int)$specials['customers_group_id'];
   }

   $customers_groups_query = tep_db_query("select distinct customers_group_name, customers_group_id from " . TABLE_CUSTOMERS . " order by customers_group_id ");
   $input_groups=array();
   $all_groups=array();
   while ($existing_groups =  tep_db_fetch_array($customers_groups_query)) {
       $input_groups[$sde++]=array("id"=>$existing_groups['customers_group_id'], "text"=> $existing_groups['customers_group_name']);
       $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
   }

   if(isset($HTTP_GET_VARS['sID']) && $sInfo->customers_group_id!=0){
       $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $sInfo->products_id . "' and customers_group_id =  '" . $sInfo->customers_group_id . "'");
         if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
           $sInfo->products_price = $customer_group_price['customers_group_price'];
         }
   }
?>
     <tr><form name="new_special" <?php echo 'action="' . tep_href_link(FILENAME_SPECIALS, tep_get_all_get_params(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('specials_id', $HTTP_GET_VARS['sID']); ?>
       <td><br><table border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><?php echo TEXT_SPECIALS_PRODUCT; ?> </td>
           <td class="main"><?php echo (isset($sInfo->products_name)) ? $sInfo->products_name . ' <small>(' . $currencies->format($sInfo->products_price) . ')</small>' : tep_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array); echo tep_draw_hidden_field('products_price', (isset($sInfo->products_price) ? $sInfo->products_price : '')); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo TEXT_SPECIALS_GROUPS; ?> </td>
           <td class="main"><?php echo tep_draw_pull_down_menu('customers_group', $input_groups, (isset($sInfo->customers_group_id)?$sInfo->customers_group_id:''));?> </td>
         </tr>
         <tr>
           <td class="main"><?php echo TEXT_SPECIALS_SPECIAL_PRICE; ?> </td>
           <td class="main"><?php echo tep_draw_input_field('specials_price', (isset($sInfo->specials_new_products_price) ? $sInfo->specials_new_products_price : '')); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo TEXT_SPECIALS_EXPIRES_DATE; ?> </td>
           <td class="main"><?php echo tep_draw_input_field('day', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 8, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 5, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 4) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="javascript:calClick();return false;" onmouseover="calSwapImg('BTN_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_special','dteWhen','BTN_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_date"'); ?></a></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><br><?php echo TEXT_SPECIALS_PRICE_TIP; ?></td>
           <td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '   <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['sID']) ? '&sID=' . $HTTP_GET_VARS['sID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
         </tr>
       </table></td>
     </form></tr>
<?php
 } else {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr class="dataTableHeadingRow">
               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRODUCTS_PRICE; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
             </tr>
<?php
   $all_groups=array();
   $customers_groups_query = tep_db_query("select distinct customers_group_name, customers_group_id from " . TABLE_CUSTOMERS . " order by customers_group_id ");
   while ($existing_groups =  tep_db_fetch_array($customers_groups_query)) {
     $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
   }

   $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, s.specials_id, s.customers_group_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id order by pd.products_name";
   $specials_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $specials_query_raw, $specials_query_numrows);
   $specials_query = tep_db_query($specials_query_raw);
   while ($specials = tep_db_fetch_array($specials_query)) {
     if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $specials['specials_id']))) && !isset($sInfo)) {
       $products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$specials['products_id'] . "'");
       $products = tep_db_fetch_array($products_query);
       $sInfo_array = array_merge($specials, $products);
       $sInfo = new objectInfo($sInfo_array);
     }

     if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) {
       echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '\'">' . "\n";
     } else {
       echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . '\'">' . "\n";
     }
     $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $specials['products_id']. "' and customers_group_id =  '" . $sInfo->customers_group_id . "'");
     if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query))
         $sInfo->products_price=$specials['products_price']=$scustomer_group_price['customers_group_price'];
?>
               <td  class="dataTableContent"><?php echo $specials['products_name']; ?></td>
               <td  class="dataTableContent" align="right"><span class="oldPrice"><?php echo $currencies->format($specials['products_price']); ?></span> <span class="specialPrice"><?php echo $currencies->format($specials['specials_new_products_price'])." (".$all_groups[$specials['customers_group_id']].")"; ?></span></td>
               <td  class="dataTableContent" align="right">
<?php
     if ($specials['status'] == '1') {
       echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  <a href="' . tep_href_link(FILENAME_SPECIALS, 'action=setflag&flag=0&id=' . $specials['specials_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
     } else {
       echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'action=setflag&flag=1&id=' . $specials['specials_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
     }
?></td>
               <td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
     </tr>
<?php
   }
?>
             <tr>
               <td colspan="4"><table border="0" width="100%" cellpadding="0"cellspacing="2">
                 <tr>
                   <td class="smallText" valign="top"><?php echo $specials_split->display_count($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></td>
                   <td class="smallText" align="right"><?php echo $specials_split->display_links($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
                 </tr>
<?php
 if (empty($action)) {
?>
                 <tr>
                   <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>
                 </tr>
<?php
 }
?>
               </table></td>
             </tr>
           </table></td>
<?php
 $heading = array();
 $contents = array();

 switch ($action) {
   case 'delete':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SPECIALS . '</b>');

     $contents = array('form' => tep_draw_form('specials', FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=deleteconfirm'));
     $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
     $contents[] = array('text' => '<br><b>' . $sInfo->products_name . '</b>');
     $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
   default:
     if (is_object($sInfo)) {
       $heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>');

       $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
       $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->specials_date_added));
       $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($sInfo->specials_last_modified));
       $contents[] = array('align' => 'center', 'text' => '<br>' . tep_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
       $contents[] = array('text' => '<br>' . TEXT_INFO_ORIGINAL_PRICE . ' ' . $currencies->format($sInfo->products_price));
       $contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE . ' ' . $currencies->format($sInfo->specials_new_products_price));
       $contents[] = array('text' => '' . TEXT_INFO_PERCENTAGE . ' ' . number_format(100 - (($sInfo->specials_new_products_price / $sInfo->products_price) * 100)) . '%');

       $contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . tep_date_short($sInfo->expires_date) . '</b>');
       $contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . tep_date_short($sInfo->date_status_change));
     }
     break;
 }
 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
   echo '            <td width="25%" valign="top">' . "\n";

   $box = new box;
   echo $box->infoBox($heading, $contents);

   echo '            </td>' . "\n";
 }
}
?>
         </tr>
       </table></td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

Hi Thankz for response...

 

first, there is no empty line or blank sign after the last ?>

 

 

second, i?ve make a control of all sites which i?ve edited, but i did not find a fault.

 

I can create groups and can put a customer in a group. I can assign prices to special groups and everything works well with exeption of the Specials point.

 

quest is: the last File which must edit is it the catalog/includes/classes/shopping_card.php ot the

admin/includes/classes/shopping_card.php

 

I?ve done it first for the catalog/... after that I?ve made step back and edit the admin/... file

In both cases the result is the same, that brings me to the conviction, that the error must lie elsewhere.....

 

 

This is my admin/specials.php:

<?php
/*
?$Id: specials.php,v 1.41 2003/06/29 22:50:52 hpdl Exp $

?osCommerce, Open Source E-Commerce Solutions
?http://www.oscommerce.com

?Copyright (c) 2003 osCommerce

?Released under the GNU General Public License
*/

?require('includes/application_top.php');

?require(DIR_WS_CLASSES . 'currencies.php');
?$currencies = new currencies();

?$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

?if (tep_not_null($action)) {
? ?switch ($action) {
? ? ?case 'setflag':
? ? ? ?tep_set_specials_status($HTTP_GET_VARS['id'], $HTTP_GET_VARS['flag']);

? ? ? ?tep_redirect(tep_href_link(FILENAME_SPECIALS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'sID=' . $HTTP_GET_VARS['id'], 'NONSSL'));
? ? ? ?break;
? ? ?case 'insert':
? ? ? ?$products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
? ? ? ?$products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);
? ? ? ?$specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
? ? ? ?$day = tep_db_prepare_input($HTTP_POST_VARS['day']);
? ? ? ?$month = tep_db_prepare_input($HTTP_POST_VARS['month']);
? ? ? ?$year = tep_db_prepare_input($HTTP_POST_VARS['year']);
? ? ? ?$customers_group=tep_db_prepare_input($HTTP_POST_VARS['customers_group']);
? ? ? ?$price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS. " WHERE products_id = ".(int)$products_id . " AND customers_group_id ?= ".(int)$customers_group);
? ? ? ?while ($gprices = ?tep_db_fetch_array($price_query)) {
? ? ? ? ? ?$products_price=$gprices['customers_group_price'];
? ? ? ?}

? ? ? ?if (substr($specials_price, -1) == '%') {
? ? ? ? ?$new_special_insert_query = tep_db_query("select products_id, products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
? ? ? ? ?$new_special_insert = tep_db_fetch_array($new_special_insert_query);

? ? ? ? ?$products_price = $new_special_insert['products_price'];
? ? ? ? ?$specials_price = ($products_price - (($specials_price / 100) * $products_price));
? ? ? ?}

? ? ? ?$expires_date = '';
? ? ? ?if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
? ? ? ? ?$expires_date = $year;
? ? ? ? ?$expires_date .= (strlen($month) == 1) ? '0' . $month : $month;
? ? ? ? ?$expires_date .= (strlen($day) == 1) ? '0' . $day : $day;
? ? ? ?}

? ? ? ?tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status, customers_group_id) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '1', ".(int)$customers_group.")");

? ? ? ?tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));
? ? ? ?break;
? ? ?case 'update':
? ? ? ?$specials_id = tep_db_prepare_input($HTTP_POST_VARS['specials_id']);
? ? ? ?$products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);
? ? ? ?$specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
? ? ? ?$day = tep_db_prepare_input($HTTP_POST_VARS['day']);
? ? ? ?$month = tep_db_prepare_input($HTTP_POST_VARS['month']);
? ? ? ?$year = tep_db_prepare_input($HTTP_POST_VARS['year']);

? ? ? ?if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price));

? ? ? ?$expires_date = '';
? ? ? ?if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
? ? ? ? ?$expires_date = $year;
? ? ? ? ?$expires_date .= (strlen($month) == 1) ? '0' . $month : $month;
? ? ? ? ?$expires_date .= (strlen($day) == 1) ? '0' . $day : $day;
? ? ? ?}

? ? ? ?tep_db_query("update " . TABLE_SPECIALS . " set specials_new_products_price = '" . tep_db_input($specials_price) . "', specials_last_modified = now(), expires_date = '" . tep_db_input($expires_date) . "' where specials_id = '" . (int)$specials_id . "'");

? ? ? ?tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials_id));
? ? ? ?break;
? ? ?case 'deleteconfirm':
? ? ? ?$specials_id = tep_db_prepare_input($HTTP_GET_VARS['sID']);

? ? ? ?tep_db_query("delete from " . TABLE_SPECIALS . " where specials_id = '" . (int)$specials_id . "'");

? ? ? ?tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));
? ? ? ?break;
? ?}
?}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
<?php
?if ( ($action == 'new') || ($action == 'edit') ) {
?>
<link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">
<script language="JavaScript" src="includes/javascript/calendarcode.js"></script>
<?php
?}
?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<div id="popupcalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
?<tr>
? ?<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
? ?</table></td>
<!-- body_text //-->
? ?<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
? ? ?<tr>
? ? ? ?<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
? ? ? ? ? ?<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
? ? ? ? ?</tr>
? ? ? ?</table></td>
? ? ?</tr>
<?php
?if ( ($action == 'new') || ($action == 'edit') ) {
? ?$form_action = 'insert';
? ?if ( ($action == 'edit') && isset($HTTP_GET_VARS['sID']) ) {
? ? ?$form_action = 'update';

? ? ?$product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, s.specials_new_products_price, s.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id and s.specials_id = '" . (int)$HTTP_GET_VARS['sID'] . "'");
? ? ?$product = tep_db_fetch_array($product_query);

? ? ?$sInfo = new objectInfo($product);
? ?} else {
? ? ?$sInfo = new objectInfo(array());

// create an array of products on special, which will be excluded from the pull down menu of products
// (when creating a new product on special)
? ? ?$specials_array = array();
? ?$specials_query = tep_db_query("select p.products_id, s.customers_group_id from " . ?TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id");
? ?while ($specials = tep_db_fetch_array($specials_query)) {
? ? ? $specials_array[] = (int)$specials['products_id'].":".(int)$specials['customers_group_id'];
? ?}

? ?$customers_groups_query = tep_db_query("select distinct customers_group_name, customers_group_id from " . TABLE_CUSTOMERS . " order by customers_group_id ");
? ?$input_groups=array();
? ?$all_groups=array();
? ?while ($existing_groups = ?tep_db_fetch_array($customers_groups_query)) {
? ? ? ?$input_groups[$sde++]=array("id"=>$existing_groups['customers_group_id'], "text"=> $existing_groups['customers_group_name']);
? ? ? ?$all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
? ?}

? ?if(isset($HTTP_GET_VARS['sID']) && $sInfo->customers_group_id!=0){
? ? ? ?$customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $sInfo->products_id . "' and customers_group_id = ?'" . $sInfo->customers_group_id . "'");
? ? ? ? ?if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
? ? ? ? ? ?$sInfo->products_price = $customer_group_price['customers_group_price'];
? ? ? ? ?}
? ?}
?>
? ? ?<tr><form name="new_special" <?php echo 'action="' . tep_href_link(FILENAME_SPECIALS, tep_get_all_get_params(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('specials_id', $HTTP_GET_VARS['sID']); ?>
? ? ? ?<td><br><table border="0" cellspacing="0" cellpadding="2">
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><?php echo TEXT_SPECIALS_PRODUCT; ?> </td>
? ? ? ? ? ?<td class="main"><?php echo (isset($sInfo->products_name)) ? $sInfo->products_name . ' <small>(' . $currencies->format($sInfo->products_price) . ')</small>' : tep_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array); echo tep_draw_hidden_field('products_price', (isset($sInfo->products_price) ? $sInfo->products_price : '')); ?></td>
? ? ? ? ?</tr>
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><?php echo TEXT_SPECIALS_GROUPS; ?> </td>
? ? ? ? ? ?<td class="main"><?php echo tep_draw_pull_down_menu('customers_group', $input_groups, (isset($sInfo->customers_group_id)?$sInfo->customers_group_id:''));?> </td>
? ? ? ? ?</tr>
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><?php echo TEXT_SPECIALS_SPECIAL_PRICE; ?> </td>
? ? ? ? ? ?<td class="main"><?php echo tep_draw_input_field('specials_price', (isset($sInfo->specials_new_products_price) ? $sInfo->specials_new_products_price : '')); ?></td>
? ? ? ? ?</tr>
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><?php echo TEXT_SPECIALS_EXPIRES_DATE; ?> </td>
? ? ? ? ? ?<td class="main"><?php echo tep_draw_input_field('day', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 8, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 5, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 4) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="javascript:calClick();return false;" onmouseover="calSwapImg('BTN_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_special','dteWhen','BTN_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_date"'); ?></a></td>
? ? ? ? ?</tr>
? ? ? ?</table></td>
? ? ?</tr>
? ? ?<tr>
? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><br><?php echo TEXT_SPECIALS_PRICE_TIP; ?></td>
? ? ? ? ? ?<td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '   <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['sID']) ? '&sID=' . $HTTP_GET_VARS['sID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
? ? ? ? ?</tr>
? ? ? ?</table></td>
? ? ?</form></tr>
<?php
?} else {
?>
? ? ?<tr>
? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
? ? ? ? ?<tr>
? ? ? ? ? ?<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
? ? ? ? ? ? ?<tr class="dataTableHeadingRow">
? ? ? ? ? ? ? ?<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
? ? ? ? ? ? ? ?<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRODUCTS_PRICE; ?></td>
? ? ? ? ? ? ? ?<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
? ? ? ? ? ? ? ?<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
? ? ? ? ? ? ?</tr>
<?php
? ?$all_groups=array();
? ?$customers_groups_query = tep_db_query("select distinct customers_group_name, customers_group_id from " . TABLE_CUSTOMERS . " order by customers_group_id ");
? ?while ($existing_groups = ?tep_db_fetch_array($customers_groups_query)) {
? ? ?$all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
? ?}

? ?$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, s.specials_id, s.customers_group_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id order by pd.products_name";
? ?$specials_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $specials_query_raw, $specials_query_numrows);
? ?$specials_query = tep_db_query($specials_query_raw);
? ?while ($specials = tep_db_fetch_array($specials_query)) {
? ? ?if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $specials['specials_id']))) && !isset($sInfo)) {
? ? ? ?$products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$specials['products_id'] . "'");
? ? ? ?$products = tep_db_fetch_array($products_query);
? ? ? ?$sInfo_array = array_merge($specials, $products);
? ? ? ?$sInfo = new objectInfo($sInfo_array);
? ? ?}

? ? ?if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) {
? ? ? ?echo ' ? ? ? ? ? ? ? ? ?<tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '\'">' . "\n";
? ? ?} else {
? ? ? ?echo ' ? ? ? ? ? ? ? ? ?<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . '\'">' . "\n";
? ? ?}
? ? ?$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $specials['products_id']. "' and customers_group_id = ?'" . $sInfo->customers_group_id . "'");
? ? ?if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query))
? ? ? ? ?$sInfo->products_price=$specials['products_price']=$scustomer_group_price['customers_group_price'];
?>
? ? ? ? ? ? ? ?<td ?class="dataTableContent"><?php echo $specials['products_name']; ?></td>
? ? ? ? ? ? ? ?<td ?class="dataTableContent" align="right"><span class="oldPrice"><?php echo $currencies->format($specials['products_price']); ?></span> <span class="specialPrice"><?php echo $currencies->format($specials['specials_new_products_price'])." (".$all_groups[$specials['customers_group_id']].")"; ?></span></td>
? ? ? ? ? ? ? ?<td ?class="dataTableContent" align="right">
<?php
? ? ?if ($specials['status'] == '1') {
? ? ? ?echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  <a href="' . tep_href_link(FILENAME_SPECIALS, 'action=setflag&flag=0&id=' . $specials['specials_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
? ? ?} else {
? ? ? ?echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'action=setflag&flag=1&id=' . $specials['specials_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
? ? ?}
?></td>
? ? ? ? ? ? ? ?<td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
? ? ?</tr>
<?php
? ?}
?>
? ? ? ? ? ? ?<tr>
? ? ? ? ? ? ? ?<td colspan="4"><table border="0" width="100%" cellpadding="0"cellspacing="2">
? ? ? ? ? ? ? ? ?<tr>
? ? ? ? ? ? ? ? ? ?<td class="smallText" valign="top"><?php echo $specials_split->display_count($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></td>
? ? ? ? ? ? ? ? ? ?<td class="smallText" align="right"><?php echo $specials_split->display_links($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
? ? ? ? ? ? ? ? ?</tr>
<?php
?if (empty($action)) {
?>
? ? ? ? ? ? ? ? ?<tr>
? ? ? ? ? ? ? ? ? ?<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>
? ? ? ? ? ? ? ? ?</tr>
<?php
?}
?>
? ? ? ? ? ? ? ?</table></td>
? ? ? ? ? ? ?</tr>
? ? ? ? ? ?</table></td>
<?php
?$heading = array();
?$contents = array();

?switch ($action) {
? ?case 'delete':
? ? ?$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SPECIALS . '</b>');

? ? ?$contents = array('form' => tep_draw_form('specials', FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=deleteconfirm'));
? ? ?$contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
? ? ?$contents[] = array('text' => '<br><b>' . $sInfo->products_name . '</b>');
? ? ?$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
? ? ?break;
? ?default:
? ? ?if (is_object($sInfo)) {
? ? ? ?$heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>');

? ? ? ?$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
? ? ? ?$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->specials_date_added));
? ? ? ?$contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($sInfo->specials_last_modified));
? ? ? ?$contents[] = array('align' => 'center', 'text' => '<br>' . tep_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
? ? ? ?$contents[] = array('text' => '<br>' . TEXT_INFO_ORIGINAL_PRICE . ' ' . $currencies->format($sInfo->products_price));
? ? ? ?$contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE . ' ' . $currencies->format($sInfo->specials_new_products_price));
? ? ? ?$contents[] = array('text' => '' . TEXT_INFO_PERCENTAGE . ' ' . number_format(100 - (($sInfo->specials_new_products_price / $sInfo->products_price) * 100)) . '%');

? ? ? ?$contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . tep_date_short($sInfo->expires_date) . '</b>');
? ? ? ?$contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . tep_date_short($sInfo->date_status_change));
? ? ?}
? ? ?break;
?}
?if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
? ?echo ' ? ? ? ? ? ?<td width="25%" valign="top">' . "\n";

? ?$box = new box;
? ?echo $box->infoBox($heading, $contents);

? ?echo ' ? ? ? ? ? ?</td>' . "\n";
?}
}
?>
? ? ? ? ?</tr>
? ? ? ?</table></td>
? ? ?</tr>
? ?</table></td>
<!-- body_text_eof //-->
?</tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

I have this error:

 

Parse error: parse error, unexpected T_ELSE in c:\programmi\easyphp\www\fiorucciricambi\admin\hs~special.php on line 195

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...