Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to change the product price in shopping cart ?


valley

Recommended Posts

Hello,

 

Shall appreciate some help from the OSC experts on this.

 

I am trying to implement a contribution which needs to change the product price

in the shopping cart to different one passed on by this contribution.

 

Currently this additional code in the application_top passes on

the new price as "final price" and changes the SUB TOTAL but not the

actual product price.

// performed by the 'add_happy' button in Happy_hours_specials_advanced box
	case 'add_happy' :	if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
							 $cart->add_cart_happy($_POST['products_id'], $cart->get_quantity($_POST['products_id'])+1, $_POST['flash'],  $HTTP_POST_VARS['id']);

						  }

						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;

// End Happy Hours Specials Advanced price

 

 

Here is the add_cart_happy function added to classes/shopping cart

 

	}
  // Begin Happy Hours Specials Advanced add

function add_cart_happy($products_id, $qty = '1', $happy , $attributes = '', $notify = true) {
  global $new_products_id_in_cart, $customer_id;

  $products_id = tep_get_uprid($products_id, $attributes);
  if ($notify == true) {
	$new_products_id_in_cart = $products_id;
	tep_session_register('new_products_id_in_cart');
  }

  if ($this->in_cart($products_id)) {
	$this->update_quantity($products_id, $qty, $attributes);
  } else {
	$this->contents[] = array($products_id);
	$this->contents[$products_id] = array('qty' => $qty);


// insert into database
	if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added, final_price ) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "', '" . $happy . "')");

	if (is_array($attributes)) {
	  reset($attributes);
	  while (list($option, $value) = each($attributes)) {
		$this->contents[$products_id]['attributes'][$option] = $value;
// insert into database
		if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");
	  }
	}
  }
  $this->cleanup();

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
  $this->cartID = $this->generate_cart_id();
}

/// End Happy Hours Specials Advanced add

 

 

The new price is inserted in to the database as "Final price" by this querry

 

 if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added, final_price ) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "', '" . $happy . "')");

 

I have checked the customers_basket table and can see no product price. Obviously

it is inserted from elsewhere. Is there a way to intercept this and alter by the new value ?

 

Below is an image which shows the situation with a product price and the

NEW price as the SUB TOTAL

 

 

Auction_price.gif

Link to comment
Share on other sites

I am trying to implement a contribution which needs to change the product price

in the shopping cart to different one passed on by this contribution.

 

I am not farmiliar with this contrib but I assume there should be more code than this.

Normally the shopping cart does not hold prices as it gathers those from the product table if needed.

The database shopping cart is just a mirror of the session cart and is only used when a customer is signed in. Guests have no database cart.

Treasurer MFC

Link to comment
Share on other sites

I am not farmiliar with this contrib but I assume there should be more code than this.

Normally the shopping cart does not hold prices as it gathers those from the product table if needed.

The database shopping cart is just a mirror of the session cart and is only used when a customer is signed in. Guests have no database cart.

 

Hello Amanda,

 

Many thanks for the quick reply.

 

I have rechecked the install file and can find only the additional code below

EN: Add following in includes/classes/shopping_cart.php
DE: Folgenden Code in includes/classes/shopping_cart.php  einf?gen


Below /unterhalb von  

Between  / zwischen  

line213

 function calculate() {
and / und
$this->total = 0;

// Begin Happy Hours Specials Advanced add
global  $customer_country_id, $customer_zone_id, $customer_id;
// End Happy Hours Specials Advanced add


EN: Add following in includes/classes/shopping_cart.php in function calculate
DE: Folgenden Code in includes/classes/shopping_cart.php  einf?gen in function calculate


below/unter 

	  $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
	  if (tep_db_num_rows ($specials_query)) {
		$specials = tep_db_fetch_array($specials_query);
		$products_price = $specials['specials_new_products_price'];
	  }
line235

// Begin Happy Hours Specials Advanced add
				if (tep_session_is_registered('customer_id')) {
	  $happy_query = tep_db_query("SELECT final_price from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "' and products_id = '" . (int)$products_id . "'");
	  if (tep_db_num_rows($happy_query)) {
				while($happyerg=tep_db_fetch_array($happy_query)) {
					   $products_price_happy = $happyerg[final_price];
					   		if($products_price_happy > 0) {
			 			 $products_price = $products_price_happy;
				}
				}
				}
				}
/// End Happy Hours Specials Advanced add






EN: Add following in includes/classes/shopping_cart.php in function get_products
DE: Folgenden Code in includes/classes/shopping_cart.php  einf?gen in function get_products


below/unter 

	  $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
	  if (tep_db_num_rows($specials_query)) {
		$specials = tep_db_fetch_array($specials_query);
		$products_price = $specials['specials_new_products_price'];
	  }

line 293 

// ----------- Start Happy Hours Specials Advanced  price
	$happy_query = tep_db_query("select final_price from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . (int)$prid . "'");
	if (tep_db_num_rows($happy_query)) {
		$happy = tep_db_fetch_array($happy_query);
		if ($happy['final_price'] > 0) {
				$products_price = $happy['final_price'];
		}
	}
// ----------- End Happy Hours Specials Advanced price


EN: Add following in includes/classes/shopping_cart.php
DE: Folgenden Code in includes/classes/shopping_cart.php  einf?gen


Below /unterhalb von  

Between  / zwischen  

line213

 function calculate() {
and / und
$this->total = 0;

// Begin Happy Hours Specials Advanced add
global  $customer_country_id, $customer_zone_id, $customer_id;
// End Happy Hours Specials Advanced add


EN: Add following in includes/classes/shopping_cart.php in function calculate
DE: Folgenden Code in includes/classes/shopping_cart.php  einf?gen in function calculate


below/unter 

	  $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
	  if (tep_db_num_rows ($specials_query)) {
		$specials = tep_db_fetch_array($specials_query);
		$products_price = $specials['specials_new_products_price'];
	  }
line235

// Begin Happy Hours Specials Advanced add
				if (tep_session_is_registered('customer_id')) {
	  $happy_query = tep_db_query("SELECT final_price from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "' and products_id = '" . (int)$products_id . "'");
	  if (tep_db_num_rows($happy_query)) {
				while($happyerg=tep_db_fetch_array($happy_query)) {
					   $products_price_happy = $happyerg[final_price];
					   		if($products_price_happy > 0) {
			 			 $products_price = $products_price_happy;
				}
				}
				}
				}
/// End Happy Hours Specials Advanced add






EN: Add following in includes/classes/shopping_cart.php in function get_products
DE: Folgenden Code in includes/classes/shopping_cart.php  einf?gen in function get_products


below/unter 

	  $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
	  if (tep_db_num_rows($specials_query)) {
		$specials = tep_db_fetch_array($specials_query);
		$products_price = $specials['specials_new_products_price'];
	  }

line 293 

// ----------- Start Happy Hours Specials Advanced  price
	$happy_query = tep_db_query("select final_price from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . (int)$prid . "'");
	if (tep_db_num_rows($happy_query)) {
		$happy = tep_db_fetch_array($happy_query);
		if ($happy['final_price'] > 0) {
				$products_price = $happy['final_price'];
		}
	}
// ----------- End Happy Hours Specials Advanced price

 

In any case it only changes the FINAL PRICE and not the product price.

 

Can you tell me where is the function call which inserts the product price

from the database (as in this case the customer must be registered) in to the cart.

 

I could only see this in shopping art.php

 

<?php
 if ($cart->count_contents() > 0) {
?>
  <tr>
	<td><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>
	<table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php>

 

Best regards

Shred

Link to comment
Share on other sites

I could only see this in shopping art.php

 

<?php
 if ($cart->count_contents() > 0) {
?>
  <tr>
	<td><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>
	<table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php>

 

Best regards

Shred

 

Sorry for the double posting of code. I just looked at and realise that

the code actually modes the function_calculate to insert the FINAL PRICE

inserted by the add_happy button (call in application_top.php) in to the

customer_basket table.

It looks like the author forgot to call the function_calculate somewhere

to then update the product price.

 

Am I on the right track here ?

 

How can I then improve on the Happy_button to include the function_calculate

and page refresh ?

As you can imagine I know nothing about php coding

 

Cheers

Shred

Link to comment
Share on other sites

I could only see this in shopping art.php

 

<?php
 if ($cart->count_contents() > 0) {
?>
  <tr>
	<td><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>
	<table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php>

 

in the shopping cart class there are two relevant functions:

 

calculate() which determines the total price and weight

get_products() which returns an array of the products in the cart.

 

both functions query the products table for the price and other stuff first.

So if you want to override that value you will have to do it there after that query and change the way

the totals and the final price are determined.

The cart itself only holds (remembers) the product id and the quantity.

Treasurer MFC

Link to comment
Share on other sites

in the shopping cart class there are two relevant functions:

 

calculate() which determines the total price and weight

get_products() which returns an array of the products in the cart.

 

both functions query the products table for the price and other stuff first.

So if you want to override that value you will have to do it there after that query and change the way

the totals and the final price are determined.

The cart itself only holds (remembers) the product id and the quantity.

 

Hello Amanda,

 

Many thanks for the reply.

 

It looks like that is what exactly what the author has done. Please see

the modified calculate() anmd get_products() functions in the classes/shopping_cart.php

 

  function calculate() {
  // Begin Happy Hours Specials Advanced add
 global  $customer_country_id, $customer_zone_id, $customer_id;
 // End Happy Hours Specials Advanced add
  $this->total = 0;
  $this->weight = 0;
  if (!is_array($this->contents)) return 0;

  reset($this->contents);
  while (list($products_id, ) = each($this->contents)) {
	$qty = $this->contents[$products_id]['qty'];

// products price
	$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id='" . tep_get_prid($products_id) . "'");
	if ($product = tep_db_fetch_array($product_query)) {
	  $prid = $product['products_id'];
	  $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
	  $products_price = $product['products_price'];
	  $products_weight = $product['products_weight'];

	  $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $prid . "' and status = '1'");
	  if (tep_db_num_rows ($specials_query)) {
		$specials = tep_db_fetch_array($specials_query);
		$products_price = $specials['specials_new_products_price'];
	  }
	  // Begin Happy Hours Specials Advanced add
	  if (tep_session_is_registered('customer_id')) {
	  $happy_query = tep_db_query("SELECT final_price from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "' and products_id = '" . (int)$products_id . "'");
  if (tep_db_num_rows($happy_query)) {
	  while($happyerg=tep_db_fetch_array($happy_query)) {
					   $products_price_happy = $happyerg[final_price];
			   if($products_price_happy > 0) {
					$products_price = $products_price_happy;
				}
	  }
	  }
	  }
	  /// End Happy Hours Specials Advanced add
	  $this->total += tep_add_tax($products_price, $products_tax) * $qty;
	  $this->weight += ($qty * $products_weight);
	}

// attributes price
	if (isset($this->contents[$products_id]['attributes'])) {
	 for ($cont = 0; $cont < sizeof($this->contents[$products_id]['attributes']); $cont++) {
	  reset($this->contents[$products_id]['attributes'][$cont]);
	  while (list($option, $value) = each($this->contents[$products_id]['attributes'][$cont])) {
		$attribute_price_query = tep_db_query("select options_values_qty, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $prid . "' and options_id = '" . $option . "' and options_values_id = '" . $value . "'");
		$attribute_price = tep_db_fetch_array($attribute_price_query);
		if (strchr($attribute_price['price_prefix'],'+')) {
		  $this->total += $qty * tep_add_tax(tep_prefix_options($attribute_price['price_prefix'],$attribute_price['options_values_price'],$attribute_price['options_values_qty'],$qty), $products_tax);
		} else if (strchr($attribute_price['price_prefix'],'-')) {
		  $this->total -= $qty * tep_add_tax(tep_prefix_options($attribute_price['price_prefix'],$attribute_price['options_values_price'],$attribute_price['options_values_qty'],$qty), $products_tax);
		}
		}
	  }
	}
  }
}

function attributes_price($products_id) {
  if (isset($this->contents[$products_id]['attributes'])) {
   for ($cont = 0; $cont < sizeof($this->contents[$products_id]['attributes']); $cont++) {
	reset($this->contents[$products_id]['attributes'][$cont]);
	while (list($option, $value) = each($this->contents[$products_id]['attributes'][$cont])) {
	  $attribute_price_query = tep_db_query("select options_values_qty, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_id . "' and options_id = '" . $option . "' and options_values_id = '" . $value . "'");
	  $attribute_price = tep_db_fetch_array($attribute_price_query);
	  if (strchr($attribute_price['price_prefix'],'+')) {
		$attributes_price += tep_prefix_options($attribute_price['price_prefix'],$attribute_price['options_values_price'],$attribute_price['options_values_qty'],$this->contents[$products_id]['qty']);
	  } else if (strchr($attribute_price['price_prefix'],'-')) {
		$attributes_price -= tep_prefix_options($attribute_price['price_prefix'],$attribute_price['options_values_price'],$attribute_price['options_values_qty'],$this->contents[$products_id]['qty']);
	  }
	  }
	}
  }

  return $attributes_price;
}

function get_products() {
  global $languages_id;

  if (!is_array($this->contents)) return false;

  $products_array = array();
  reset($this->contents);
  while (list($products_id, ) = each($this->contents)) {
	$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='" . tep_get_prid($products_id) . "' and pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "'");
	if ($products = tep_db_fetch_array($products_query)) {
	  $prid = $products['products_id'];
	  $products_price = $products['products_price'];

	  $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $prid . "' and status = '1'");
	  if (tep_db_num_rows($specials_query)) {
		$specials = tep_db_fetch_array($specials_query);
		$products_price = $specials['specials_new_products_price'];
	  }
	  // ----------- Start Happy Hours Specials Advanced  price
$happy_query = tep_db_query("select final_price from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . (int)$prid . "'");
if (tep_db_num_rows($happy_query)) {
		$happy = tep_db_fetch_array($happy_query);
  if ($happy['final_price'] > 0) {
	  $products_price = $happy['final_price'];
  }
}
// ----------- End Happy Hours Specials Advanced price
	  $products_array[] = array('id' => $products_id,
								'name' => $products['products_name'],
								'model' => $products['products_model'],
								'price' => $products_price,
								'quantity' => $this->contents[$products_id]['qty'],
								'weight' => $products['products_weight'],
								'final_price' => ($products_price + $this->attributes_price($products_id)),
								'tax_class_id' => $products['products_tax_class_id'],
								'attributes' => $this->contents[$products_id]['attributes']);
	}
  }

  return $products_array;
}

 

However the update doesn't occur. Could it be because the update of the

basket table and the above function calls occure concurrently?

How Can I force a refresh of the table before these functions are called.

 

Or am I missing something else

 

Cheers

Shred

Link to comment
Share on other sites

It looks like that is what exactly what the author has done. Please see

the modified calculate() anmd get_products() functions in the classes/shopping_cart.php

 

However the update doesn't occur. Could it be because the update of the

basket table and the above function calls occure concurrently?

How Can I force a refresh of the table before these functions are called.

looks like the query in get_products misses the customer_id in the where clause.

Treasurer MFC

Link to comment
Share on other sites

looks like the query in get_products misses the customer_id in the where clause.

 

Hello Amanda

 

I have modified the querry to

 

$happy_query = tep_db_query("select final_price from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "' and where products_id = '" . (int)$prid . "'");

 

and now get an error

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where products_id = '184'' at line 1

 

select final_price from customers_basket where customers_id = '' and where products_id = '184'

 

Any ideas ?

Link to comment
Share on other sites

Hello Amanda

 

I have modified the querry to

 

$happy_query = tep_db_query("select final_price from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "' and where products_id = '" . (int)$prid . "'");

 

and now get an error

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where products_id = '184'' at line 1

 

select final_price from customers_basket where customers_id = '' and where products_id = '184'

 

Any ideas ?

 

 

OK , I have removed the second "where" from the querry and the error message is gone.

However the Price do not change. The SUB TOTAL is correct with the new value prompltly

entered.

 

Cheers

Shred

Link to comment
Share on other sites

and where

 

remove "where"

 

 

Do you mean the second "where" ? This was already done and

there are no more Database error.

 

It looks like the Calculate function works oK as the TOTAL seems to be

the NEW figure.

 

IT is the Get_products () that is not getting corrected

Link to comment
Share on other sites

Do you mean the second "where" ? This was already done and

there are no more Database error.

 

It looks like the Calculate function works oK as the TOTAL seems to be

the NEW figure.

 

IT is the Get_products () that is not getting corrected

 

do not forget to declare customer_id as global variable in function get_products()

Treasurer MFC

Link to comment
Share on other sites

do not forget to declare customer_id as global variable in function get_products()

 

FANTASTIC !

 

That seems to have fixed the problem

 

Many thanks for the help !

 

Shred

Link to comment
Share on other sites

FANTASTIC !

 

That seems to have fixed the problem

 

Many thanks for the help !

 

Shred

 

HEllo Amanda,

 

There a re a couple of things I would like to do withis contri

to make it more practical and interesting to customers.

 

Is there a way to reload the Auction infobox wth the same

product and the dropping price when the customer tries to

login ? That is in two steps first with the login page, secondly

once he has logged in.

 

Right now the customer will lose the item and price as a new

product is loaded with the starting price and will have to

refresh the page till the product loads up again (may not happen at all)

 

I guess the script and the auction info box will have to be modified.

 

Here is the current info box

<?php
/*
 $Id: specials.php,v 1.31 2003/06/09 22:21:03 hpdl Exp $
 R?ckw?rtsAuktion / Reverse Auction / Preishammer
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
$uhrzeit = date ("H:i:s");

 if ($random_product = tep_random_select("select p.products_id, p.products_quantity,pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, hhsa.specials_price_happy_hours from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_HAPPY_HOURS_SPECIALS_ADVANCED . " hhsa where p.products_status = '1' and p.products_id = hhsa.products_id and pd.products_id = hhsa.products_id and pd.language_id = '" . (int)$languages_id . "' and hhsa.status_happy_hours = '1' and '" . $uhrzeit . "' BETWEEN hhsa.happy_hours_beginning_time and hhsa.happy_hours_end_time and now() > hhsa.happy_hours_beginning_date and now() < hhsa.happy_hours_end_date order by hhsa.specials_date_added  ")) {
 /* $startprice =  $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); */
?>

<script src="includes/formular.js" type="text/javascript"></script>

<script language="javascript">
var StartPrice = "<?php echo $random_product['products_price'] * (1); ?>";
var EndPrice  = "<?php echo  $random_product['specials_price_happy_hours'] * (1); ?>";


var PriceVar =  StartPrice;

//EndPrice =  parseFloat(EndPrice.replace(",", "."));
var Vprice = <?php echo 0.024666666666667/(1000/ZAEHLGESCHWINDIGKEIT); ?>;
var ZaehlStop = false;

var flash = StartPrice - EndPrice;

startPriceCounter();
startSynchron();


//-->
</script>


<!-- happy_hours_specials_advanced //-->
<tr>
<td>

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_HAPPY_HOURS_ADVANCED);

new infoBoxHeading($info_box_contents, false, false);



$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
							 'text' => '<form name="cart_quantity' . $random_product['products_id'] . '" method="post" action="' . tep_href_link(FILENAME_SHOPPING_CART, tep_get_all_get_params(array('action')) . 'action=add_happy') . '">'./* '<img border="0" src= "http://affiliatesexcel.com/catalog/images/Linegoldbells.gif">'.'<br>' . */ BOX_HAPPY_HOURS_ADVANCED1 .$random_product['products_quantity']. '<br><br>' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><b>' . $random_product['products_name'] . '
							  </b><br>' . tep_get_products_small_desc($random_product['products_id']) .'<br><b> Qty available'. $random_product['products_quantity'].'</b>'.

							 '<br><b>' . BOX_HAPPY_HOURS_ADVANCED2  . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</b><br>
							  <table width="100%" border="0" cellspacing="0" cellpadding="0">
							  <tr>
							   <td class="happy_price" align="center"><br>Auction Price<br>' . tep_image(DIR_WS_IMAGES . 'infobox/happy_arrow_right.gif', '', '', '') . '
							 <input type="text" value="" name="flash" id="flash" class="happy_price" style="width: 65px; border: 0;" align="middle" readonly>' . 'GBP' .'
							  ' . tep_image(DIR_WS_IMAGES . 'infobox/happy_arrow_left.gif', '', '', '') . '				</td></tr><tr>
							 <td class="infoBoxContents" align="middle" ><br>' . BOX_HAPPY_HOURS_ADVANCED3 . '</td>
							 </tr>
							 </table>');	  
if (tep_session_is_registered('customer_id')) {
   $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="1"  align="center">
		  <tr>
			<td valign="top" align="center">' . tep_image(DIR_WS_IMAGES . 'infobox/happy_hammer.gif', '', '', '')
							  . tep_draw_hidden_field('products_id', $random_product['products_id']) . tep_draw_hidden_field('products_tax', tep_get_tax_rate($random_product['products_tax_class_id'])) .' <INPUT class=happy_button id=happybutton onclick=java script:ZaehlStop=true; type=submit value="' . BOX_HAPPY_HOURS_ADVANCED4 . '" name=happybutton></form></td>
		  </tr>
		  </table>');
  } else {
	$info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="0" align="center" >
		  <tr>
			<td valign="top" align="center"><a class="happy_button" href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . BOX_SPECIALS_HOUR_LOGIN . '</a></td>
		  </tr>
		  </table>');

	}

  new infoBox($info_box_contents);
?>

 </td>
 </tr>

<!-- happy_hours_specials_advanced_eof //-->
<?php

 }
?>

 

I guess the product Id andd the variable flash will have to

be stored and passed on with aconditional clause

 

Could you please give some ideas ?

 

Best regards

Shred

Link to comment
Share on other sites

  • 2 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...