Ok I have installed ok!
But I dont see the whole sale price factor in the attributes controler.
There is anyway I can set that?
Thanks
Printable View
Ok I have installed ok!
But I dont see the whole sale price factor in the attributes controler.
There is anyway I can set that?
Thanks
hello -- i installed this mod and it looks like it is working as advertised except that i have a template a purchased and it messed up a couple items, maybe you can help:
1. cart --> total is now 0.00. sub-total shows correct value (see image 1)
http://i96.photobucket.com/albums/l1...encart/dp0.jpg
2. step 2 of 3 (payment info) -- shows sub-total as 0.00 (see image 2)
http://i96.photobucket.com/albums/l1...encart/dp2.jpg
3. some graphics moved around on the products page -- what page do i modify to move these back (see image 3)
http://i96.photobucket.com/albums/l1...encart/dp3.jpg
i did a backup of the db and files so i can easily go back to the previous version but i would like to make this work as i need the functionality. Thank you for your help
zencart 1.3.8a
php 5.2.5
mysql 5.0.45
apache 2.2.6
addons: vat mod 1.3.0
template from templatemonster.com
looks like your includes/classes/shopping_cart.php file might not have properly uploaded. Please check that first.
tpl_product_info_display.php is the file driving this page. you might need to modify your CSS file, basic design work there.
hello -- thanks for the quick response. i did a compare of the files using winmerge and it states files from the zip and on the site are identical. please let me know how many lines of code that file should have and the exact size.
image1:
http://i96.photobucket.com/albums/l1...encart/sh1.jpg
image2: zip size is correct as well 126537 bytes
http://i96.photobucket.com/albums/l1...encart/zip.jpg
per notepad++ mine has 1985 lines ending in ?> (not counting line 1986 which is blank)
size: 88,229 bytes
size on disk: 90,112 bytes
any other ideas?
i also performed a line by line compare of shopping_cart_backup.php to shopping_cart_dp.php (copied and renamed for the purpose of the compare). These will be different but maybe you can spot where different variables are used:
backup file
Code:The following values are only in G:\shopping_cart_backup.php.
* @copyright Copyright 2003-2007 Zen Cart Development Team
* @version $Id: shopping_cart.php 7276 2007-10-23 05:36:08Z drbyte $
$qty = $this->adjust_quantity($qty, $products_id, 'shopping_cart');
$this->contents[$products_id] = array('qty' => (float)$qty);
$this->contents[$products_id] = array('qty' => (float)$quantity);
* Method to check whether a product exists in the cart
$product_query = "select products_id, products_price, products_tax_class_id, products_weight,
$products_price = $product->fields['products_price'];
$products_price = $product->fields['products_price'];
if ($product->fields['product_is_always_free_shipping'] == '1' or $product->fields['products_virtual'] == '1') {
$shipping_attributes_price = zen_get_discount_calc($product->fields['products_id'], $attribute_price->fields['products_attributes_id'], $attribute_price->fields['options_values_price'], $qty);
$this->free_shipping_price -= $qty * zen_add_tax( ($shipping_attributes_price), $products_tax);
$this->total -= $qty * zen_add_tax($attribute_price->fields['options_values_price'], $products_tax);
$this->free_shipping_price += $qty * zen_add_tax( ($shipping_attributes_price), $products_tax);
$this->total += $qty * zen_add_tax($attribute_price->fields['options_values_price'], $products_tax);
} // eof: attribute price
// do not count download as free when set to product/download combo
if ($adjust_downloads == 1 and $product->fields['product_is_always_free_shipping'] != 2) {
// echo 'I SEE ' . $this->total . ' vs ' . $this->free_shipping_price . ' items: ' . $this->free_shipping_item. '<br>';
$new_attributes_price = zen_get_discount_calc($products_id, $attribute_price->fields['products_attributes_id'], $attribute_price->fields['options_values_price'], $qty);
$attributes_price += $attribute_price->fields['options_values_price'];
$new_attributes_price = zen_get_discount_calc($products_id, $attribute_price->fields['products_attributes_id'], $attribute_price->fields['options_values_price'], $qty);
p.products_price, p.products_weight, p.products_tax_class_id,
$products_price = $products->fields['products_price'];
$products_price = $products->fields['products_price'];
$check_unit_decimals = zen_get_products_quantity_order_units((int)$products->fields['products_id']);
if (strstr($check_unit_decimals, '.')) {
$new_qty = round($new_qty, QUANTITY_DECIMALS);
$new_qty = round($new_qty, 0);
'name' => $products->fields['products_name'],
'model' => $products->fields['products_model'],
'image' => $products->fields['products_image'],
'price' => ($products->fields['product_is_free'] =='1' ? 0 : $products_price),
'quantity' => $new_qty,
'weight' => $products->fields['products_weight'] + $this->attributes_weight($products_id),
// fix here
'final_price' => ($products_price + $this->attributes_price($products_id)),
'onetime_charges' => ($this->attributes_price_onetime_charges($products_id, $new_qty)),
'tax_class_id' => $products->fields['products_tax_class_id'],
'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''),
'attributes_values' => (isset($this->contents[$products_id]['attributes_values']) ? $this->contents[$products_id]['attributes_values'] : ''),
'products_priced_by_attribute' => $products->fields['products_priced_by_attribute'],
'product_is_free' => $products->fields['product_is_free'],
'products_discount_type' => $products->fields['products_discount_type'],
'products_discount_type_from' => $products->fields['products_discount_type_from']);
$free_ship_check = $db->Execute("select products_virtual, products_model, products_price, product_is_always_free_shipping from " . TABLE_PRODUCTS . " where products_id = '" . zen_get_prid($products_id) . "'");
. TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
if ($free_ship_check->fields['products_virtual'] == '1') {
$this->content_type = 'virtual';
$this->content_type = 'mixed';
if ($gv_only == 'true') {
return $gift_voucher;
} else {
return $this->content_type;
}
//echo 'I SEE actionUpdateProduct: ' . $_POST['products_id'] . ' ' . $_POST['products_id'][$i] . '<br>';
$new_qty = $this->adjust_quantity($new_qty, $_POST['products_id'][$i], 'shopping_cart');
// $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' A: - ' . zen_get_products_name($_POST['products_id'][$i]), 'caution');
$messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($_POST['products_id'][$i]), 'caution');
// display message if all is good and not on shopping_cart page
if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART) {
$messageStack->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCT, 'success');
//echo 'I SEE actionAddProduct: ' . $_POST['products_id'] . '<br>';
$new_qty = $this->adjust_quantity($new_qty, $_POST['products_id'], 'shopping_cart');
// $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' B: - ' . zen_get_products_name($_POST['products_id']), 'caution');
$messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($_POST['products_id']), 'caution');
if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART) {
$messageStack->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCT, 'success');
if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART) {
$messageStack->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCT, 'success');
// zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters, $products_id) . 'products_id=' . $_GET['products_id']));
* @todo change while loop to a foreach
if (is_array($_POST['products_id']) && sizeof($_POST['products_id']) > 0) {
foreach($_POST['products_id'] as $key=>$val) {
// while ( list( $key, $val ) = each($_POST['products_id']) ) {
if ($val > 0) {
$adjust_max = false;
$prodId = $key;
$qty = $val;
$add_max = zen_get_products_quantity_order_max($prodId);
$cart_qty = $this->in_cart_mixed($prodId);
// $new_qty = $qty;
//echo 'I SEE actionMultipleAddProduct: ' . $prodId . '<br>';
$new_qty = $this->adjust_quantity($qty, $prodId, 'shopping_cart');
if (($add_max == 1 and $cart_qty == 1)) {
// do not add
// adjust quantity if needed
if (($new_qty + $cart_qty > $add_max) and $add_max != 0) {
$adjust_max= 'true';
$new_qty = $add_max - $cart_qty;
$this->add_cart($prodId, $this->get_quantity($prodId)+($new_qty));
if ($adjust_max == 'true') {
// $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' C: - ' . zen_get_products_name($prodId), 'caution');
$messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($prodId), 'caution');
$messageStack->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCTS, 'success');
// $qty = $this->adjust_quantity($qty, (int)$products_id, 'shopping_cart');
// temporary fixed on messagestack used for check and message needs better separation
function adjust_quantity($check_qty, $products, $message=false) {
$old_quantity = $check_qty;
$fix_qty = $check_qty;
// $messageStack->add_session('shopping_cart', ERROR_QUANTITY_ADJUSTED . zen_get_products_name($products) . ' - ' . $old_quantity . ' => ' . $new_qty, 'caution');
$new_qty = preg_replace('/[0]+$/','', $check_qty);
// $messageStack->add_session('shopping_cart', 'A: ' . ERROR_QUANTITY_ADJUSTED . zen_get_products_name($products) . ' - ' . $old_quantity . ' => ' . $new_qty, 'caution');
if ($check_qty != round($check_qty, QUANTITY_DECIMALS)) {
$new_qty = round($check_qty, QUANTITY_DECIMALS);
$messageStack->add_session('shopping_cart', ERROR_QUANTITY_ADJUSTED . zen_get_products_name($products) . ERROR_QUANTITY_CHANGED_FROM . $old_quantity . ERROR_QUANTITY_CHANGED_TO . $new_qty, 'caution');
$new_qty = $check_qty;
return $new_qty;
new file
Code:The following values are only in G:\shopping_cart_dp.php.
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @version $Id: shopping_cart.php 3856 2006-06-29 02:26:33Z drbyte $
$this->contents[$products_id] = array('qty' => $qty);
$this->contents[$products_id] = array('qty' => $quantity);
* Method to check wheter a product exists in the cart
$product_query = "select products_id, products_price, products_price_w, products_tax_class_id, products_weight,
// $products_price = $product->fields['products_price']; - REMOVED FOR DUAL PRICING MOD
//*************************************************************
//***** CHECK WHETHER WHOLESALE OR RETAIL AND GET CORRECT PRICE
if ($_SESSION['customer_id']) {
$customers_id = $_SESSION['customer_id'];
$customer_check = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_id = '$customers_id'");
if ($customer_check->fields['customers_whole'] != "0") {
$i = $customer_check->fields['customers_whole'];
$i = $i-1;
$products_price_array = $product->fields['products_price_w'];
$productsprice = explode("-",$products_price_array);
$products_price = $productsprice[$i];
if ($products_price == '0' || $products_price == '') {
$products_price = $productsprice[0];
}
if ($products_price=='0'){
$products_price = $product->fields['products_price'];
} else {
$products_price = $product->fields['products_price'];
}
} else {
$products_price = $product->fields['products_price'];
//****************************************************************
//*****END CHECK WHETHER WHOLESALE OR RETAIL AND GET CORRECT PRICE
$products_price = $products_price;
$customers_id = $_SESSION['customer_id'];
if ($customer_check->fields['customers_whole'] != "0") {
$i = $customer_check->fields['customers_whole'];
$i = $i-1;
$attribute_cost_array = $attribute_price->fields['options_values_price_w'];
$attributeprice = explode(",",$attribute_cost_array);
$attribute_cost = $attributeprice[$i];
if ($attribute_cost=='0' || $attribute_cost=='') {
$attribute_cost = $attributeprice[0];
if ($attribute_cost =='0'){
$attribute_cost = $attribute_price->fields['options_values_price'];
} else {
$attribute_cost = $attribute_price->fields['options_values_price'];
}
$attribute_cost = $attribute_price->fields['options_values_price'];
// $this->free_shipping_price -= $qty * zen_add_tax( ($new_attributes_price), $products_tax);
//$this->total -= $qty * zen_add_tax($attribute_price->fields['options_values_price'], $products_tax);
$this->total -= $qty * zen_add_tax($attribute_cost, $products_tax);
$new_attributes_price = zen_get_discount_calc($product->fields['products_id'], $attribute_price->fields['products_attributes_id'], $attribute_cost, $qty);
// $this->free_shipping_price += $qty * zen_add_tax( ($new_attributes_price), $products_tax);
//$this->total += $qty * zen_add_tax($attribute_price->fields['options_values_price'], $products_tax);
$this->total += $qty * zen_add_tax($attribute_cost, $products_tax);
if ($adjust_downloads == 1) {
//****************************************************************
$new_attributes_price = zen_get_discount_calc($products_id, $attribute_price->fields['products_attributes_id'], $attribute_cost, $qty);
$attributes_price += $attribute_cost;
$new_attributes_price = zen_get_discount_calc($products_id, $attribute_price->fields['products_attributes_id'], $attribute_cost, $qty);
p.products_price, p.products_price_w, p.products_weight, p.products_tax_class_id,
// $products_price = $product->fields['products_price']; - REMOVED FOR DUAL PRICING MOD
$products_price_array = $products->fields['products_price_w'];
$products_price = $products->fields['products_price'];
$products_price = $products->fields['products_price'];
$products_price = $products->fields['products_price'];
// $products_price = $product->fields['products_price']; - REMOVED FOR DUAL PRICING MOD
$new_qty = round($new_qty, QUANTITY_DECIMALS);
'name' => $products->fields['products_name'],
'model' => $products->fields['products_model'],
'image' => $products->fields['products_image'],
'price' => ($products->fields['product_is_free'] =='1' ? 0 : $products_price),
'quantity' => $new_qty,
'weight' => $products->fields['products_weight'] + $this->attributes_weight($products_id),
// fix here
'final_price' => ($products_price + $this->attributes_price($products_id)),
'onetime_charges' => ($this->attributes_price_onetime_charges($products_id, $new_qty)),
'tax_class_id' => $products->fields['products_tax_class_id'],
'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''),
'attributes_values' => (isset($this->contents[$products_id]['attributes_values']) ? $this->contents[$products_id]['attributes_values'] : ''),
'products_priced_by_attribute' => $products->fields['products_priced_by_attribute'],
'product_is_free' => $products->fields['product_is_free'],
'products_discount_type' => $products->fields['products_discount_type'],
'products_discount_type_from' => $products->fields['products_discount_type_from']);
$free_ship_check = $db->Execute("select products_virtual, products_model, products_price, products_price_w, product_is_always_free_shipping from " . TABLE_PRODUCTS . " where products_id = '" . zen_get_prid($products_id) . "'");
. TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
$this->content_type = 'mixed';
if ($gv_only == 'true') {
return $gift_voucher;
return $this->content_type;
$this->content_type = 'virtual';
$messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' - ' . zen_get_products_name($_POST['products_id'][$i]), 'caution');
$messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' - ' . zen_get_products_name($_POST['products_id']), 'caution');
while ( list( $key, $val ) = each($_POST['products_id']) ) {
if ($val > 0) {
$prodId = $key;
$qty = $val;
$add_max = zen_get_products_quantity_order_max($prodId);
$cart_qty = $this->in_cart_mixed($prodId);
$new_qty = $qty;
$this->add_cart($prodId, $this->get_quantity($prodId)+($new_qty));
$messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' - ' . zen_get_products_name($prodId), 'caution');
I understand that the files on your local computer are correct. I think it might be an FTP transfer issue. Did you try re-putting it to your server? several times?
Do you have any other modifications installed?
yes i moved the files over serveral times, i overwrote the file, i deleted it then moved it again... comparing the local file to the server file they are identical in size, in line count, and a line by line comparison shows no variations.
one other thought -- as this is a semi-fresh install the page states: Please review your order. (defined in includes/languages/english/shopping_cart.php) which is not the same as includes/classes/shopping_cart.php. does one override the other? the mod doesnt copy any files there so i presume there is a reason for that.
edit: the only mod i have is the VAT mod 1.3.0 which does not modify any shopping_cart files
Great Mod and I got everything working but the one question I have is, is there a way to setup for when a customer signs up to automatically assign the Wholesale pricing level so that my client doesnt have to go in manually and do it everytime.
I am running the most updated version of zencart with the most updated version of the dual pricing mod
Thank You in advance for the support
to check if thats the file thats causing the problem i put the backup shopping_cart.php file into includes/classes/ and my totals show up and propegate however since i replace the mod shopping_cart file i do not have the wholesale pricing functionality working.
That's a language file, it has nothing to do with this file. I'm not sure where your problem is coming from. I'm not familiar with the VAT mod does it modify the functions_prices.php file?
Thank you... The way to do this would be to modify the code when a customer is being created so that the customers_whole column in the customers table is automatically populated with whichever value you desire. Possible options being 1-4