Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

thanks Ga?tan Hermann to for his contirbution

 

http://www.oscommerce.com/community/contributions,3755

 

here is the probleme i got on a non updated ms2 :

 

the admin .

 

do y ou think u can advice me for a standart osc ?

 

also i thin in the install maybe there is an error , or it s because i have a ms2 not a updated one:

 

1) in catalog/shopping_cart.php

before:

  if ($cart->count_contents() > 0) {

add:

<?php
 if ($messageStack->size('shopping_cart') > 0) {
?>
  <tr>
	<td><?php echo $messageStack->output('shopping_cart'); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }

 

so before

if ($cart->count_contents() > 0) {

i got already a

<?php

so i cant open a new one

MS2

Posted

Hi,

Code must look like that:

 

<?php
 if ($messageStack->size('shopping_cart') > 0) {
?>
  <tr>
	<td><?php echo $messageStack->output('shopping_cart'); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }

 if ($cart->count_contents() > 0) {
?>

 

Kind regards

Ga?tan Hermann

 

thanks Ga?tan Hermann to for his contirbution

 

http://www.oscommerce.com/community/contributions,3755

 

here is the probleme i got on a non updated ms2 :

 

the admin .

 

do y ou think u can advice me for a standart osc ?

 

also i thin in the install maybe there is an error , or it s because i have a ms2 not a updated one:

 

1) in catalog/shopping_cart.php

before:

  if ($cart->count_contents() > 0) {

add:

<?php
 if ($messageStack->size('shopping_cart') > 0) {
?>
  <tr>
	<td><?php echo $messageStack->output('shopping_cart'); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }

 

so before

 

i got already a

<?php

so i cant open a new one



[quote][/quote]

Posted

THANKS FOR THE ANSWER

i tried your code , but still no erro, but even after fixed a limit in the admin , i add more in the cart, i got nothing happening , here is my code :

<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><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_image(DIR_WS_IMAGES . 'table_background_cart.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>

<?php // azerc 17fev06 Max Total Amount for Cart BOF ********************************** ?>
<?php
if ($messageStack->size('shopping_cart') > 0) {
?>
<tr>
<td><?php echo $messageStack->output('shopping_cart'); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
// azerc 17fev06 Max Total Amount for Cart EOF **********************************
if ($cart->count_contents() > 0) {
?>



  <tr>
	<td>

MS2

  • 5 months later...
Posted

Hello Ga?tan,

 

Please help me with the modifications in catalog/includes/classes/shopping_cart.php

This is how my code looks like:

function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {

global $new_products_id_in_cart, $customer_id;

 

$products_id_string = tep_get_uprid($products_id, $attributes);

$products_id = tep_get_prid($products_id_string);

 

// Max Amount in Cart

$this->calculate();

if ($this->total < MAX_TOTAL_IN_CART || $quantity < $this->get_quantity($products_id)) {

 

 

if (is_numeric($products_id) && is_numeric($qty)) {

$check_product_query = tep_db_query("select products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

$check_product = tep_db_fetch_array($check_product_query);

 

if (($check_product !== false) && ($check_product['products_status'] == '1')) {

if ($notify == true) {

$new_products_id_in_cart = $products_id;

tep_session_register('new_products_id_in_cart');

}

// Replaced by CCGV

// if ($this->in_cart($products_id_string)) {

// $this->update_quantity($products_id_string, $qty, $attributes);

// } else {

// $this->contents[$products_id_string] = array('qty' => $qty);

if ($this->in_cart($products_id)) {

$this->update_quantity($products_id, $qty, $attributes);

} else {

$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) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') . "')");

 

if (is_array($attributes)) {

reset($attributes);

while (list($option, $value) = each($attributes)) {

// Replaced by CCGV

//$this->contents[$products_id_string]['attributes'][$option] = $value;

$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_string) . "', '" . (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();

}

}

 

//Max Amount in Cart

}

}

 

function update_quantity($products_id, $quantity = '', $attributes = '') {

global $customer_id;

 

$products_id_string = tep_get_uprid($products_id, $attributes);

$products_id = tep_get_prid($products_id_string);

 

// Max Amount in Cart

$this->calculate();

if ($this->total < MAX_TOTAL_IN_CART || $quantity < $this->get_quantity($products_id)) {

 

if (is_numeric($products_id) && isset($this->contents[$products_id_string]) && is_numeric($quantity)) {

// Replaced by CCGV

//$this->contents[$products_id_string] = array('qty' => $quantity);

$this->contents[$products_id] = array('qty' => $quantity);

// update database

if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . (int)$quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "'");

 

if (is_array($attributes)) {

reset($attributes);

while (list($option, $value) = each($attributes)) {

// Replaced by CCGV

// $this->contents[$products_id_string]['attributes'][$option] = $value;

$this->contents[$products_id]['attributes'][$option] = $value;

// update database

if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "' and products_options_id = '" . (int)$option . "'");

}

}

}

 

//Max Amount in Cart

}

 

}

Thank you in advance for your help, Yuri Garc?a.

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...