Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

kbking

Pioneers
  • Posts

    264
  • Joined

  • Last visited

Everything posted by kbking

  1. Thank you for an prompt answer. I'm going to go for it now. :)
  2. Hi! It looks like an useful contribution. I'd like to install it, but hesitate somewhat... Are there any risk involved that previous installed contributions will collide with this one, already busy coniguration ID:s and so forth? TIA kbking
  3. Make sure you have merged correct in includes\modules\new_products.php.
  4. Yes I know the thread is primarily for SPPC. The reason I asked was that you made it possible to use My WhishList contribution with SPPC, which I have gratefully used. So the two contibutions I have merged here together with SPPC are My WhishList and Product Attributes - Option Type Feature. The code in shoppingcart.php looked similar to the code in whishlist.php, at least to me. I thought maybe if whishlist were tweaked a bit more with regard to if a text attribute is assigned then it would work with OTF as well. The code I refer to in shoppingcart.php is: // Push all attributes information in an array if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { while (list($option, $value) = each($products[$i]['attributes'])) { //clr 030714 move hidden field to if statement below //echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $products[$i]['id'] . "' and pa.options_id = '" . $option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); $attributes_values = tep_db_fetch_array($attributes); //clr 030714 determine if attribute is a text attribute and assign to $attr_value temporarily if ($value == PRODUCTS_OPTIONS_VALUE_TEXT_ID) { echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . TEXT_PREFIX . $option . ']', $products[$i]['attributes_values'][$option]); $attr_value = $products[$i]['attributes_values'][$option]; } else { echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); $attr_value = $attributes_values['products_options_values_name']; } Thanks for answering my questions before! It was a great help for me, now everything with regards to SPPC works. :) Sorry if I'm going off topic with this one, won't happen again.
  5. Hi! I noticed that the button Add to Wish List is not able to move over text attributes which by a customer has been written in a text field, there is a row created for it but no text. The text appears in shoppingcart when Add to Cart is clicked in wishlist.php though. My shopping_cart.php has the code already in it I believe; I posted this file on page 120 in this topic. I think my wishlist.php also nedd to have this code in order to show this particular attribute. Now my wishlist.php looks as follows (provided I posted the right snippet needed here): /******************************************************************* ******** THIS IS THE WISHLIST CODE FOR PRODUCT ATTRIBUTES ********* *******************************************************************/ $attributes_addon_price = 0; // Now get and populate product attributes $att_name = ""; if (isset($wishList->wishID[$wishlist_id]['attributes'])) { while (list($option, $value) = each($wishList->wishID[$wishlist_id]['attributes'])) { echo tep_draw_hidden_field('id[' . $wishlist_id . '][' . $option . ']', $value); $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $wishlist_id . "' and pa.options_id = '" . $option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); $attributes_values = tep_db_fetch_array($attributes); $att_name .= " (" . $attributes_values['products_options_name'] . ": " . $attributes_values['products_options_values_name'] . ") "; echo '<br /><small><i> ' . $attributes_values['products_options_name'] . ': ' . $attributes_values['products_options_values_name'] . '</i></small>'; } // end while attributes for product } echo '<input type="hidden" name="prod_att[]" value="' . $att_name . '" />'; if (tep_not_null($products['specials_new_products_price'])) { $products_price = '<s>' . $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($products['specials_new_products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])); } /******************************************************************* ******* CHECK TO SEE IF PRODUCT HAS BEEN ADDED TO THEIR CART ******* *******************************************************************/ if($cart->in_cart($wishlist_id)) { echo '<br /><font color="#FF0000"><b>' . TEXT_ITEM_IN_CART . '</b></font>'; }
  6. <?php /* $Id: shopping_cart.php,v 1.35 2003/06/25 21:14:33 hpdl Exp $ adapted for Separate Pricing Per Customer v3.6 2005/01/27 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 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() { global $customer_id; 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'])) { //clr 031714 udate query to include attribute value. This is needed for text attributes. $attr_value = $this->contents[$products_id]['attributes_values'][$option]; 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) . "'"); } } } // 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 //CLR 020606 update query to pull attribute value_text. This is needed for text attributes. $attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text 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']; //CLR 020606 if text attribute, then set additional information if ($attributes['products_options_value_id'] == PRODUCTS_OPTIONS_VALUE_TEXT_ID) { $this->contents[$products['products_id']]['attributes_values'][$attributes['products_options_id']] = $attributes['products_options_value_text']; } } } $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) { // BOF Separate Pricing Per Customer, Price Break 1.11.3 modification global $new_products_id_in_cart, $customer_id, $languages_id; $pf = new PriceFormatter; $pf->loadProduct($products_id, $languages_id); $qty = $pf->adjustQty($qty); // EOF Separate Pricing Per Customer, Price Break 1.11.3 modification $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) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id, $products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') . "')"); if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { //CLR 020606 check if input was from text box. If so, store additional attribute information //CLR 020708 check if text input is blank, if so do not add to attribute lists //CLR 030228 add htmlspecialchars processing. This handles quotes and other special chars in the user input.$attr_value = NULL; $blank_value = FALSE; if (strstr($option, TEXT_PREFIX)) { if (trim($value) == NULL) { $blank_value = TRUE; } else { $option = substr($option, strlen(TEXT_PREFIX)); $attr_value = htmlspecialchars(stripslashes($value), ENT_QUOTES); $value = PRODUCTS_OPTIONS_VALUE_TEXT_ID; $this->contents[$products_id]['attributes_values'][$option] = $attr_value; } } if (!$blank_value) { $this->contents[$products_id]['attributes'][$option] = $value; // insert into database //CLR 020606 update db insert to include attribute value_text. This is needed for text attributes. //CLR 030228 add tep_db_input() processing if (tep_session_is_registered('customer_id') && $customer_id>0) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id, $products_id_string) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_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; if (empty($quantity)) return true; // nothing needs to be updated if theres no quantity, so we return true.. $this->contents[$products_id] = array('qty' => $quantity); // update database if (tep_session_is_registered('customer_id') && $customer_id>0) 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, $products_id_string) . "'"); if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { //CLR 020606 check if input was from text box. If so, store additional attribute information //CLR 030108 check if text input is blank, if so do not update attribute lists //CLR 030228 add htmlspecialchars processing. This handles quotes and other special chars in the user input. $attr_value = NULL; $blank_value = FALSE; if (strstr($option, TEXT_PREFIX)) { if (trim($value) == NULL) { $blank_value = TRUE; } else { $option = substr($option, strlen(TEXT_PREFIX)); $attr_value = htmlspecialchars(stripslashes($value), ENT_QUOTES); $value = PRODUCTS_OPTIONS_VALUE_TEXT_ID; $this->contents[$products_id]['attributes_values'][$option] = $attr_value; } } if (!$blank_value) { $this->contents[$products_id]['attributes'][$option] = $value; // update database //CLR 020606 update db insert to include attribute value_text. This is needed for text attributes. //CLR 030228 add tep_db_input() processing if (tep_session_is_registered('customer_id') && $customer_id>0) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id, $products_id_string) . "' 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 = 0; $this->weight = 0; if (!is_array($this->contents)) return 0; // BOF Separate Pricing Per Customer, Price Break 1.11.3 mod global $languages_id; $pf = new PriceFormatter; 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)) { if ($product = $pf->loadProduct($products_id, $languages_id)){ $prid = $product['products_id']; $products_tax = tep_get_tax_rate($product['products_tax_class_id']); // $products_price = $product['products_price']; $products_price = $pf->computePrice($qty); $products_weight = $product['products_weight']; // EOF Separate Pricing Per Customer, Price Break 1.11.3 mod $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; // BOF Separate Pricing Per Customer v4, Price Break 1.11.3 modification if (!is_array($this->contents)) return false; $pf = new PriceFormatter; $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']; } */ if ($products = $pf->loadProduct($products_id, $languages_id)) { $products_price = $pf->computePrice($this->contents[$products_id]['qty']); // EOF Separate Pricing Per Customer v4, Price Break 1.11.3 modification $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'] : ''), 'attributes_values' => (isset($this->contents[$products_id]['attributes_values']) ? $this->contents[$products_id]['attributes_values'] : '')); } } return $products_array; } function show_total() { $this->calculate(); return $this->total; } function show_weight() { $this->calculate(); return $this->weight; } 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; } } } } 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']; } } } ?>
  7. Sorry for my ignorance with OSC! Among other contributions, I use Purchase Without Account and Product Attributes - Option Type Feature. I opened the class shopping_cart.php and found a few places where I might have merged wrong. I fixed it and now my cart has got its memory back. When I proceed with the checkout process I can pass checkout_shipping.php and checkout_payment.php without problems. When I come to checkout_confirmation.php, the Shipping Address and the Shipping Method shows up right, but the products doesn't and no Billing Information at all shows up. I am still able to buy and go through with an order if the product has not been assigned any group other than Retail. What about shopping_cart_pbpc.php? Maybe OTF-code has to be there also? I'm posting my classes/shopping_cart.php as it looks now:
  8. Thanks for a quick reply! I'm going to look at it tomorrow, and will probably need some more help. I'm also using Add to Wishlist contrib and it remembers what has been added even after logout.
  9. Hi! Once logged in I tested to buy products and to take them through the checkout process. Everything worked out as it should as far as I can see. What I forgot to do, was to buy products and then logout and login again to complete the order. Now I've done that and the items that I bought before I logged out doesn't appear anymore. The image of the product is now gone, there's only a "place holder", no text appear and the Sub-Total shows only: 0.00. The only thing that shows up correct is the quantity. I would appreciate help in finding the file(s) I have to look into, or even better which part(s) of the code that are responsible here. I hope I don't have to roll back everything because I really want to have SPPC :)
  10. Hi! Thanks for a wonderful contribution! I have added SPPC 4.13 and Quantity Price Breaks for Separate Pricing Per Customer on a shop with some twenty other contributions already in it. To my surprice it seems to work nicely. Now I'd like to add Hide products from customer groups for SPPC as well. I guess it is possible to do that, right?! If so - what do I need to be aware of, what is the best way of doing it etc?
  11. Hi! I have this contrib fully implemented since yesterday, and it is working nicely. I have one small issue though and it is with radio buttons. When I have two choices, both radio buttons are checked as default! My code is as follows: case PRODUCTS_OPTIONS_TYPE_RADIO: //CLR 030714 Add logic for radio buttons $tmp_html = '<table>'; $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'"); $checked = false; while ($products_options_array = tep_db_fetch_array($products_options_query)) { $tmp_html .= '<tr><td class="main">'; $tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked); $checked = false; $tmp_html .= $products_options_array['products_options_values_name']; $tmp_html .=$products_options_name['products_options_comment']; if ($products_options_array['options_values_price'] != '0') { $tmp_html .= '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } $tmp_html .= '</tr></td>'; } $tmp_html .= '</table>'; ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; As you can see I have both varibles - $checked - checked here. This way none of them are checked as default. If the first one is set to true, as per instructions, both of them stays checked and hence it's impossible to make a choice. In the code above it's possible to check one alternative but also both alternatives and in this case I want it either/or, not both: ie be able two toggle. Obviously I would like to have it set up the way Chandra has it on her demo page, that is to be able to toggle between the two radio buttons. Anyone who can see what's causing the problem from the code above? Or knows what else there might be involved? Thanks /kbking
  12. Nevermind! Seems like I've goofed up things on my local server. The main thing is that all works on the remote server. Thanks anyway!
  13. Hi! I installed this contribution the oter night and everything seemed to go well. The products show up in columns just as I wanted them to. Now when I went to Admin to add new products, I saw that it's no longer possible, only half part of that page is displayed in IE and at the bottom this message appears: Fatal error: Call to undefined function: tep_get_products_head_title_tag() in c:\wamp\www\catalog\admin\categories.php on line 586 It is where I used to be able to add meta tags and such thanks to the Header Tags Controller contrib. So I wonder what has caused all this. I read the README file and see this warning (in red): INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Add Multiples column', 'PRODUCT_LIST_MULTIPLE', '0', 'Do you want to display the Multiple Quantity with Attributes column?', '8', '11', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Add Multiples with Buy Now column', 'PRODUCT_LIST_BUY_NOW_MULTIPLE', '0', 'Do you want to display the Multiple Quantity Buy Now with Attributes column?', '8', '12', now()); Be careful with this one. If you have made changed to your configuration table, the "11" and "12" for sort_order will have to change depending on the last item with the configuration_group_id of "8" Could it have been this that has messed things up? And if so how do I correct this?
  14. Hi! Is it possible to limit the products to lets say three products side-by-side and if one wants to compare more at the same time they line up on the next row, and so forth? Otherwise it would ruin the design in some cases.
  15. Sorry for this last post, I went ahead of myself, it had to do with the sort order. Thanks anyways!
  16. Hi! This is by far the easiest and the most intelligent contribution I have added to my shop (and I have added lots of them on an heavily modded copy of OsCommerce), so thanks Amanda for your talented work. I have one question though. In the order confirmation email that I get when ordering from my site it says: Products ------------------------------------------------------ 1 x Giga System (sys1) = $1,215.00 ------------------------------------------------------ Sub-Total: $1,215.00 Flat Rate (Best Way): $5.00 Total: $1,220.00 Regular Customer Bonus: -$10.00 Now I'd like it to be: Products ------------------------------------------------------ 1 x Giga System (sys1) = $1,215.00 ------------------------------------------------------ Sub-Total: $1,215.00 Flat Rate (Best Way): $5.00 Regular Customer Bonus: -$10.00 Total: $1,210.00 (Regular Customer Bonus: -$10.00 = Is the result of Easy Discount, of course) Maybe I have missed something here, if so please advice. If not please help me out on this! Regards! /kbking
  17. I added the code, but it's not working. If I go back to the first step of the checkout process it remembers the first selected question, but not the remaining four. My code looks like this: <tr> <td colspan="" class="main"> </td> <td class="main"> <?php if (!tep_session_is_registered('question_one_form')) tep_session_register('question_one_form'); if (isset($HTTP_POST_VARS['question_one_form'])) { $question_one_form = tep_db_prepare_input($HTTP_POST_VARS['question_one_form']); } ?> <?php if (DISPLAY_FIRST_QUESTION == 'true') { $question_one = array(); if (DISPLAY_FIRST_QUESTION_TYPE == 'drop_down') $question_one[] = array('id' => '-', 'text' =>FIRST_ANSWER_DEFAULT); $question_one_querry = tep_db_query("select sources_id, sources_name from " . TABLE_QUESTIONS . " where question_number =1 order by sources_name"); while($question_one_values = tep_db_fetch_array($question_one_querry)) { $question_one[] = array('id' => $question_one_values['sources_name'], 'text' => $question_one_values['sources_name']); } ?> <?php if (DISPLAY_FIRST_QUESTION_TYPE == 'drop_down') echo tep_draw_pull_down_menu('question_one_form', $question_one); if (DISPLAY_FIRST_QUESTION_TYPE == 'input_field') echo tep_draw_input_field('question_one_form'); if (DISPLAY_FIRST_QUESTION_TYPE == 'radio_button') echo tep_draw_radio_menu('question_one_form', $question_one); if (DISPLAY_FIRST_QUESTION_TYPE == 'check_box') echo tep_draw_checkbox_field('question_one_form', 'Yes'); ?> <?php if(FIRST_QUESTION_REQUIRED == 'true')echo '<span class="inputRequirement"> ' . ENTRY_SOURCE_OTHER_TEXT . '</span>'; ?> <?php } if (DISPLAY_SECOND_QUESTION == 'true') { $question_two = array(); if (DISPLAY_SECOND_QUESTION_TYPE == 'drop_down') $question_two[] = array('id' => '-', 'text' =>SECOND_ANSWER_DEFAULT); $question_two_querry = tep_db_query("select sources_id, sources_name from " . TABLE_QUESTIONS . " where question_number =2 order by sources_name"); while($question_two_values = tep_db_fetch_array($question_two_querry)) { $question_two[] = array('id' => $question_two_values['sources_name'], 'text' => $question_two_values['sources_name']); } ?> <?php if (DISPLAY_SECOND_QUESTION_TYPE == 'drop_down') echo tep_draw_pull_down_menu('question_two_form', $question_two); if (DISPLAY_SECOND_QUESTION_TYPE == 'input_field') echo tep_draw_input_field('question_two_form'); if (DISPLAY_SECOND_QUESTION_TYPE == 'radio_button') echo tep_draw_radio_menu('question_two_form', $question_two, $selected_attribute); if (DISPLAY_SECOND_QUESTION_TYPE == 'check_box') echo tep_draw_checkbox_field('question_two_form', 'Yes'); ?> <?php if(SECOND_QUESTION_REQUIRED == 'true')echo '<span class="inputRequirement"> ' . ENTRY_SOURCE_OTHER_TEXT . '</span>'; ?> <?php } if (DISPLAY_THIRD_QUESTION == 'true') { $question_three = array(); if (DISPLAY_THIRD_QUESTION_TYPE == 'drop_down') $question_three[] = array('id' => '-', 'text' =>THIRD_ANSWER_DEFAULT); $question_three_querry = tep_db_query("select sources_id, sources_name from " . TABLE_QUESTIONS . " where question_number =3 order by sources_name"); while($question_three_values = tep_db_fetch_array($question_three_querry)) { $question_three[] = array('id' => $question_three_values['sources_name'], 'text' => $question_three_values['sources_name']); } ?> <?php if (DISPLAY_THIRD_QUESTION_TYPE == 'drop_down') echo tep_draw_pull_down_menu('question_three_form', $question_three); if (DISPLAY_THIRD_QUESTION_TYPE == 'input_field') echo tep_draw_input_field('question_three_form'); if (DISPLAY_THIRD_QUESTION_TYPE == 'radio_button') echo tep_draw_radio_menu('question_three_form', $question_three, $selected_attribute); if (DISPLAY_THIRD_QUESTION_TYPE == 'check_box') echo tep_draw_checkbox_field('question_three_form', 'Yes'); ?> <?php if(THIRD_QUESTION_REQUIRED == 'true')echo '<span class="inputRequirement"> ' . ENTRY_SOURCE_OTHER_TEXT . '</span>'; ?></td> <td class="main"> </td> </tr> <tr> <td> </td> <td colspan=""><img src="images/pixel_trans.gif" width="100%" height="10" border="0" alt=""></td> <td> </td> </tr> <tr> <td class="main"><img src="images/default/2.gif" width="20" height="20"></td> <td colspan="" class="main"><?php echo FOURTH_TITLE; ?></td> <td class="main"> </td> </tr> <?php } if (DISPLAY_FOURTH_QUESTION == 'true') { $question_four = array(); if (DISPLAY_FOURTH_QUESTION_TYPE == 'drop_down') $question_four[] = array('id' => '----', 'text' =>FOURTH_ANSWER_DEFAULT); $question_four_querry = tep_db_query("select sources_id, sources_name from " . TABLE_QUESTIONS . " where question_number =4 order by sources_name"); while($question_four_values = tep_db_fetch_array($question_four_querry)) { $question_four[] = array('id' => $question_four_values['sources_name'], 'text' => $question_four_values['sources_name']); } ?> <tr> <td class="main"> </td> <td colspan="" class="main"><?php if (DISPLAY_FOURTH_QUESTION_TYPE == 'drop_down') echo tep_draw_pull_down_menu('question_four_form', $question_four, ''); if (DISPLAY_FOURTH_QUESTION_TYPE == 'input_field') echo tep_draw_input_field('question_four_form'); if (DISPLAY_FOURTH_QUESTION_TYPE == 'radio_button') echo tep_draw_radio_menu('question_four_form', $question_four, $selected_attribute); if (DISPLAY_FOURTH_QUESTION_TYPE == 'check_box') echo tep_draw_checkbox_field('question_four_form', 'Yes'); ?></td> <td class="main"><?php if(FOURTH_QUESTION_REQUIRED == 'true')echo '<span class="inputRequirement"> ' . ENTRY_SOURCE_OTHER_TEXT . '</span>'; ?></td> </tr> <tr> <td> </td> <td colspan=""><img src="images/pixel_trans.gif" width="100%" height="10" border="0" alt=""></td> <td> </td> </tr> <?php } if (DISPLAY_FIFTH_QUESTION == 'true') { $question_five = array(); if (DISPLAY_FIFTH_QUESTION_TYPE == 'drop_down') $question_five[] = array('id' => '----', 'text' =>FIFTH_ANSWER_DEFAULT); $question_five_querry = tep_db_query("select sources_id, sources_name from " . TABLE_QUESTIONS . " where question_number =5 order by sources_name"); while($question_five_values = tep_db_fetch_array($question_five_querry)) { $question_five[] = array('id' => $question_five_values['sources_name'], 'text' => $question_five_values['sources_name']); } ?> <tr> <td class="main"><img src="images/default/3.gif" width="20" height="20"></td> <td colspan="" class="main"><?php echo FIFTH_TITLE; ?></td> <td class="main"> </td> </tr> <tr> <td class="main"> </td> <td colspan="" class="main"><?php if (DISPLAY_FIFTH_QUESTION_TYPE == 'drop_down') echo tep_draw_pull_down_menu('question_five_form', $question_five); if (DISPLAY_FIFTH_QUESTION_TYPE == 'input_field') echo tep_draw_input_field('question_five_form','','size="60"'); if (DISPLAY_FIFTH_QUESTION_TYPE == 'radio_button') echo tep_draw_radio_menu('question_five_form', $question_five, $selected_attribute); if (DISPLAY_FIFTH_QUESTION_TYPE == 'check_box') echo tep_draw_checkbox_field('question_five_form', 'Yes'); ?> </td> <td class="main"><?php if(FIFTH_QUESTION_REQUIRED == 'true')echo '<span class="inputRequirement"> ' . ENTRY_SOURCE_OTHER_TEXT . '</span>';?></td> </tr> <tr> <td> </td> <td colspan=""><img src="images/pixel_trans.gif" width="100%" height="10" border="0" alt=""></td> <td> </td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td> <?php } ?>
  18. Strange, I played with it a bit in Admin, changed from drop_down to Checkbox, set to True and False at Display Questions and so forth. At first the First, Second, Fourth and Fifth Questions were visible and editable in Admin, but all of a sudden only First, Second and Third are visible and editable. I am using the script in checkout_shipping.php and on this page all five questions shows up. Very odd. What could possibly cause this? Otherwise there seems to be no problem, the answers show up on checkout_confirmation.php and in the order email as well.
  19. Do you mean that we should use this format on these in extra_questions_show_box.php: if (DISPLAY_FIRST_QUESTION_TYPE == 'drop_down') echo tep_draw_pull_down_menu('question_one_form', $question_one); if (DISPLAY_FIRST_QUESTION_TYPE == 'input_field') echo tep_draw_input_field('question_one_form'); if (DISPLAY_FIRST_QUESTION_TYPE == 'radio_button') echo tep_draw_radio_menu('question_one_form', $question_one); if (DISPLAY_FIRST_QUESTION_TYPE == 'check_box') echo tep_draw_checkbox_field('question_one_form', 'Yes');
  20. I found the "wrongdoing" that I'd made: In includes/filenames.php I had by mistake added the code this way: // ADDED BY KBKING for articlesdefine('FILENAME_ARTICLE_INFO', 'article_info.php'); define('FILENAME_ARTICLE_LISTING', 'article_listing.php');... This is the corrected code: // ADDED BY KBKING for articles define('FILENAME_ARTICLE_INFO', 'article_info.php'); define('FILENAME_ARTICLE_LISTING', 'article_listing.php');... Thanks anyway
  21. Hi! I have installed Article Manager v1.2b and am having a hard time figuring out what I have done wrong. When I click on an article it links me like this: http://page.com/catalog/FILENAME_ARTICLE_INFO?articles_id=9 In the readme.txt it says that people can review articles. The screeenshots that are available for download, one can see that there should appear a button for the article readers to click on in order to review an article. This feature does show in Admin but in the Front-end it does not show at all! In the Admin I can't see anything that indicates that somthing is wrong, everything shows as it should I think. I really want to have this great contribute on my site. Sorry for cross posting, didn't see this support thread until now. TIA /kbking
  22. Hi! I have installed Article Manager v1.2b and am having a hard time figuring out what I have done wrong. When I click on an article it links me like this: http://page.com/catalog/FILENAME_ARTICLE_INFO?articles_id=9 In the readme.txt it says that people can review articles. The screeenshots that are available for download one can see that there should appear a button for the article readers to click on in order to review an article. This feature does not show at all! In the Admin I can't see anything that indicates that somthing is wrong, everything shows as it should I think. TIA /kbking
  23. I found it. I had in fact added a snippet of code twice. Thanks anyway!
  24. Hi! Yes I have this problem: It seems as everything shows up perfect in the Admin part of my OSC site. I can add Authors, Articles, Topics etc without any problems. I have seen a lot of topics about "Cannot redeclare" and what is causing it, namley that a variable occurs twice. Now I don't know if this is it, or where to look. Any advice is very much appreciated! TIA /kbking
×
×
  • Create New...