Results 1 to 7 of 7
  1. #1
    Join Date
    May 2008
    Posts
    15
    Plugin Contributions
    0

    Default **help** Loading Problems

    Hi

    Can anyone tell me why my website does not load first time sometimes. I have to refresh it two or three times for the page to appear.

    http://www.takedigital.co.uk

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: **help** Loading Problems

    I had to refresh once the first time, and it has loaded properly every time thereafter, even after clearing my cache (IE7).

    Have you tried it with the 'classic' template to see if it does the same thing?

  3. #3
    Join Date
    May 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: **help** Loading Problems

    Quote Originally Posted by stevesh View Post
    I had to refresh once the first time, and it has loaded properly every time thereafter, even after clearing my cache (IE7).

    Have you tried it with the 'classic' template to see if it does the same thing?
    Yes, I have tried it with serval different templates but the same thing happens. Do you know why?

  4. #4
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: **help** Loading Problems

    You have something that is busted - When viewed with FireFox I get his at the top of the page ...

    Code:
    SESSION['customer_id'] . "'"; $check = $db->Execute($check_query); if ($check->fields['count'] > 0) { $sql = "delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $_GET['products_id'] . "' and customers_id = '" . $_SESSION['customer_id'] . "'"; $db->Execute($sql); } zen_redirect(zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'main_page')))); } else { $_SESSION['navigation']->set_snapshot(); zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL')); } } /** * Method to handle cart Action - Customer Order * * @param string forward destination * @param url parameters */ function actionCustomerOrder($goto, $parameters) { global $zco_page; if ($_SESSION['customer_id'] && isset($_GET['pid'])) { if (zen_has_product_attributes($_GET['pid'])) { zen_redirect(zen_href_link(zen_get_info_page($_GET['pid']), 'products_id=' . $_GET['pid'])); } else { $this->add_cart($_GET['pid'], $this->get_quantity($_GET['pid'])+1); } } zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); } /** * Method to handle cart Action - remove product * * @param string forward destination * @param url parameters */ function actionRemoveProduct($goto, $parameters) { if (isset($_GET['product_id']) && zen_not_null($_GET['product_id'])) $this->remove($_GET['product_id']); zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); } /** * Method to handle cart Action - user action * * @param string forward destination * @param url parameters */ function actionCartUserAction($goto, $parameters) { $this->notify('NOTIFY_CART_USER_ACTION'); } } ?> able_cost); for ($i=0, $n=$size; $i<$n; $i+=2) { if ($check_for >= $attribute_table_cost[$i]) { $attribute_quantity_check = $attribute_table_cost[$i]; $attribute_quantity_price = $attribute_table_cost[$i+1]; } } // echo '
    Cost ' . $check_for . ' - ' . $attribute_quantity_check . ' x ' . $attribute_quantity_price; return $attribute_quantity_price; } //// // attributes final price function zen_get_attributes_price_final($attribute, $qty = 1, $pre_selected, $include_onetime = 'false') { global $db; global $cart; $attributes_price_final = 0; if ($pre_selected == '' or $attribute != $pre_selected->fields["products_attributes_id"]) { $pre_selected = $db->Execute("select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_attributes_id= '" . (int)$attribute . "'"); } else { // use existing select } // normal attributes price //************************************************************* //***** 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; $option_price_array = $pre_selected->fields['options_values_price_w']; $optionprice = explode(",",$option_price_array); $options_values_price = $optionprice[$i]; if ($options_values_price=='0' || $options_values_price==''){ $options_values_price = $optionprice[0]; } $the_base_price += $options_values_price; if ($options_values_price=='0'){ $options_values_price = $pre_selected->fields['options_values_price']; } } else { $options_values_price = $pre_selected->fields['options_values_price']; } } else { $options_values_price = $pre_selected->fields['options_values_price']; } if ($pre_selected->fields["price_prefix"] == '-') { $attributes_price_final -= $options_values_price; } else { $attributes_price_final += $options_values_price; } //************************************************************* //***** CHECK WHETHER WHOLESALE OR RETAIL AND GET CORRECT PRICE //************************************************************* /* if ($pre_selected->fields["price_prefix"] == '-') { $attributes_price_final -= $pre_selected->fields["options_values_price"]; } else { $attributes_price_final += $pre_selected->fields["options_values_price"]; } */ // qty discounts $attributes_price_final += zen_get_attributes_qty_prices_onetime($pre_selected->fields["attributes_qty_prices"], $qty); // price factor $display_normal_price = zen_get_products_actual_price($pre_selected->fields["products_id"]); $display_special_price = zen_get_products_special_price($pre_selected->fields["products_id"]); $attributes_price_final += zen_get_attributes_price_factor($display_normal_price, $display_special_price, $pre_selected->fields["attributes_price_factor"], $pre_selected->fields["attributes_price_factor_offset"]); // per word and letter charges if (zen_get_attributes_type($attribute) == PRODUCTS_OPTIONS_TYPE_TEXT) { // calc per word or per letter } // onetime charges if ($include_onetime == 'true') { $pre_selected_onetime = $pre_selected; $attributes_price_final += zen_get_attributes_price_final_onetime($pre_selected->fields["products_attributes_id"], 1, $pre_selected_onetime); } return $attributes_price_final; } //// // attributes final price onetime function zen_get_attributes_price_final_onetime($attribute, $qty= 1, $pre_selected_onetime) { global $db; global $cart; if ($pre_selected_onetime == '' or $attribute != $pre_selected_onetime->fields["products_attributes_id"]) { $pre_selected_onetime = $db->Execute("select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_attributes_id= '" . (int)$attribute . "'"); } else { // use existing select } // one time charges // onetime charge $attributes_price_final_onetime += $pre_selected_onetime->fields["attributes_price_onetime"]; // price factor $display_normal_price = zen_get_products_actual_price($pre_selected_onetime->fields["products_id"]); $display_special_price = zen_get_products_special_price($pre_selected_onetime->fields["products_id"]); // price factor one time $attributes_price_final_onetime += zen_get_attributes_price_factor($display_normal_price, $display_special_price, $pre_selected_onetime->fields["attributes_price_factor_onetime"], $pre_selected_onetime->fields["attributes_price_factor_onetime_offset"]); // onetime charge qty price $attributes_price_final_onetime += zen_get_attributes_qty_prices_onetime($pre_selected_onetime->fields["attributes_qty_prices_onetime"], 1); return $attributes_price_final_onetime; } //// // get attributes type function zen_get_attributes_type($check_attribute) { global $db; $check_options_id_query = $db->Execute("select options_id from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_attributes_id='" . (int)$check_attribute . "'"); $check_type_query = $db->Execute("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id='" . (int)$check_options_id_query->fields['options_id'] . "'"); return $check_type_query->fields['products_options_type']; } //// // calculate words function zen_get_word_count($string, $free=0) { if ($string != '') { while (strstr($string, ' ')) $string = str_replace(' ', ' ', $string); $string = trim($string); $word_count = substr_count($string, ' '); return (($word_count+1) - $free); } else { // nothing to count return 0; } } //// // calculate words price function zen_get_word_count_price($string, $free=0, $price) { $word_count = zen_get_word_count($string, $free); if ($word_count >= 1) { return ($word_count * $price); } else { return 0; } } //// // calculate letters function zen_get_letters_count($string, $free=0) { while (strstr($string, ' ')) $string = str_replace(' ', ' ', $string); $string = trim($string); if (TEXT_SPACES_FREE == '1') { $letters_count = strlen(str_replace(' ', '', $string)); } else { $letters_count = strlen($string); } if ($letters_count - $free >= 1) { return ($letters_count - $free); } else { return 0; } } //// // calculate letters price function zen_get_letters_count_price($string, $free=0, $price) { $letters_price = zen_get_letters_count($string, $free) * $price; if ($letters_price <= 0) { return 0; } else { return $letters_price; } } //// // compute discount based on qty function zen_get_products_discount_price_qty($product_id, $check_qty, $check_amount=0) { global $db, $cart; $new_qty = $_SESSION['cart']->in_cart_mixed_discount_quantity($product_id); // check for discount qty mix if ($new_qty > $check_qty) { $check_qty = $new_qty; } $product_id = (int)$product_id; $products_query = $db->Execute("select products_discount_type, products_discount_type_from, products_priced_by_attribute from " . TABLE_PRODUCTS . " where products_id='" . (int)$product_id . "'"); $products_discounts_query = $db->Execute("select * from " . TABLE_PRODUCTS_DISCOUNT_QUANTITY . " where products_id='" . (int)$product_id . "' and discount_qty <='" . (float)$check_qty . "' order by discount_qty desc"); $display_price = zen_get_products_base_price($product_id); $display_specials_price = zen_get_products_special_price($product_id, true); switch ($products_query->fields['products_discount_type']) { // none case ($products_discounts_query->EOF): //no discount applies $discounted_price = zen_get_products_actual_price($product_id); break; case '0': $discounted_price = zen_get_products_actual_price($product_id); break; // percentage discount case '1': if ($products_query->fields['products_discount_type_from'] == '0') { // priced by attributes if ($check_amount != 0) { $discounted_price = $check_amount - ($check_amount * ($products_discounts_query->fields['discount_price']/100)); //echo 'ID#' . $product_id . ' Amount is: ' . $check_amount . ' discount: ' . $discounted_price . '
    '; //echo 'I SEE 2 for ' . $products_query->fields['products_discount_type'] . ' - ' . $products_query->fields['products_discount_type_from'] . ' - '. $check_amount . ' new: ' . $discounted_price . ' qty: ' . $check_qty; } else { $discounted_price = $display_price - ($display_price * ($products_discounts_query->fields['discount_price']/100)); } } else { if (!$display_specials_price) { // priced by attributes if ($check_amount != 0) { $discounted_price = $check_amount - ($check_amount * ($products_discounts_query->fields['discount_price']/100)); } else { $discounted_price = $display_price - ($display_price * ($products_discounts_query->fields['discount_price']/100)); } } else { $discounted_price = $display_specials_price - ($display_specials_price * ($products_discounts_query->fields['discount_price']/100)); } } break; // actual price case '2': if ($products_query->fields['products_discount_type_from'] == '0') { $discounted_price = $products_discounts_query->fields['discount_price']; } else { $discounted_price = $products_discounts_query->fields['discount_price']; } break; // amount offprice case '3': if ($products_query->fields['products_discount_type_from'] == '0') { $discounted_price = $display_price - $products_discounts_query->fields['discount_price']; } else { if (!$display_specials_price) { $discounted_price = $display_price - $products_discounts_query->fields['discount_price']; } else { $discounted_price = $display_specials_price - $products_discounts_query->fields['discount_price']; } } break; } return $discounted_price; } //// // are there discount quanties function zen_get_discount_qty($product_id, $check_qty) { global $db; $product_id = (int)$product_id; $discounts_qty_query = $db->Execute("select * from " . TABLE_PRODUCTS_DISCOUNT_QUANTITY . " where products_id='" . (int)$product_id . "' and discount_qty != 0"); //echo 'zen_get_discount_qty: ' . $product_id . ' - ' . $check_qty . '
    '; if ($discounts_qty_query->RecordCount() > 0 and $check_qty > 0) { return true; } else { return false; } } //// // set the products_price_sorter function zen_update_products_price_sorter($product_id) { global $db; $products_price_sorter = zen_get_products_actual_price($product_id); $db->Execute("update " . TABLE_PRODUCTS . " set products_price_sorter='" . zen_db_prepare_input($products_price_sorter) . "' where products_id='" . (int)$product_id . "'"); } //// // salemaker categories array function zen_parse_salemaker_categories($clist) { $clist_array = explode(',', $clist); // make sure no duplicate category IDs exist which could lock the server in a loop $tmp_array = array(); $n = sizeof($clist_array); for ($i=0; $i<$n; $i++) { if (!in_array($clist_array[$i], $tmp_array)) { $tmp_array[] = $clist_array[$i]; } } return $tmp_array; } //// // update salemaker product prices per category per product function zen_update_salemaker_product_prices($salemaker_id) { global $db; $zv_categories = $db->Execute("select sale_categories_selected from " . TABLE_SALEMAKER_SALES . " where sale_id = '" . (int)$salemaker_id . "'"); $za_salemaker_categories = zen_parse_salemaker_categories($zv_categories->fields['sale_categories_selected']); $n = sizeof($za_salemaker_categories); for ($i=0; $i<$n; $i++) { $update_products_price = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . (int)$za_salemaker_categories[$i] . "'"); while (!$update_products_price->EOF) { zen_update_products_price_sorter($update_products_price->fields['products_id']); $update_products_price->MoveNext(); } } } ?>
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  5. #5
    Join Date
    May 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: **help** Loading Problems

    OK, I have fixed that, but i still have the same problem. Website does not always load first time.

    Any solutions?

  6. #6
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: **help** Loading Problems

    I'm pretty sure it's a server thing - maybe your error logs would tell you something.

  7. #7
    Join Date
    May 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: **help** Loading Problems

    Yes it does look like its a server problem. Im using streamline.net to host my website and it looks like other people using streamline are getting the same problems.

    Something to do with .htaccess file

 

 

Similar Threads

  1. v139h Problems loading admin pages and product additional images -Please help!
    By nickorett in forum General Questions
    Replies: 1
    Last Post: 29 Jul 2012, 09:52 PM
  2. Go Daddy Loading problems
    By jamjali in forum General Questions
    Replies: 3
    Last Post: 27 Oct 2011, 06:29 AM
  3. Store Loading Problems
    By Miff in forum General Questions
    Replies: 4
    Last Post: 29 Jan 2011, 07:55 PM
  4. Help need Urgently - problems after loading products with Easy Populate 1.2.5.5 addon
    By marketimpact in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 20 Aug 2009, 01:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg