Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sub total problem


meules

Recommended Posts

Hi,

 

I'm using the login 4 price contribution and the add_multi_v1.2 contribution. Everything is working fine, but the problem is that people can see the subtotal price of my products when they add them to the cart/basket. The subtotal price shows up, not the price of the product itself. You can see an example here (add some products to the basket to see what I mean)

 

This is the code

catalog/includes/application_top.php

// customer adds a product from the products page
case 'add_product' : 
// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
} else {
if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
}
break;
// performed by the 'buy now' button in product listings and review page
case 'buy_now' :
// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
} else {
if (isset($HTTP_GET_VARS['products_id'])) {
if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
} else {
$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
}
break;

catalog/includes/classes/currencies.php
CODE
function display_price($products_price, $products_tax, $quantity = 1) {
if (!tep_session_is_registered('customer_id')) {
return '<a href="' . HTTP_SERVER . '/' . FILENAME_LOGIN . '">Login For Price</a>';
} else { 
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}
}
}
?>

 

THIS IS THE ADD_MULTI_V1.2 CONTRIBUTE

catalog/includes/application_top.php

///////////////////////////////////////// Products Multi //////////////////////
if ($HTTP_GET_VARS['action'] == 'add_multi') {
$parameters = array('action', 'pid', 'products_id');
}#
///////////////////////////////////////// Products Multi //////////////////////

switch ($HTTP_GET_VARS['action']) {

///////////////////////////////////////// Products Multi //////////////////////
// multi_product_add
case 'add_multi':
for ($i=0; $i<=sizeof($HTTP_POST_VARS['products_id']);$i++) {
if($_POST['add_id'][$i] >= 1)
$cart->add_cart($HTTP_POST_VARS['products_id'][$i], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['id'][$i]))+($HTTP_POST_VARS['add_id'][$i]), $HTTP_POST_VARS['id'][$i]);
}
tep_redirect(tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params($parameters), 'NONSSL'));
break;
///////////////////////////////////////// Products Multi //////////////////////

 

catalog/includes/filenames.php

define('FILENAME_PRODUCT_LISTING', 'product_listing.php');

change to

define('FILENAME_PRODUCT_LISTING', 'product_listing_multi.php')

 

These are the codes I had to change for the 2 contributes

 

Hope someone can help

 

Thanks in advance

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...