crash3903 Posted June 22, 2006 Share Posted June 22, 2006 Guys I am using paypal ipn and ccgv together - the problem i have is the vouchers do not appear in the queue when they are purchased via paypal can anyone shed some light please? I have searched the forums but there are afr too many threads to make any sense thanks mark Quote Regards Mark A Reynolds Link to comment Share on other sites More sharing options...
♥Vger Posted June 22, 2006 Author Share Posted June 22, 2006 http://www.oscommerce.com/forums/index.php?sho...917&st=1000 Vger Guys I am using paypal ipn and ccgv together - the problem i have is the vouchers do not appear in the queue when they are purchased via paypal can anyone shed some light please? I have searched the forums but there are afr too many threads to make any sense thanks mark Quote Link to comment Share on other sites More sharing options...
crash3903 Posted June 22, 2006 Share Posted June 22, 2006 http://www.oscommerce.com/forums/index.php?sho...917&st=1000 Vger thanks and much appreciated regards mark Quote Regards Mark A Reynolds Link to comment Share on other sites More sharing options...
Nmouns777 Posted June 22, 2006 Share Posted June 22, 2006 (edited) Thanks for your contribution and your previous reply :thumbsup: Nmouns Edited June 22, 2006 by Nmouns777 Quote Link to comment Share on other sites More sharing options...
blessed Posted June 22, 2006 Share Posted June 22, 2006 Didn't you have this problem before? How did you resolve it then? Vger I have no idea why it resolved. I thought it was due to using the 1234 instaed, but that isn't working. Quote Link to comment Share on other sites More sharing options...
gtmall Posted June 23, 2006 Share Posted June 23, 2006 hi there, thanks for your great contribution, that's what i looking for long time but because my shopping cart doesn't have right column, i using aoscommerce template, so there is no any information about Gift vouchor account details in my shopping cart page. I am a newbie to oscommerce and PHP, just wondering which code i should chage? for my shopping cart layout, please see http://www.gtmall.com.au/shop/shopping_cart.php thanks in advance Quote Link to comment Share on other sites More sharing options...
♥Vger Posted June 23, 2006 Author Share Posted June 23, 2006 Place the shopping cart box in your left column - easy as that. Vger Quote Link to comment Share on other sites More sharing options...
chrisjw1975 Posted June 26, 2006 Share Posted June 26, 2006 Hi I have just installed this contribution and it all looks ok from what i have done, but when i click to buy a product the error below comes up Warning: Cannot modify header information - headers already sent by (output started at /data/members/paid/p/h/phoenix-games.co.uk/htdocs/www/includes/languages/english.php:2) in /data/members/paid/p/h/phoenix-games.co.uk/htdocs/www/includes/functions/general.php on line 33 line 33 of general shows below header('Location: ' . $url); any ideas, i am quite new to php but have installed a few other contributions thanks in advance Chris Quote Link to comment Share on other sites More sharing options...
♥Vger Posted June 26, 2006 Author Share Posted June 26, 2006 You have white space (blank lines or spaces) before the opening <?php or after the closing php tag ?> in the file on which page the error appears. So if it appears in the shopping_cart.php page then the white space could either be in that file or in the includes/classes/shopping_cart.php file. You just need to remove those white spaces. Vger Quote Link to comment Share on other sites More sharing options...
chrisjw1975 Posted June 26, 2006 Share Posted June 26, 2006 Re installed a few pages and sorted it, not sure what i'd done wrong! Great Contribution Chris Quote Link to comment Share on other sites More sharing options...
creepo Posted June 30, 2006 Share Posted June 30, 2006 The update of osCommerce introduced products_id_string in place of products_id to solve the problem of people having items saved in their cart which they could not remove (because they had since been deleted from the site by the owner) - but this caused problems with CCGV(trad). The problem it caused was when products with attributes were added to the cart they could not then be updated, but if you backtracked and added the same product with attributes then it appeared as a new product and the original product quantity was updated as well. The last update changed most of the references to products_id_string back to products_id, whilst leaving some products_id_string references in place (so as not to break the bug fix). Vger Vger - thanks for your hard work on this! It was probably the most complex contribution i have added to date and a great addition. However... :) Last night, a customer emailed me telling me that they were trying to add a single product to their cart - multiple times with different attributes. They wanted "one of each color". But, they said that it wouldn't allow them to add more than one. So, I investigated and they were right. Not only couldn't I add multiples of the same item with different attributes, once the product with a single attribute was added to the cart, it could not be updated - neither quantity or product attribute could be altered until it was removed from the cart. So that led me here and I found your post about "products_id_string" - First, I tried replacing just the instances in lines 103-106 - that had no effect. Then, I replaced all instances in the shopping_cart.php class with "products_id" - and now, I have regained the ability to update the item once it is in the cart (both quantity and attribute are updateable again. However, I still can't add the same item with multiple attributes. That said, I am not sure that I ever could. Never tried that before. Do you know if this is a limitation of OSCommerce in general or related to this CCGV contribution? I am not using stock levels at all. I see some contributions related to Attributes and Stock Levels and Quantity - but I don't see this issue addressed anywhere (yet). Except to see that someone is selling a $495 Inventory package for OSCommerce that appears to state that it will allow you to add the same item with multiple attributes... I am out of ideas. hope you have some light to shed :) Thanks! Jim Quote Link to comment Share on other sites More sharing options...
creepo Posted June 30, 2006 Share Posted June 30, 2006 (edited) Ironically, my wishlist does allow multiple instances of the same product to be added with different attributes... And then I thought... HA! Select them all from my Wishlist and press "Add to Cart" and I am going to beat this! ...no deal. It only adds the last instance (1 product) to the cart. In thinking about what else could be a factor... I did alter shopping_cart.php to add the ability (with javascript) to auto update the remove and quantity in the cart based on these posts: (Could these be the source of my problem - not being able to add the same product with multiple attributes?) ------ CODE I ADDED BELOW --------- QUANTITY: Update ur quantities with javascript *Ringo* 25 Feb 2006 If your going the javascript route, as suggested by deep-silver, you could also include this to update quatities. // In shopping_cart.php? // Find and replace this: 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id'])); // On or around line 144 default install // With this: //'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));?'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4" onblur="document.cart_quantity.submit();"') . tep_draw_hidden_field('products_id[]', $products[$i]['id'])); When the user changes the quantity and focus' the input elsewhere the form will be submitted. You should be careful however as not all users will have javascript enabled or a DOM compatible browser. I might look into a way to degrade this gracefully when I have the time. REMOVE: Just one simple step to to it. deep-silver 23 Feb 2006 open catalog/shopping_cart.php find and replace this line (aprox. line no.113) //-------------------------------- 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id'])); .....with this... //'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id'])); 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id'],'', 'onclick="document.cart_quantity.submit();"',false));//auto update cart Done! see it in action at... http://www.deep-silver.com/shop/ P.S Java must be enabled to use this mod. --------- Thanks to the community :) And Vger! Our little shop is appreciative. Edited June 30, 2006 by creepo Quote Link to comment Share on other sites More sharing options...
♥Vger Posted June 30, 2006 Author Share Posted June 30, 2006 Go to the shopping cart class file and replace instances of products_id_string with products_id and it should work. Vger Quote Link to comment Share on other sites More sharing options...
creepo Posted June 30, 2006 Share Posted June 30, 2006 Go to the shopping cart class file and replace instances of products_id_string with products_id and it should work. Vger Thanks for the reply! I've already done that (replaced all instances in /catalog/includes/classes/shopping_cart.php of "products_id_string" with "products_id"). That fixed my ability to update the item (quantity and attribute), but I still can't add multiple items with differing attributes. My last post about the changes to shopping_cart.php (the javascript bits to remove and update quantity with javascript) were NOT in the class file but rather in /catalog/shopping_cart.php. While still perhaps a factor, they were not done in the class file. My error. Any ideas? If helpful, here's my current shopping_cart.php class file (I really appreciate your attention - and would hate to have to remove the contibution :( <?php /* $Id: shopping_cart.php,v 1.35 2003/06/25 21:14:33 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ class shoppingCart { var $contents, $total, $weight, $cartID, $content_type; function shoppingCart() { $this->reset(); } function restore_contents() { //CCGV Replace Line global $customer_id, $gv_id, $REMOTE_ADDR; if (!tep_session_is_registered('customer_id')) return false; // insert current cart contents in database if (is_array($this->contents)) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { $qty = $this->contents[$products_id]['qty']; $product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); if (!tep_db_num_rows($product_query)) { 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) . "', '" . $qty . "', '" . date('Ymd') . "')"); if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { 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 . "')"); } } } else { tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $qty . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); } } //ADDED FOR CCGV - START if (tep_session_is_registered('gv_id')) { $gv_query = tep_db_query("insert into " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $gv_id . "', '" . (int)$customer_id . "', now(),'" . $REMOTE_ADDR . "')"); $gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $gv_id . "'"); tep_gv_account_update($customer_id, $gv_id); tep_session_unregister('gv_id'); } //ADDED FOR CCGV - END } // reset per-session cart contents, but not the database contents $this->reset(false); $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'"); while ($products = tep_db_fetch_array($products_query)) { $this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity']); // attributes $attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'"); while ($attributes = tep_db_fetch_array($attributes_query)) { $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id']; } } $this->cleanup(); } function reset($reset_database = false) { global $customer_id; $this->contents = array(); $this->total = 0; $this->weight = 0; $this->content_type = false; if (tep_session_is_registered('customer_id') && ($reset_database == true)) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'"); } unset($this->cartID); if (tep_session_is_registered('cartID')) tep_session_unregister('cartID'); } function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) { global $new_products_id_in_cart, $customer_id; $products_id = tep_get_uprid($products_id, $attributes); $products_id = tep_get_prid($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)) { // $this->update_quantity($products_id, $qty, $attributes); // } else { // $this->contents[$products_id] = 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) . "', '" . (int)$qty . "', '" . date('Ymd') . "')"); if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { // Replaced by CCGV //$this->contents[$products_id]['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) . "', '" . (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(); } } } function update_quantity($products_id, $quantity = '', $attributes = '') { global $customer_id; $products_id = tep_get_uprid($products_id, $attributes); $products_id = tep_get_prid($products_id); if (is_numeric($products_id) && isset($this->contents[$products_id]) && is_numeric($quantity)) { // Replaced by CCGV //$this->contents[$products_id] = 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) . "'"); if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { // Replaced by CCGV // $this->contents[$products_id]['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) . "' and products_options_id = '" . (int)$option . "'"); } } } } function cleanup() { global $customer_id; reset($this->contents); while (list($key,) = each($this->contents)) { if ($this->contents[$key]['qty'] < 1) { unset($this->contents[$key]); // remove from database if (tep_session_is_registered('customer_id')) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'"); } } } } function count_contents() { // get total number of items in cart $total_items = 0; if (is_array($this->contents)) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { $total_items += $this->get_quantity($products_id); } } return $total_items; } function get_quantity($products_id) { if (isset($this->contents[$products_id])) { return $this->contents[$products_id]['qty']; } else { return 0; } } function in_cart($products_id) { if (isset($this->contents[$products_id])) { return true; } else { return false; } } function remove($products_id) { global $customer_id; unset($this->contents[$products_id]); // remove from database if (tep_session_is_registered('customer_id')) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); } // assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure $this->cartID = $this->generate_cart_id(); } function remove_all() { $this->reset(); } function get_product_id_list() { $product_id_list = ''; if (is_array($this->contents)) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { $product_id_list .= ', ' . $products_id; } } return substr($product_id_list, 2); } function calculate() { $this->total_virtual = 0; // CCGV $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 = '" . (int)$products_id . "'"); if ($product = tep_db_fetch_array($product_query)) { // CCGV ADDED - START $no_count = 1; $gv_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $gv_result = tep_db_fetch_array($gv_query); if (ereg('^GIFT', $gv_result['products_model'])) { $no_count = 0; } // CCGV ADDED - END $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 = '" . (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']; } $this->total_virtual += tep_add_tax($products_price, $products_tax) * $qty * $no_count;// CCGV $this->weight_virtual += ($qty * $products_weight) * $no_count;// CCGV $this->total += tep_add_tax($products_price, $products_tax) * $qty; $this->weight += ($qty * $products_weight); } // attributes price if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'"); $attribute_price = tep_db_fetch_array($attribute_price_query); if ($attribute_price['price_prefix'] == '+') { $this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax); } else { $this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax); } } } } } function attributes_price($products_id) { $attributes_price = 0; if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'"); $attribute_price = tep_db_fetch_array($attribute_price_query); if ($attribute_price['price_prefix'] == '+') { $attributes_price += $attribute_price['options_values_price']; } else { $attributes_price -= $attribute_price['options_values_price']; } } } 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_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$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 = '" . (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']; } $products_array[] = array('id' => $products_id, 'name' => $products['products_name'], 'model' => $products['products_model'], 'image' => $products['products_image'], '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' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : '')); } } return $products_array; } function show_total() { $this->calculate(); return $this->total; } function show_weight() { $this->calculate(); return $this->weight; } // CCGV Start Amendment function show_total_virtual() { $this->calculate(); return $this->total_virtual; } function show_weight_virtual() { $this->calculate(); return $this->weight_virtual; } // CCGV End Amendment function generate_cart_id($length = 5) { return tep_create_random_value($length, 'digits'); } function get_content_type() { $this->content_type = false; if ( (DOWNLOAD_ENABLED == 'true') && ($this->count_contents() > 0) ) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list(, $value) = each($this->contents[$products_id]['attributes'])) { $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$products_id . "' and pa.options_values_id = '" . (int)$value . "' and pa.products_attributes_id = pad.products_attributes_id"); $virtual_check = tep_db_fetch_array($virtual_check_query); if ($virtual_check['total'] > 0) { switch ($this->content_type) { case 'physical': $this->content_type = 'mixed'; return $this->content_type; break; default: $this->content_type = 'virtual'; break; } } else { switch ($this->content_type) { case 'virtual': $this->content_type = 'mixed'; return $this->content_type; break; default: $this->content_type = 'physical'; break; } } } // CCGV ADDED - BEGIN } elseif ($this->show_weight() == 0) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { $virtual_check_query = tep_db_query("select products_weight from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'"); $virtual_check = tep_db_fetch_array($virtual_check_query); if ($virtual_check['products_weight'] == 0) { switch ($this->content_type) { case 'physical': $this->content_type = 'mixed'; return $this->content_type; break; default: $this->content_type = 'virtual_weight'; break; } } else { switch ($this->content_type) { case 'virtual': $this->content_type = 'mixed'; return $this->content_type; break; default: $this->content_type = 'physical'; break; } } } // CCGV ADDED - END } else { switch ($this->content_type) { case 'virtual': $this->content_type = 'mixed'; return $this->content_type; break; default: $this->content_type = 'physical'; break; } } } } else { $this->content_type = 'physical'; } return $this->content_type; } function unserialize($broken) { for(reset($broken);$kv=each($broken);) { $key=$kv['key']; if (gettype($this->$key)!="user function") $this->$key=$kv['value']; } } // CCGV ADDED - START function count_contents_virtual() { // get total number of items in cart disregard gift vouchers $total_items = 0; if (is_array($this->contents)) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { $no_count = false; $gv_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'"); $gv_result = tep_db_fetch_array($gv_query); if (ereg('^GIFT', $gv_result['products_model'])) { $no_count=true; } if (NO_COUNT_ZERO_WEIGHT == 1) { $gv_query = tep_db_query("select products_weight from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($products_id) . "'"); $gv_result=tep_db_fetch_array($gv_query); if ($gv_result['products_weight']<=MINIMUM_WEIGHT) { $no_count=true; } } if (!$no_count) $total_items += $this->get_quantity($products_id); } } return $total_items; } // CCGV ADDED - END } ?> Quote Link to comment Share on other sites More sharing options...
creepo Posted June 30, 2006 Share Posted June 30, 2006 When I installed this, I had some trouble with Order Total Sort Order - Could this be related? Here's my current Sort Order: Order Total Modules Modules - Sort Order -------------------------- Discount Coupons: 5 Gift Vouchers: 6 Low Order Fee: blank Shipping: 3 Sub-Total : 1 Tax: 2 Total: 9 In further testing, I removed all modifications to the /catalog/shopping_cart.php (javascript stuff to remove items on click - and update quantity without having to hit "update") - just in case that was interfering... That had no effect. I still can't add multiples of the same item with different attributes. In further testing, i went to another oscommerce store and found an item with attributes and was able to add multiples of the same item with differing attributes. Each instance with a different attribute was added as a new product. So, I know OSCommerce can do it :) I just have to trace what could be interfering. Can anyone see anything in my previously submitted shopping_cart.php class that is obviously amiss? Other Contributions I have installed: CCGV(trad) country-state-selector_1_2_3_4_5_6_7_8_9_10_11_12_13_14 credit stats_1_2 customers_improved_1_4_2 scrolling_bestseller_V1.1 SimpleWishListReportForV3.+ Who's Online Enhancement 2.00 full package by Webschiff Wishlist 3.5d WYSIWYG HTMLArea MS2 v1.7 automatic_thumbnail make the infobox header a clickable row spiders.txt Sales Report Thats about it. Could Wishlist be interfering? Sorry for being so verbose - I'm just really hoping there is a solution other than removing this contrib. My customers are pumped about Coupons and Vouchers... Thanks again. I'll shut up now and (grovel and beg for help)... jim Quote Link to comment Share on other sites More sharing options...
♥Vger Posted June 30, 2006 Author Share Posted June 30, 2006 I'm sorry, but even grovelling and begging is not going to entice anyone to go through a couple of thousand lines of code for you to see if there is a problem with it. Vger Quote Link to comment Share on other sites More sharing options...
creepo Posted June 30, 2006 Share Posted June 30, 2006 I'm sorry, but even grovelling and begging is not going to entice anyone to go through a couple of thousand lines of code for you to see if there is a problem with it. Vger I apologize - I thought it might help to see the code to not waste your time - I am just trying to figure if this is a CCGV issue or... not. Do you know if I can drop a stock shopping_cart.php class from CCGV docs? I looked at one and it still had the products_id_string in it. I saw that "blessed" had the same issue - just wondering if it is a known issue. I didn't mean to be a pain - just thorough in case you were going to ask for my code.. Thanks, jim Quote Link to comment Share on other sites More sharing options...
chooch Posted June 30, 2006 Share Posted June 30, 2006 I saw that "blessed" had the same issue - just wondering if it is a known issue. I didn't mean to be a pain - just thorough in case you were going to ask for my code.. In my opinion it seems that some people have certain issues that others do not, this is probably down to having addeda contribution which does not look like it is going to interfere with the functions but sometimes they do. Maybe a PM to the person with the same issue may be your best bet for now Quote Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back! Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you? There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere. CHOOCH Link to comment Share on other sites More sharing options...
creepo Posted June 30, 2006 Share Posted June 30, 2006 In my opinion it seems that some people have certain issues that others do not, this is probably down to having addeda contribution which does not look like it is going to interfere with the functions but sometimes they do. Maybe a PM to the person with the same issue may be your best bet for now Thanks, I did send an email to Blessed to see if they had any success. Meanwhile, I will try a stock CCGV shopping_cart.php class and see if that works. Sorry if it appears I sprayed tons of code on the forums. Didn't know that would cause a bad reaction. I'm just trying to get to the cause. I'll keep the forum updated with details in case someone else is searching for info about this issue. Perhaps it's just me and some odd combo of contribs with unexpected effects. I really appreciate the contrib - we've already started sending out discount codes in our newsletters etc. And they are driving new sales - so, don't get me wrong - I really want to keep this great functionality that Vger has taken the time to aggregate and support. Thanks again for your time, Jim Quote Link to comment Share on other sites More sharing options...
creepo Posted July 2, 2006 Share Posted July 2, 2006 Do you think I can keep the CCGV5.16 SC class instead of yours or it would cause problems ?Which problems did it solve ? Thx, Nmouns For the record, I also took the shopping cart class from CCGV5.16 and replaced my manually edited version per CCGV(trad) instructions. And Voila! My inability to add multiple instances of the same product with different attributes is solved. Who knows - stray character? Not sure. Did you/we/anyone ever learn whether there are any ill effects from using this "stock" 5.16 SC class? I just tested numerous transactions with several of the same item (different attributes), with coupons and gift vouchers - and all seems to be working! Thanks again to Vger for his work on this - and, for the record, I tried to edit my post and remove the thousands of lines of code - color me educated that that is frowned upon... I promise to be less verbose next time - I was just mildy freaking out because I REALLY want this contrib to work properly - it is incredibly valuable to our store and marketing plans... Thanks to everyone! Jim Quote Link to comment Share on other sites More sharing options...
tec Posted July 2, 2006 Share Posted July 2, 2006 hiya, when i put in a coupon/voucher code on check out it kicks me back to the login page and then doesnt let me login again thoughts? Quote Link to comment Share on other sites More sharing options...
missdaisy Posted July 2, 2006 Share Posted July 2, 2006 ok... I don't know if you get much of these types of messages... but here it goes... :D "at first I was afraid, I was petrified...." :-" :-" well I went the wrong way about things... got the wrong contrib for Paypal Ipn... also got the wrong one for CCGV.... after over 70 hours of slavery this week over this shopping cart madness ( please note that I am an insurance broker by profession converted or I should... finally admitted that I am more of the artistic vocation and am now a full time artist... computers are good when they help me create... computers are bad for anything that has me banging my head against the wall...) so sometime during the night... I'd say about 3 am between Thursday and Friday after finding an opinion post from Aleem or Chooch (sorry I don't know if it's too forward to be on first name basis... you don't know me yet but I have read soooooooooooooooo many posts from you so far that I feel you are now residing in my head... :thumbsup: ) saying that it was simpler to use Rhea's Paypal IPN and then reading a post from Rhea, I saw that she had a CCVG contrib listed... so came the decision to undo EVERYTHING.... 8 contrics and my entire store... I was a good girl and did the proper back up... I just ruined the good one by mistake and still had to redo everything... LOL Now if you don't remember I am that crazed person that came to this forum almost 3 months ago now who didn't even know what phpMyAdmin was and couldn't find it or make it work... heck... didn't even know what a php file was apart that I had seen that extension at the end of forum links... :lol: :blink: :blush: well now I did install the Paypal IPN... only one thing wasn't working and managed to correct it all by myself like a big girl... then installed CCGV trad... got that error on checkout_payment on line 324 and couldn't get rid of it... so decide to read this ENTIRE thread from the first post and tried and doublecheck EVERYTHING that was posted by all of you... AND NOW IT'S WORKING WORKING... not shouting... just singing VERY LOUDLY So a very special thank you to Rhea, Aleem... someone I think I remember having dalton in the nickname for pointing one thing he had done that led me to what was not working... and another one to Tanya who was an inspiration to keep going... So after 3 months of reshaping my forehead against a wall... in the last 2 days everything as finally falled into place and I have a website that seems to be working perfectly now... alleluiah for backups... on my way there for a major one now... " And I've surviiiivvvvvvvveddddd" Thank you... p.s. it would have been much more fun with dancing emoticons... :lol: :lol: Quote Link to comment Share on other sites More sharing options...
missdaisy Posted July 2, 2006 Share Posted July 2, 2006 oh I am sorryl.l.. I had to come and sing again..... you should see me... a real lunatic... I am dancing and jumping all over my dining room.... ha haha Rhea... you are the queen!!!! Quote Link to comment Share on other sites More sharing options...
chrisjw1975 Posted July 2, 2006 Share Posted July 2, 2006 Hi is there anyway to make products invalid, i have 10,000 products and rather than a list of 9,999 valid ones i would like to make the odd one invalid is this possible? Chris Quote Link to comment Share on other sites More sharing options...
♥Vger Posted July 2, 2006 Author Share Posted July 2, 2006 Hi Chris ...sorry, the answer is 'No'. CCGV works off valid categories and products and not invalid ones. Vger Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.